OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Dajan on 28 May 2006, 17:41:57

Title: Adjusting squad loaouts via script not init?
Post by: Dajan on 28 May 2006, 17:41:57
This may have been posted before, I'm not sure. I did my best to find it so if it exists already just PM a link or me and get a mod to dlete this.

I'm constsntly finding mysel wearing my fingers raw manually adjusting the loadouts of units at the editing stage for a mission - that's the whole removeallweapons this; this add.... bit I mean. Is it possible to write a couple of scripts to stick in th addon/mod folder for a few new 'default' loadouts? So that instead of spending hours copy & pasting new equipment I could just activate a script that would do it for me?
If it is how might I write this and activate it?
Gracias
Title: Re: Adjusting squad loaouts via script not init?
Post by: rado1265 on 28 May 2006, 18:10:03
What do you need I think is a nice editing tool, like Chris' OFP Script Editor (http://www.chenderman.com/CHOFPSE.htm). With it you'll make such (and many other) scripts in a blink of an eye.
Title: Re: Adjusting squad loaouts via script not init?
Post by: bedges on 28 May 2006, 18:12:11
indeed. it would go in a script, a simple text file, saved as filename.sqs, and called either from the unit's init line or from the init.sqs file.

to call the script from the unit's init line type

Code: [Select]
this exec "rearm.sqs"
to call the script from the init.sqs file type

Code: [Select]
unit_name exec "rearm.sqs"
and the rearm script?

Code: [Select]
;alter loadout

_who = _this
removeallweapons _who

_who addmagazine "m16"
_who addweapon "m16"
_who addmagazine "m16"
_who addmagazine "m16"
_who addmagazine "m16"

_who addmagazine "lawlauncher"
_who addweapon "lawlauncher"
_who addmagazine "lawlauncher"

_who addweapon "throw"

_who addmagazine "handgrenade"
_who addweapon "handgrenade"
_who addmagazine "handgrenade"

_who addweapon "binocular"

exit

save this as rearm.sqs in the same folder as the other mission files. for a list of available default weapons, see the attached textfile.

[attachment deleted by admin]
Title: Re: Adjusting squad loaouts via script not init?
Post by: Dajan on 28 May 2006, 19:10:06
Thanks guys, this is a real help! You may have saved my fingers from a blood splattered oblivion here  ;)