Jump to content

poly

Members
  • Posts

    94
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

poly's Achievements

Survivor

Survivor (3/15)

18

Reputation

  1. Gotcha! Thank you for all your help with this 😁
  2. So all of the probability is worked out in the random roll this way, and the _craftCount is merely a conduit to enable the buff activated upon the item craft?
  3. Just tried this and it works in my game with my custom variables - thanks! Although I'd like to understand why the original randomroll didn't work. Like you said, if not a normal 0-100 range could that affect it?
  4. I'm sure I've read in one of the local xml files a comment wishlist door lock system which will act as a type of key, that is detectable in the players inventory. So you don't need to continually break down locked doors if you have the key on you.
  5. I've added the randomroll but can't get it to work properly: <triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="craft_drunk1" operation="set" value="1"/> <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="buffBeer"> <requirement name="RandomRoll" seed_type="Random" min_max="1,2" operation="Equals" value="@craft_drunk1"/> <requirement name="CVarCompare" cvar="_craftCount_beerkeg1" operation="GTE" value="@craft_drunk1"/> </triggered_effect> <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="craft_drunk1" operation="add" value="1"> <requirement name="CVarCompare" cvar="_craftCount_beerkeg1" operation="GT" value="@craft_drunk1"/> </triggered_effect> So the cvar is set to 1 by default, Then the buff is added only if 2 requirements are met: 1. If the randomroll is equal to the cvar: 1 2. If the _craftCount_beerkeg1 is greater than/equal to the cvar, again which is 1. The _craftCount_beerkeg1 is 0 by default, and changes to 1 upon being crafted. So in theory if these 2 conditions are met, then the buff 'buffBeer' is triggered. It's basically a 50% chance of getting the buff upon crafting the item 'beerkeg1'. However, nothing happens. Am I doing something wrong? P.S thanks for all your help, its taken me a while to get my head around it
  6. Thanks for the suggestion In this example wouldn't the player permanently change the cvar to a value of 1 for example? If all players enter with a value of 0, then upon crafting an item it has a random chance to activate buff and change the value from 0 to 1... this would mean the buff could only be activated once?, as each successive time the value would still be 1.
  7. Hi all, I'm trying to create a buff whereby a player has a small chance to get drunk when crafting specific items - e.g. items related to beer brewing 🍻 Here's what I am trying, can somebody advise if this is correct, or what a better way to go about it would be? <buff name="RandomDrunk" hidden="true"> <update_rate value="1"/> <stack_type value="ignore"/> <effect_group> <!-- 1 --><passive_effect name="CraftingIngredientCount" operation="base_set" value="@$randomdrunk" tags="randomdrunk"/> <!-- this needs to be ingredient count/crafting count in order to carry over a specific number to the random roll --> <!-- 3 --><triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBeer"> <!-- 2 --><requirement name="RandomRoll" seed_type="Random" min_max="1,4" operation="Equals" value="@$randomdrunk"/> </triggered_effect> </effect_group> </buff> So the buff has 3 parts... Part 1: Player crafts an item with an ingredient count of 1, 2, 3 or 4 (there will be 4 recipes) Part 2: Buff randomly rolls a number between 1 and 4. Part 3: If the randomly rolled number is the same as the crafting ingredient count then the drunken buff is added. If the numbers are different no buff is added. To me, a novice with coding, this makes sense? However when I craft an item nothing happens - besides the item being crafted. Which leads me to think I'm missing a crucial step somewhere. Can anyone help? Thank you
  8. Thanks so much for the reply! Here is a simplified code, for context, I'm trying to make a casino mod with slot machines, the sound effect is supposed to mimic a kind of jackpot win feeling! <buff name="DoubleORNothing" hidden="true"> <update_rate value="1"/> <stack_type value="ignore"/> <effect_group> <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$doubleornothing" operation="setvalue" value="randomint(0,1)"/> <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$doubleornothing" operation="multiply" value="2"/> <passive_effect name="CraftingOutputCount" operation="perc_set" value="@$doubleornothing" tags="doubleornothing"/> </effect_group> <effect_group> <triggered_effect trigger="onSelfBuffUpdate" action="AddBuff" buff="SlotWin"> <requirement name="CraftingOutputCount" operation="GT" value="0.1"/> </triggered_effect> </effect_group> </buff> <buff name="SlotWin" hidden="true"> <duration value="2"/> <stack_type value="ignore"/> <effect_group> <triggered_effect trigger="onSelfBuffStart" action="PlaySound" sound="open_apache_artifact_chest" play_in_head="true"/> <triggered_effect trigger="onSelfBuffFinish" action="StopSound" sound="open_apache_artifact_chest" play_in_head="true"/> </effect_group> </buff> Essentially what happens here is a random number is generated between 0 and 1. If the number is 1 a buff is triggered, the buff will be a sound effect! However, what happens with this code is that when I log into the world the sound affect triggers constantly, without being in the crafting menu or having crafted the item to produce the CraftingOutputCount
  9. Does anyone have any suggestions before I shelf this idea, been trying to 2 weeks+ every day with no avail. 😁
  10. Hi all, I hope somebody here can advise. I'm trying to create buff that plays a sound when a variable achieved. Here is my code: <passive_effect name="CraftingOutputCount" operation="perc_set" value="@$machineoutput" tags="testslot"/> <triggered_effect trigger="onSelfBuffUpdate" action="PlaySound" sound="open_apache_artifact_chest" play_in_head="true"> <requirement name="CVarCompare" cvar="@$machineoutput" operation="Equals" value="10" tags="slot100"/> </triggered_effect> The code works fine without the triggered effect. the '@$machineoutput' is sent out and works okay in game. @$machineoutput is a random number from 10 to 100. What I'm trying to do is if the number hits 10 (the lowest possible number), a sound is played. I have tried everything but nothing works. I have tried putting it in it's own effect group, putting the triggered before the passive, creating a secondary buff etc. The closest I have got is it plays the sound nonstop in game, regardless of the passive effect being active or not. Can anyone seeing anything obviously wrong with the code? Thanks
  11. Hi all, I've been modding for over year, just basic stuff. But I've encountered the XUi xml files for the first time yesterday and it has completely blown my mind how muddled (to my mind) it all looks. I'm trying to customize a user interface for a workstation but because there are so many <window>, <panel>,<rect>,<grid> et al boxes all with different widths/heights and relative pos co-ords it is taking me an eternity just to move something 1 inch to the left. Plus I have no idea what's in the empty spaces - I may have boxes there that are redundant. I used to play around with HTML/CSS years ago and remember the <border> attribute, which was incredibly useful when editing relative positions/widths etc. Is there anything like that which I can turn on - if only in the editing stages - just to make it a bit easier for me to design? After I get the absolute positions correct I will overlay with an image anyway. Is there an online program that gives you a live result as you edit? Thanks
  12. Thanks for reply Yes I always create a new world when playing around with block editing. I didn't leave the chunk area however so I will try that... perhaps that has an effect. For clarity, I didn't amend the trader vending machines, I created a duplicate block with the same properties and placed it in the world to test. Works fine except for the time, so maybe it is hardcoded after all.
  13. I'd like to know if this is possible, Within traders.xml there is this line: <trader_info id="5" reset_interval="-1" override_buy_markup="1.0" override_sell_markup="1.0" allow_sell="false" rentable="true" rent_cost="2500" rent_time="30"/> The options 'rent_cost' and 'rent_time' would suggest that these settings are changeable, but if I change rent_time from 30 days to any other value, for example 7 days, the change is only superficial. The expiry date still assumes 30 days, and by skipping passed the amended 7 days date this confirms that nothing has changed - the vending machine is still rented by the player. However, if I change the cost from 2500 to 500 for example, this works. I am only charged 500 dukes. If the value for rented days anywhere else in the xml other than traders.xml? Many Thanks
  14. Hi All, I'm venturing into making a new mod and this time I like the idea of a casino mod with working slot machines etc, possibly Duke's Casino! (mod name tbd) I've search for existing/similar mods and the closest I've found is a couple of mods made by @Snufkin but they haven't been active on here for about 18 months and the mods no longer work for the current version. I've looked at the code for ideas but one uses a .dll file and that is beyond me. I can do xml only - and use free assets that I find, that's about it. Does anybody know of any mods out there which may be useful for me to look at? Even just the mechanics may be useful. At the moment I have a simple slot machine, which you use the secondary action on the play - it goes to a spinning stage, then results in an untouched loot block which can be opened by anyone close enough. For this I've adapted the farming technique of growth stages > sow the seed > seed grows > mature plant ready for harvest (loot). Any help is appreciated!
  15. Hi, Yes you can install it on a dedicated server. We run ours on a dedicated server for play testing. You will need a new game save because the mod adds back a 'wellness' style mechanic which is created when a new player joins the world.
×
×
  • Create New...