Home   Help Search Login Register  

Author Topic: Assistance with my support script  (Read 1194 times)

0 Members and 1 Guest are viewing this topic.

TheOakster

  • Guest
Assistance with my support script
« on: 06 Jul 2006, 13:25:00 »
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:
Code: [Select]
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

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Assistance with my support script
« Reply #1 on: 06 Jul 2006, 16:27:10 »
Change to:
Code: [Select]
{unAssignVehicle _x} foreach units support2
{_x action [{getout},support1]} foreach units support2


To get M113 to move faster:
Code: [Select]
supdri1 setSpeedMode "FULL"
« Last Edit: 06 Jul 2006, 16:28:48 by Mr.Peanut »
urp!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Assistance with my support script
« Reply #2 on: 06 Jul 2006, 16:53:46 »
The M113 may also drive slower due to it's behaviour being careless which makes it behaviour similar behaviour safe...

In careless mode the vehicles try to follow roads (IIRC, at least in safe mode they do) and the off-road speed can be quite slow..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

TheOakster

  • Guest
Re: Assistance with my support script
« Reply #3 on: 06 Jul 2006, 19:27:02 »
The M113 may also drive slower due to it's behaviour being careless ... In careless mode the vehicles try to follow roads...

Thats what I wanted..

Quote
and the off-road speed can be quite slow

and thats why ;), I just wanted it to drive faster on the roads.

Thanks Mr.Peanut, I will give that a go later.

Ben

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Assistance with my support script
« Reply #4 on: 07 Jul 2006, 10:05:20 »
Quote
I just wanted it to drive faster on the roads.
*smacks forehead*
Maybe I just should learn to read before posting replys :P  ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

TheOakster

  • Guest
Re: Assistance with my support script
« Reply #5 on: 07 Jul 2006, 22:16:11 »
 ;D No problem, mate.

Ben