No, no not at all! I don't want a dead AI! I just need the AI to obey when you want to intervene with what it's doing, that's all.
Do you know if AIs ever cancel troop training, cancel building constructions, unsummon already finished buildings, cancel research, or cancel upgrades? These might interfere with the AI or player.
Why did it unsummon? Did the AI not place it perfectly?
Unsummon
native command. This isn't something you should worry about, AI is not supposed to unsummon by mistake.Per ABronzeCross's other post:You probably gave the best answer/idea to this.
Per ABronzeCross's other post:
- Events
- Unit - A unit is issued an order targeting an object //"object" may not be the correct term
- Unit - A unit is issued an order targeting a point
- Unit - A Unit is issued an order with no target
- Conditions
- (Owner of (Triggering Unit)) not equal to (Triggering Player) //Triggering Player should work here
- Actions
- Custom script: local unit udg_Change_Unit
- Custom script: local player udg_Change_Player
- Set Change_Unit = (Triggering Unit)
- Set Change_Player = (Owner of (Triggering Unit))
- Unit - Change owner of Change_Unit to (Triggering Player) without changing color
- Wait 10.00 game-time seconds
- Unit - Change owner of Change_Unit to Change_Player without changing color
- -------- might not need these lines, but my suspicion is you will: --------
- Custom script: set udg_Change_Unit = null
- Custom script: set udg_Change_Player = null
No those variables have to be created in the variable editor. What I did is called local shadowing to make them behave as local variables.You can create local variables with udg then refer to them with gui set variable? What sorcery is this?!
I mean it makes sense, global/local modifiers shouldn't matter when assigning variables but that is a neat trick.
Thanks for itYou probably gave the best answer/idea to this.
So this is hiding a global variable with a local variable, same as hiding a static variable in java for example? Does the value assigned to the local variable stick to the global variable, or are they two separate entities?No those variables have to be created in the variable editor. What I did is called local shadowing to make them behave as local variables.
Yes basically the same thing, but within the scope of the trigger if a global is shadowed only the local 'copy' can be accessed (no way to refer to the global 'copy'). They keep separate values and the shadowed 'copy' can leak if it's a handle so you still need to null it. This trick only works in GUI because you can't re-use a variable name for a global and a local in JASS without throwing an error.So this is hiding a global variable with a local variable, same as hiding a static variable in java for example? Does the value assigned to the local variable stick to the global variable, or are they two separate entities?
As a C++ coder, I find that unusual.
What if you want it to leak? Will it crash or error?
JASS is strange.