First of all, I'm not sure this is the right forum, but there doesn't appear to be a modding subforum here, so apologies if this is in the wrong place.
Basically, I've got the QG to order a teleport on behalf of a unit:
- Code: Select all
WarpNearbyUnits = function(self, radius)
<some code>
for k, v in nearbyunits do
v:OnTeleportUnit(myteleporter, warplocation, v:GetOrientation())
end
end
But the problem comes in that I can't cancel it - the teleporting unit will insist on doing the teleport, and putting a major drain on my economy for all that time, even if I change my mind. Interestingly, when holding shift no purple line appears to indicate a teleport, so the unit clearly doesn't recognise it's been given a teleport order.
A bit of searching leads me to believe there'll be no luck in actually ordering a teleport the way the game does it the rest of the time (so it accepts a cancel in the usual way), so I guess the next best thing is some sort of script that checks for a stop command and tells the teleport to stop if it receives one.
My question is: Is this possible, and if so how, or am I out of luck?