OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 29 Sep 2005, 19:40:55

Title: unit create wont work
Post by: 456820 on 29 Sep 2005, 19:40:55
ive created this little script

Code: [Select]
_grpw = _this select 0
_pos1 = [getpos leader _grpw select 0,(getpos leader _grpw select 1)-5,getpos leader _grpw select 2]

"SoldierWLAW" createunit [getpos _pos1, _grpw]
~0.75
"SoldierW" createunit [getpos _pos1, _grpw]
~0.75
"SoldierW" createunit [getpos _pos1, _grpw]

exit

_this select 0 is the groups name eg grpBravo wich i initialised from the leaders init field
the problem is that the unit isnt created and i get an error about the group after the first comma in the line to create the unit where you assign the group
why isnt this working ?
cheers
Title: Re:unit create wont work
Post by: klavan on 29 Sep 2005, 20:02:29
Try to remove the getpos command.
Klavan
Title: Re:unit create wont work
Post by: Kyle Sarnik on 29 Sep 2005, 20:47:44
You can't getpos an array. You allready defined the position, and you can't use getpos on a position, only an object. Its pretty much the same thing as going "setpos getpos (getpos object)".

Also, you are probably going to want to add some more parameters in that command, like skill and init.
Title: Re:unit create wont work
Post by: 456820 on 29 Sep 2005, 20:53:20
so i should get rid of the getpos okay will do then try later
also is there an actualy default skill level ? is it 0.5 or is it 0 or what ?
cheers
Title: Re:unit create wont work
Post by: Kyle Sarnik on 29 Sep 2005, 20:58:30
Everything that you set with a slider in the editor is a 0-1 value.
Title: Re:unit create wont work
Post by: Triggerhappy on 30 Sep 2005, 01:42:23
but he was asking for default, and the default value is 0.5