Home   Help Search Login Register  

Author Topic: Running scripts for vehicle crews?  (Read 1379 times)

0 Members and 1 Guest are viewing this topic.

Offline Dajan

  • Members
  • *
Running scripts for vehicle crews?
« on: 19 Jan 2008, 15:28:05 »
Couldn't find this anywhere, if its about plesae redirect me!

I'm creating mission using scripts to change units loadouts - thus avoiding cluttered INIT fields - however I can't work out how to use scripts to change the loadout of the crews, say the driver and gunner of a MG Jeep.

Obviously this exec "xxxx.sqs" works for units, but what do I have to change to do the above?

Thanks in advance

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Running scripts for vehicle crews?
« Reply #1 on: 19 Jan 2008, 17:14:27 »
you could use the syntax

Code: [Select]
removeallweapons (driver vehicle_name)
(driver vehicle_name) addmagazine "ak74"

alternatively there is a shortcut. add the letter 'c', 'd' or 'g' to the name of the vehicle to grab its commander, driver and gunner respectively. thus the syntax above becomes

Code: [Select]
removeallweapons vehicle_nameD
vehicle_nameD addmagazine "ak74"

untested but should work.

Offline Dajan

  • Members
  • *
Re: Running scripts for vehicle crews?
« Reply #2 on: 19 Jan 2008, 17:21:40 »
So you there's no way to use a script, it has to be done longhand?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Running scripts for vehicle crews?
« Reply #3 on: 19 Jan 2008, 17:54:16 »
see attached.
« Last Edit: 19 Jan 2008, 17:57:08 by bedges »

Offline Dajan

  • Members
  • *
Re: Running scripts for vehicle crews?
« Reply #4 on: 19 Jan 2008, 17:56:15 »
Thanks bedges, I'll give that a spin

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Running scripts for vehicle crews?
« Reply #5 on: 19 Jan 2008, 17:57:44 »
heheh, too fast... i've updated on reading your first post again. download that one. uses more useful script.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Running scripts for vehicle crews?
« Reply #6 on: 25 Jan 2008, 15:34:48 »
Code: [Select]
{_x exec "change_weapons.sqs"} forEach crew yourVehicleNameHere
urp!