OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Dajan on 19 Jan 2008, 15:28:05

Title: Running scripts for vehicle crews?
Post by: Dajan 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
Title: Re: Running scripts for vehicle crews?
Post by: bedges 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.
Title: Re: Running scripts for vehicle crews?
Post by: Dajan on 19 Jan 2008, 17:21:40
So you there's no way to use a script, it has to be done longhand?
Title: Re: Running scripts for vehicle crews?
Post by: bedges on 19 Jan 2008, 17:54:16
see attached.
Title: Re: Running scripts for vehicle crews?
Post by: Dajan on 19 Jan 2008, 17:56:15
Thanks bedges, I'll give that a spin
Title: Re: Running scripts for vehicle crews?
Post by: bedges 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.
Title: Re: Running scripts for vehicle crews?
Post by: Mr.Peanut on 25 Jan 2008, 15:34:48
Code: [Select]
{_x exec "change_weapons.sqs"} forEach crew yourVehicleNameHere