Home   Help Search Login Register  

Author Topic: problem with my script; script included  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

Offline Arctic

  • Members
  • *
  • In Utero
problem with my script; script included
« on: 03 May 2003, 23:15:52 »
I have a problem with my script. The units won't move to the camcreated item. Can someone just read over my script and see if there is some bug?

Its a little messy because I orginally had a bunch of random commands to shift the location of the object. I had to take it out....

Code: [Select]
;randompath.sqs

_unit = _this select 0
_home = _this select 1
_away = _this select 2
;how far apart
_hX = getpos _home select 0
_hY = getpos _home select 1
_hZ = getpos _home select 2
_aX = getpos _away select 0
_aY = getpos _away select 1
_aZ = getpos _away select 2

#Start
?(group _unit == grpNULL): exit
#X
_randx = random 75

_nurfx = random 400
?(_nurfx >= 0 AND _nurfx < 201): _ranx = (_randx * -1)
#Y
_randy = random 75

_nurfy = random 400
?(_nurfy >= 0 AND _nurfy < 201): _rany = (_randy * -1)
#toss
_gl ="Radio" CamCreate [((_aX) + _ranx),((_aY) + _rany), (_aZ) + 1]
#move

~2
_unit move getpos _gl

?((_unit distance _gl) < 5): deletevehicle _gl; goto "home"
?((_unit knowsabout player) > 0): goto "attack"

~2
goto "move"

#home
?(group _unit == grpNULL): exit
#X2
_randx = random 75

_nurfx = random 400
?(_nurfx >= 0 AND _nurfx < 201): _ranx = (_randx * -1)
#Y2
_randy = random 75

_nurfy = random 400
?(_nurfy >= 0 AND _nurfy < 201): _rany = (_randy * -1)
#toss2
_gl = "Radio" CamCreate [((_hX) + _ranx),((_hY) + _rany), (_hZ) + 1]
#move2
_unit move getpos _gl

?((_unit distance _gl) < 5): deletevehicle _gl; goto "home"
?((_unit knowsabout player) > 0): goto "attack"

~2
goto "move2"

#attack
?(group _unit == grpNULL_: exit
?((_unit knowsabout player) < 1): _unit setcombatmode "WHITE"; _unit setbehaviour "Aware"; goto "Start"

_unit setcombatmode "RED"
_unit setbehaviour "Combat"
_unit move getpos player

~1.02
goto "attack"






Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:problem with my script; script included
« Reply #1 on: 03 May 2003, 23:31:48 »
From what I see, you used the "move" command with a unit, whereas it works with groups. Try to replace "move" by "domove".