Home   Help Search Login Register  

Author Topic: Basic Scipt Issue  (Read 440 times)

0 Members and 1 Guest are viewing this topic.

Iwesshome

  • Guest
Basic Scipt Issue
« on: 21 Apr 2003, 04:51:57 »
Hi all,

Can you take a look at this and point to me where I could be wrong... I am trying to create some shortcuts to where I could use a script to load guys into cargo without having to write always in their Initialization field.

It tries to fire but gives me an error instead... Here is an example of what I was trying to do.

Example

Humvee (w/M2) = car1
Driver = D1
Cargo = C1
Cargo = C2
Cargo = C3

[ [C1,C2,C3], car1] exec "cargoload.sqs"

Launched by Trigger

West
Present

Note: I know the two ['s need to be together but they don't show up if placed together on the forum's  :-[

Code: [Select]
;Cargo Load Shortcut
;[[unitname, unitname], car] exec "cargoload.sqs"

_car1 = _this select 0
_man1 = _this select 1

#start
_man1 moveincargo _car1
end

UberKreb

  • Guest
Re:Basic Scipt Issue
« Reply #1 on: 21 Apr 2003, 05:47:07 »
Using the foreach command in your trigger would probably be easier to use instead of a script.  

"_x moveincargo car1" foreach units group c1

But if you insist on using a script, I think your order of the arguments is incorrect.

[[unitname, unitname], car] exec "cargoload.sqs"

In your sample, you have the units to be put in cargo as the first argument and the car as the second argument.  But in the script, you have that the car is the first argument and the units to be put in cargo are the second argument.  I hope this made sense.

UberKreb
« Last Edit: 21 Apr 2003, 05:47:35 by UberKreb »

Iwesshome

  • Guest
Re:Basic Scipt Issue
« Reply #2 on: 21 Apr 2003, 14:08:54 »
So, a little flip of the switch and *phoof* Well I must wait to try it out till I get home... thanks.

Code: [Select]
;Cargo Load Shortcut
;[[unitname, unitname], car] exec "cargoload.sqs"

_man1 = _this select 0
_car1 = _this select 1

#start
_man1 moveincargo _car1
end