edited August 2019 in ORK Scripting
I have a custom ORK event step, and I want to loop some code until certain condition is true and then end the event. Lets say as simple example a custom object move event that stops when object reaches destination

What is the best way to loop that code? I could not quite understand how Execute, Continue and index are tied together. Do I just place a while loop in execute node or is there another way to do it?

I looked at similar event steps, which usually add a custom component to target object to handle the looping code, is that the only way to do it?
Post edited by hellwalker on
  • So far I just use a wait 1 second node and recheck the condition.

    For instance for my NPC schedule, it checks to see if he is X units from his destination every 1 second.
  • I'd recommend to check out the code for event nodes that use the Continue functionality (i.e. override that function). E.g. the ActivateObjectStep class.

    The simple explanation is to have the logic in the Continue function and call that in the Execute function. Continue should use the base event's StartContinue function to call continue again after some time.
    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!
  • Thank you! Makes sense now.

    I guess the thing that confused me was whether there was some kind of internal event tick system that if misused might have stopped other parallel game events instances (not steps) from running. (Blocked them until this event was finished)
Sign In or Register to comment.