Home   Help Search Login Register  

Author Topic: unit create wont work  (Read 1081 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
unit create wont work
« 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

klavan

  • Guest
Re:unit create wont work
« Reply #1 on: 29 Sep 2005, 20:02:29 »
Try to remove the getpos command.
Klavan

Kyle Sarnik

  • Guest
Re:unit create wont work
« Reply #2 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.

Offline 456820

  • Contributing Member
  • **
Re:unit create wont work
« Reply #3 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

Kyle Sarnik

  • Guest
Re:unit create wont work
« Reply #4 on: 29 Sep 2005, 20:58:30 »
Everything that you set with a slider in the editor is a 0-1 value.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:unit create wont work
« Reply #5 on: 30 Sep 2005, 01:42:23 »
but he was asking for default, and the default value is 0.5