OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gooner861 on 26 Apr 2004, 16:50:14

Title: Multiple init fields
Post by: Gooner861 on 26 Apr 2004, 16:50:14
How can u put multiple commands into a units initialization field.
Ive tried doing this in the init field:

this setBehaviour"COMBAT" : next comand.

Help?  ;D
Title: Re:Multiple init fields
Post by: myke13021 on 26 Apr 2004, 16:59:11
simple...

Code: [Select]
blah blah blah this is the first command blah; blah blah blah this the second blah; blah blah blah and finally third
 ;D
Title: Re:Multiple init fields
Post by: dmakatra on 26 Apr 2004, 16:59:34
You need to put a ;, example:

this setbehaviour "COMBAT"; this dotarget loon1

:beat: *Gets Shot* :beat:

EDIT: Damn! I wasn't fast enough! ;)
Title: Re:Multiple init fields
Post by: Gooner861 on 26 Apr 2004, 17:05:50
Damn, i knew it wud b sumthing stupidly easy.
Title: Re:Multiple init fields
Post by: dmakatra on 26 Apr 2004, 17:08:27
No questions are stupid. Try reading some more tutes at OFPEC's excellent ed depot though. ;)

:beat: *Gets Shot* :beat:
Title: Re:Multiple init fields
Post by: myke13021 on 26 Apr 2004, 17:32:21
when you have a lot of commands which you like to insert in a init field, you could also make a script for.

Code: [Select]
;myinit.sqs
_unit = _this select 0

_unit setbehaviour "COMBAT"
_unit setcombatmode "RED"
removeallweapons _unit
_unit addmagazine "M16"
_unit addweapon "M16"
exit

...and in the init line you just put

Code: [Select]
[this] exec "myinit.sqs"
not necessarly though but it is easier to overview it


@Armstrong

hehe...beat you by 23 seconds

:beat: *shots* :beat: