Home   Help Search Login Register  

Author Topic: all trucks stop and unload troops when under attack  (Read 608 times)

0 Members and 1 Guest are viewing this topic.

dragonshinobi03

  • Guest
all trucks stop and unload troops when under attack
« on: 19 Jan 2004, 04:19:50 »
Hi i was wandering if there is a script where when a gorup of convoy is moveing down a road and when it comes under fire all trucks stop drivers get out, cargos get out and defend and then when its clear everyone boards back in there position and waits until everyone in on the truck

lol, i dont think i make sense :gunman:

Offline Captain Crunch

  • Members
  • *
Re:all trucks stop and unload troops when under attack
« Reply #1 on: 19 Jan 2004, 04:43:10 »
hehe! I hope You are trying at least. Cos if You don't then You're like me. ...And thats not funny!  :-\

   If I get what You're saying right, then You want the moving convoy to ignor the attack and keep on rolling to its destination.

   Then I believe just setting the behaviour of Your convoy to "Careless" (in the convoy's first waypoint) should do the trick.


If thats the total opposite that You are loking for, then keep the behaviour of the convoy to "No Change" (in the convoy's waypoint as well)

  The convoy should stop, the troops inside get out and attack the attackers!
« Last Edit: 19 Jan 2004, 04:57:59 by Captain Crunch »
Back to the forest!

dragonshinobi03

  • Guest
Re:all trucks stop and unload troops when under attack
« Reply #2 on: 19 Jan 2004, 04:49:59 »
not really but thnx

FLBEE

  • Guest
Re:all trucks stop and unload troops when under attack
« Reply #3 on: 20 Jan 2004, 05:03:24 »
WARNING:
This is a untested, shot from the hip, script from a untrained syntax-challenged noob.   ;D



lets say your convoy is west side.

In mission editor:
- make your truck and give it waypoints. Give it a name-- truck1.In  the init field put this exec "triggerfollow.sqs"
-make a trigger east detected by west,100x100, on activation spotted = true, give the trigger a name--trigger1
-make your soldiers to be the cargo in the convoy. In each of their init fields put   this moveincargo truck1; this exec  "alarmed.sqs"

;;here is triggerfollow.sqs

spotted = false
#loop
trigger1 setpos getpos truck1
~1
? spotted : goto next
goto "loop"
#next
dostop truck1
exit

-------
;;here is alarmed.sqs

#loop
? spotted : goto "getout"
~.5
goto "loop"

#getout
_this action ["EJECT", truck1]
_this setbehaviour "Combat"
exit


------------
The trigger should follow around the truck. When the trigger is activated, the truck should stop and the guys should unload.
I don't know how to make them get back in if it is all clear.

Don't worry, you will probably get your solution soon because nothing brings out the good scrpiters around here like a bad script posted up  ;D


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:all trucks stop and unload troops when under attack
« Reply #4 on: 20 Jan 2004, 11:47:44 »
I haven't checked the script but I do know how to get them back in once the area is clear.    You need another triggerof the same size, aslo "attached to the convoy".

Activation Box:  East not present
Condition:   this and spotted
On Activation:    loon1 assignAsCargo truck1; loon1 orderGetIn true

Syntax not guaranteed.    You'll need to adapt it depending on how many soldiers and how many trucks.     Remember to order somebody to be the truck driver.

Running the script for every loon is very inefficient.   Learn how to use the command forEach and use that instead.  For example

"_x setBehaviour {combat}" forEach units grp1

Plenty of reviewed ArmA missions for you to play

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:all trucks stop and unload troops when under attack
« Reply #5 on: 20 Jan 2004, 18:57:34 »
the drivers won't get out in combat, as we all know. Thus: a repeated switch trigger or two :


"[_x] orderGetin False" foreach units MyGroup :thumbsup:

(condition could be :  Behaviour bob !="safe")

and then the opposite (ordergetin true) when safe again. simple & clean,
an' it works like a charm - only, ya need to set bob's INIT behaviour to safe!  :o :)


PS.  bob would off course be the squad leader

« Last Edit: 20 Jan 2004, 18:58:10 by Tomb »

FLBEE

  • Guest
Re:all trucks stop and unload troops when under attack
« Reply #6 on: 21 Jan 2004, 02:01:21 »
aahhh!

I was wondering how to use "_x command"  foreach _one when the command had " " in it--like "Combat". So you  just use {} instead --sweet!  ;D
 

thx macguba

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:all trucks stop and unload troops when under attack
« Reply #7 on: 21 Jan 2004, 02:09:25 »
" "  and { } and supposed to be equivalent.  They are not.   There is a "right way round" to allow for future upgrades in OFP coding, but sadly it's beyond my hopeless little brain.  In practical terms, when you have quotes inside quotes, experiment with various combinations till you find the one that works.    At least that's what I do.   If anybody knows a hard and fast rule, I'd be glad to hear it.
Plenty of reviewed ArmA missions for you to play