I’m trying to make it so a stationary character applies a penalty around them, so that units nicely path around them, giving them a wide berth. When they start moving again I run an opposite GUO that unapplies the penalty on the same graph in the same bounds.
This works nicely, until a rescan, in which case the old graph update object seems to be disappeared if it is within the area rescaned, and then the undo puts the penalty to negative, causing a stack overflow.
So I’m curious, is there a proper way to undo an applied GUO?
Sorry, there’s no data that tracks specifically from where a penalty came from. So this is not possible.
I would recommend that if you scan the graph, make sure to set a flag so that your code knows that it shouldn’t try to revert any existing GUOs.
I mean that if you scan the graph, you can tell all your scripts not to revert their current GUOs, as they have already essentially been reverted. Or you can re-apply them so that they can be reverted later.