Home   Help Search Login Register  

Author Topic: something wrong with this script  (Read 493 times)

0 Members and 1 Guest are viewing this topic.

j-man

  • Guest
something wrong with this script
« on: 24 Jul 2004, 15:36:08 »
createUnit.sqs
Code: [Select]
_createTime = (random 15)

_unittype = _this select 0
_createPos = _this select 1
_init = _this select 2

?(_unittype == "basic") : _unittype = "fin_Jaeger"; goto "check"
?(_unittype == "NCO") : _unittype = "fin_JaegerNCO"; goto "check"
?(_unittype == "sniper") : _unittype = "fin_JaegerSniper"; goto "check"
?(_unittype == "MG") : _unittype = "fin_JaegerMGkvkk62"; goto "check"
?(_unittype == "medic") : _unittype = "fin_Medic"; goto "check"
?(_unittype == "grenade") : _unittype = "fin_JaegerRK95RG"; goto "check"
?(_unittype == "officer") : _unittype = "fin_JaegerOfficer"; goto "check"
?(_unittype == "AT") : _unittype = "fin_JaegerATkes88"; goto "check"
?(_unittype == "radio") : _unittype = "fin_JaegerRadioman"; goto "check"


#check
~1
?(count Units dummygroup == 12) goto "check"

#create
~_createTime

_unittype createUnit [getMarkerPos _createPos, dummygroup, _init, 0.5, "PRIVATE"]

exit

executed with:
Code: [Select]
["radio","unitmark1","[this] join grpnull; this setbehaviour ""SAFE"""] exec "createunit.sqs"

The unit is created just fine. The problems are: he does not detach from the dummygroup (which is a real group), he is not created exactly where the marker is, and he is not is safe mode >:(

What can I do to fix these things ???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:something wrong with this script
« Reply #1 on: 24 Jul 2004, 16:43:37 »
Do you really  need all those " " around safe?    Also, try { } instead of some of the " ".
Plenty of reviewed ArmA missions for you to play

j-man

  • Guest
Re:something wrong with this script
« Reply #2 on: 24 Jul 2004, 16:57:25 »
Do you really  need all those " " around safe?    Also, try { } instead of some of the " ".

I think all the " " are necessary, not sure though. Also, where should I place the  {}  ???

olseric

  • Guest
Re:something wrong with this script
« Reply #3 on: 24 Jul 2004, 17:02:25 »
Code: [Select]
_createTime = (random 15)

_unittype = _this select 0
_createPos = _this select 1
_init = _this select 2

?(_unittype == "basic") : _unittype = "fin_Jaeger"; goto "check"
?(_unittype == "NCO") : _unittype = "fin_JaegerNCO"; goto "check"
?(_unittype == "sniper") : _unittype = "fin_JaegerSniper"; goto "check"
?(_unittype == "MG") : _unittype = "fin_JaegerMGkvkk62"; goto "check"
?(_unittype == "medic") : _unittype = "fin_Medic"; goto "check"
?(_unittype == "grenade") : _unittype = "fin_JaegerRK95RG"; goto "check"
?(_unittype == "officer") : _unittype = "fin_JaegerOfficer"; goto "check"
?(_unittype == "AT") : _unittype = "fin_JaegerATkes88"; goto "check"
?(_unittype == "radio") : _unittype = "fin_JaegerRadioman"; goto "check"


#check
~1
?(count Units dummygroup == 12) goto "check"

Well, right there, you're missing a : between the condition and result...

Code: [Select]
#create
~_createTime

_unittype createUnit [getMarkerPos _createPos, dummygroup, _init, 0.5, "PRIVATE"]

exit

Just scanning it quick, that's all I see...

j-man

  • Guest
Re:something wrong with this script
« Reply #4 on: 24 Jul 2004, 17:50:38 »
Nevermind, I managed to get it fixed :)

Topic solved