Home   Help Search Login Register  

Author Topic: Another freeking create unit command error  (Read 1185 times)

0 Members and 3 Guests are viewing this topic.

Offline ryankaplan

  • Members
  • *
  • yeah...
Another freeking create unit command error
« on: 29 Sep 2005, 20:18:52 »
"ukf_infantry_lawWBb" createunit [getpos _enforce5, _assault9,"wahman2=this","corporal",1]

doesn't bloody work, as in there is something wrong with the syntax. Any idea what the correct version is supposed to be? Thanks in advance to anyone who helped, or tryed to help.
« Last Edit: 29 Sep 2005, 20:20:09 by ryankaplan »

klavan

  • Guest
Re:Another freeking create unit command error
« Reply #1 on: 29 Sep 2005, 20:40:15 »
What's _enforce5?
Klavan

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Another freeking create unit command error
« Reply #2 on: 29 Sep 2005, 20:43:04 »
Shouldn't rank be before skill? ComRef says so at least.

Anyway, it's always a good idea to post what the error says. I know it looks like gibberish at first, but you'll learn what it means in a kick.

:beat: *Gets Shot* :beat:

Kyle Sarnik

  • Guest
Re:Another freeking create unit command error
« Reply #3 on: 29 Sep 2005, 20:43:17 »
ryankaplan, please don't assume that we know what your variables are. Please provide us with a little more information rather than posting 1 line and walking off...

Offline ryankaplan

  • Members
  • *
  • yeah...
Re:Another freeking create unit command error
« Reply #4 on: 30 Sep 2005, 12:49:45 »
sorry about that, i thought it was probably a simple syntax error which you guys could spot in a second...apparently not(no offence meant).

here is the whole script: called via [logictospawnat, grouptojoin] exec "spawnshite.sqs"

_ENFORCE2 = _this Select 0
_ASSAULT2 = _this Select 1

"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"wahman1=this","corporal",0.9]
~2
"ukf_infantryWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9 ]
~1
"ukf_infantryWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9 ]
~1
"ukf_infantryWBv" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9 ]
~2
"ukf_infantryWBr" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9  ]
~1
"ukf_infantry_rlgWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal", 0.9 ]
~1
"ukf_infantry_lswWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9  ]
~1
"ukf_infantry_lswWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal", 0.9 ]
~2
"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9  ]
~1
"ukf_infantry_gmpgaWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal", 0.9 ]
~1
_ASSAULT2 setformation "wedge"
_ASSAULT2 allowfleeing 0
wahman1 removeweapon "UKF_LAW80Launcher"
wahman1 removemagazine "UKF_LAW80"
wahman1 removemagazine "JAM_W556_30mag"
wahman1 addmagazine "AALauncher"
wahman1 addweapon "AALauncher"


It gives the error "ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"wahman1=this","corporal",0.9]l#l error type number, expected string

I tried putting it at the bottom, and all the other units get created without A problem (other than the slight mini second freeze) until it comes to wahman1.
« Last Edit: 30 Sep 2005, 12:52:30 by ryankaplan »

Offline ryankaplan

  • Members
  • *
  • yeah...
Re:Another freeking create unit command error
« Reply #5 on: 30 Sep 2005, 13:12:05 »
Quote
sorry about that, i thought it was probably a simple syntax error which you guys could spot in a second...apparently not(no offence meant).

Or maybe you can. Yes, apparently the skill does come before the rank, but only if you put an init field down. If not you have to put the rank before skill. So the 2 correct versions are:

"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"wahman1=this",0.9,"corporal"]

AND

"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9]

Thanks alot dmakatra

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Reply to: Another freeking create unit command error
« Reply #6 on: 30 Sep 2005, 15:30:14 »
(in reply to solved topic http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25800)

In the last reply it's said that the correct syntax for createunit is:
Quote
"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2,_ASSAULT2,"wahman1=this",0.9,"corporal"]
AND
"ukf_infantry_lawWBb" createunit [getpos _ENFORCE2, _ASSAULT2,"corporal",0.9]
I think the second example is wrong.
The only reason no error message appears, is because "corporal" is just used for the init line (always _this select 2 position). And not because you can change the positions of array items under any circumstances.
Though, I'm not sure, didn't test it.