Hello,
I have 'knocked up' this support script while looking through the comref but its still not quite doing what I want.
The script is:
support1 = "M113" createvehicle getpos log4
"SoldierWCrew" createunit [getpos log4,support,"supdri1 = this", 1, "COLONEL"]
"SoldierWCrew" createunit [getpos log4,support,"supdri2 = this", 1, "SERGEANT"]
"SoldierWB" createunit [getpos log4,support2,"supt1 = this", 1, "SERGEANT"]
"SoldierWMG" createunit [getpos log4,support2,"supt2 = this", 1, "PRIVATE"]
"SoldierWB" createunit [getpos log4,support2,"supt3 = this", 1, "PRIVATE"]
"SoldierWB" createunit [getpos log4,support2,"supt4 = this", 1, "PRIVATE"]
~0.5
supdri1 moveindriver support1
supdri2 moveinGunner support1
~0.5
"_x assignascargo support1" foreach units support2
"_x MoveinCargo support1" foreach units support2
Support setbehaviour "careless"
Support setcombatmode "yellow"
supdri1 domove getpos player
#loop
~1
?(supdri1 distance player <100): goto "out"
goto "loop"
#out
~1
dostop support1
~5
{_x action [{getout},support1]} foreach units support2
support setbehaviour "aware"
support setcombatmode "red"
support2 setbehaviour "aware"
support2 setcombatmode "red"
exit
What happens is, the M113 is created, the driver and gunner are created and get in, the small squad is created and gets in. The M113 drives to me using the roads and then the M113 almost stops and the squad get out. They then get back in! Leaving me to get killed.
What I want to happen is all the above except i want the M113 to drive faster, and the squad needs to get out and they should all advance to contact.
Instead they just sit there while I get killed.
Ben