*First, I add
Behavior = CommandButtonHuntUpdate BTDisguiseHunt ; allows use of command button hunt script with this unit.
; nothing
End
to the behaviours of the bomb truck in the .ini file (I did my test with demo gen, so in DemoGeneral.ini)
*Then, I add into the GLA Paper Work folder, "GLA Init Variables" script the lines:
Set timer 'Bomb_Truck_Disguise_Done' to expire in 1 frames.
Set Flag named 'Bomb_Truck_Disguise' to FALSE
*Then, I create 2 scripts in the Team Behaviours folder, "Demo Bomb Truck Attack" & "Demo Switch to Kill Mode"
Both scripts are subroutines(of course no deactivate on success) & active, and evaluate every 5 seconds (prob not necessary, could run every frame).
Demo Bomb Truck Attack
*** IF ***
True.
*** THEN ***
100.00% of Team '<This Team>' perform Ability 'Command_UpgradeGLABombTruckHighExplosiveBomb'.
Team '<This Team>' begins hunting using Ability 'Command_DisguiseAsVehicle'.
Set timer 'Bomb_Truck_Disguise_Done' to expire in 5.00 seconds.
Set Flag named 'Bomb_Truck_Disguise' to TRUE
Demo Switch to Kill Mode
*** IF ***
Timer 'Bomb_Truck_Disguise_Done' has expired.
*AND* Flag named 'Bomb_Truck_Disguise' IS TRUE
*** THEN ***
Team '<This Team>' begins hunting.
Set Flag named 'Bomb_Truck_Disguise' to FALSE
*Then, I create the team itself. The team has a standard build condition, Initial Team Behaviour "Normal". It's OnCreate script is "Demo Bomb Truck Attack" & in it's Generic scripts it had "GLA Apply Tank Priority" then "Demo Switch to Kill Mode".
Voila!
The trick is that the truck hunts with the DisguiseAsVehicle CommandButton, which allows it to target the closest ENEMY tank.
Then, of course, you've just got a bombtruck sitting their looking like the enemy, not attacking, so the timer gives the truck 5 seconds to find a target (prob needs less), and sets the flag telling the AI there is a truck that is disguising.
When the timer runs out, the Switch to Kill Mode script runs and tells the truck to hunt normally, but it keeps its disguise.
I've tested this, the trucks changed colours, looked like a scorpion, and showed up as 'stealthed' on the map (I play computers against each other and watch).
Implement it, check it for yourselves, let me know of any probs/difficulties.
And... enjoy!
Cheers,
Lord Akkrand
EDIT: And for those of you who aren't scripters yourselves, you can get it along with a whole world of other changes I have made (some good, some bad) at the following URL:
AkkrandAI
Edited by Akkrand, 30 July 2004 - 06:34 AM.