you know, adding obstacles for Los- and pathfinding behaviors.
There is a deep logic in C2. A lot is very similar.
There are actions that take time, some even more time then 1 tick. 'Find path' is one of those. That is why you have the 'on path found' conditions. Same Ajax actions. You have the 'on completed' conditions.
But, there are also actions/conditions that take a lot of time, but stay in the SAME TICK. The obvious loop conditions, by instance. You will not find a 'on loop completed condition'. Same logic goes for adding obstacles. You will not find a 'on obstacle map completed' condition. Hence, it happens in the same tick. If the generation of the obstacle map takes 5 seconds, the tick will rest for 5 seconds.
The obstacle map is build on the end of the tick. And is therefor available in the tick after you initiate the action.
But it gets 'worse'. There are obstacle maps that you dont realise. Like that one associated with the platform, to map the solids. And there is only 1 obstacle map for all instances with a paltform behavior. This is by design, for performance issues (those you try to obey, but it is impossible)
Also pathfinding has 1 and only 1 obstacle map for all instances of an object, with the bahavior attached. Change the obstacle map for one, and you change it for all. Same goes for LoS.
So, given that creating obstacle maps take time, that they happen in the same tick and that there is only 1 obstacle map ..... and If you use a loop to assign obstacles .. then .. i say ...
1/ the time for that one tick gets really long
2/ the pathfinders in that same tick start as there are no obstacles
3/ its a little dumb, do assign obstacles 1 (and only 1) time after all objects are in place
3/bis Attention with the 'newly created objects théorème'. You have to make a new Top-Level_Event to pick them.