edited October 2014 in ORK Support
Hey there GiL,
I wanted to create an item box in one of 4 different set locations. When the item box destroys itself after being looted, I want it to wait 30 seconds before it will respawn again in one of the 4 preset locations.

Thanks again.
  • And I'm not sure if I'm using it correctly but the set variable after items collected isn't working.
  • It's probably best to handle this through another event that waits for some time and randomly spawns an item box (e.g. through a prefab).
    E.g. An autostart event that repeats it's execution and only runs if a variable is set.

    But you're correct, item box currently doesn't set the variables, only the single item collectors do. Will fix that in the next update.
    In the meantime, you could wrap your item boxes with an event that sets the variable. Set the item box to None start type and add an event to it that uses the Start Item Collector step to open the box.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I've already done up an event that goes pretty much the way you explained it, however i couldn't get my head around how to get required variable to change when the loot in the container (or the container time limit) is null.
    For example, my container holds 2 items, there for the container Harvested variable is false.
    If the character loots these two items then closes the container, the container Harvested variable is now set to true, which causes the prefab to delete itself then wait 45 seconds before performing the next step, the next step is a set of chance values that which gives a chance for the prefab to show up in one of four places.

    This leads to my next question, I'm not sure if it's my understanding of the chance fork, or if the chance fork works properly, but my four positions were set to range values as follows

    Position 1 - Range 0 -25
    Position 2 - Range 26 -50
    Position 3 - Range 51 - 75
    Position 4 - Range 76 - 100

    from my understanding this meant that on average each of those positions has a 25% chance of spawning the prefab, however the prefab would only be spawned at the first position.
    To fix this I just made 4 chance nodes linking to each other when they fail so that at least something has to spawn.

    my thinking for when you fix the variable set on item collection though is that I will have an event that will auto start when the prefab is made, that will relocate the collecter when in one of the four positions.
  • edited October 2014
    you should see about adding a check for if an item collector has 0 items in it.
    could be used to either refill the object or to delete it (this is referring to the Ork Framework>Events tab) :P.
    Post edited by Solist on
  • Check your Chance Settings in Game > Game Settings if they're set to 0-100. Also, you might want to use the ranges 0-25, 25-50, 50-75 and 75 to 100, otherwise you'd get a failed check for values betwee 25-26, etc.
    Other than that, the Chance Fork works as expected, whichever range is hit by the randomly generated chance will be executed (did a quick test and worked fine).

    I don't think there's currently a way to only set a variable when an item box is empty, but I can add an event step to check it in the next update :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited October 2014
    maybe just have it check for a number of items in the item box.
    Say if the box starts with 4 items, i want to check when it has 2 items left.
    (so it's not only limited to the item box being empty).

    Thank You again GiL :)
    Post edited by Solist on
  • The new step will allow that, checking the number of items in a box.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hey there GiL,

    Is there a way to refresh an item ID through the event system?
  • Can you give me more details, cause I don't really know what you want to do :)
    Are you talking items or item box?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2014
    I'm talking item box, what I want to do is have the item box prefab respawn and recreate a new list of items in it without changing the box ID.
    At the moment it spawns the prefab the first time with loot and then I go loot it, the prefab destroys itself and my timer event starts, but every time after that it spawns the prefab with no loot in it.

    I hope that description helps,
    Thanks again GiL :)
    Post edited by Solist on
  • edited November 2014
    Use the Remove Item Box Data step without enabling Set Empty. This will remove the item box completely from the stored list, resulting in it being refilled when you enter the scene the next time.
    Sadly, the step is currently bugged in ORK 2.1.10 (throwing errors in the editor). Will fix that in the next update :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The harvesting system now works in my game.

    I will be willing to pop my test project into a scene for those who want to know how it works :).

    will also be changing this discussion to "Solved".
  • That would be useful, Solist. : )
  • i'm waiting for this tutorial :)
  • Yes can you share this tutorial please? Thanks
Sign In or Register to comment.