Home   Help Search Login Register  

Author Topic: Adjusting squad loaouts via script not init?  (Read 833 times)

0 Members and 1 Guest are viewing this topic.

Offline Dajan

  • Members
  • *
Adjusting squad loaouts via script not init?
« 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

Offline rado1265

  • Members
  • *
Re: Adjusting squad loaouts via script not init?
« Reply #1 on: 28 May 2006, 18:10:03 »
What do you need I think is a nice editing tool, like Chris' OFP Script Editor. With it you'll make such (and many other) scripts in a blink of an eye.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Adjusting squad loaouts via script not init?
« Reply #2 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]
« Last Edit: 28 May 2006, 18:15:16 by bedges »

Offline Dajan

  • Members
  • *
Re: Adjusting squad loaouts via script not init?
« Reply #3 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  ;)