Goal: if human player build nuclear missile => give all command centers to allied cpu, create invincible ghost for allied cpu, launch nuke to special location and after nuke fall - kill ghost and give command centers back to human player
Triggers:
player: cpu
condition: cpu bring at least 1 nuclear missile to anywhere
actions:
kill all ghosts for cpu
create ghost at location 1
move ghosts at anywhere to location 2
move ghosts at anywhere to location 3
set invincibility for all ghosts for cpu
run ai script "clear previous combat data" at anywhere
run ai script "ai nuke here" at "nuke here"
Problems:
1) If no enemy units or buildings detected - all ok
2) If enemy units or buildings detected - sometimes ghost trying to kill and lockdown them (instead of placing nuke)
3) If enemy units or buildings detected - sometimes ghost place nuke to incorrect location
How to fix?
None.
Well, if the ghost is attacking or locking down an enemy unit, and you don't want this to happen, you can try making the computer player that is launching the nuke ally with enemy enemy units it is detecting. You should also make the ghost have no energy, or disable lockdown. You can give the enemy units to a player allied to the computer owning the ghost until the nuke falls. You can also try making the enemy units invincible until the nuke is launched (though, I've never tried detecting a nuke, so I don't know if you can detect if a nuke is in a specific location).
Unless someone here has specific experience doing what you are asking, you are going to have to just run a lot of tests to see what you like the most.
You can also use the wiki and search and see if there are any previous posts about nuking ai.
None.
Thanks
I will try give all units to p9 p11 and give back after nuke fall. But I still want to hear better solution (better than set player to ally or give units).
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
You should also make the ghost have no energy
You can also try making the enemy units invincible until the nuke is launched
But I still want to hear better solution (better than set player to ally or give units).
You won't be getting one, sorry..
None.
You should also make the ghost have no energy
You can also try making the enemy units invincible until the nuke is launched
Forgot to say that I always did "set 0 energy" (this fix lockdown bug but dont fix other bugs).
Also I dont like solution with invicibility and now I testing "give to neutrals" solution.
But I still want to hear better solution (better than set player to ally or give units).
You won't be getting one, sorry..
Hope dies at last (I hope:) )
None.
Try disabling vision for the player that owns the Ghost.
None.
Tested with "give all cpu units to players 9 and 11" and "give them back after red dot placed". Works perfectly:)
Thanks to all.
None.