I've struggled with this one as path-finding is asynchronous. Due to this construct 2 actually has a way of dealing with the asynchronous nature of path-finding by having an event that will fire when a path is found (because it does not complete at a strict time such as one tic or after 'x' seconds. No problem there.
Issue comes in when I regenerate obstacle maps. How do I actually know when its completed? There is no event called 'On obstacle map regeneration complete'. I've tried using wait 0 seconds to force the code to run at the end of a tic however this does not work because it can take more than the tic to complete. I've tried using wait 3 seconds and this seemingly works but i'm simply guessing (and gambling) how long it will take to regen obstacle map and if I guess wrong for the 'longest' time it would ever take then the entire thing falls apart.
Does anyone have a guaranteed way (strict way) to 'know' when the obstacle map has been regenerated so I can then call a new path-find event? Why is there no event called 'on obstacle map regenerated'?