Could anyone please help us with this problem!?
We have (almost) tried everything...
What we want to do is to order an AI-unit to move from the clientside. This might sound easy and we have actually succeeded! Now to the hard part...
The unit is in your group. We want to unjoin the AI-unit and make him move to a specific position (from onMapSingleClick).
Problem is that when we unjoin, the AI-unit doesn't seems to listen anymore. He just stands there looking dumb!
It works when we move another group created from the editor, but not when we create one during gameplay (from a script). What we actually do, is to join the local player to grpNull and then joins the rest of the group that shouldn't move to him again. The remaining original (first) group is the one that should move...
move.sqshint "Click map where to move..."
onMapSingleClick { mapPos=_pos; mapUnits=_units; mapContinue=true }
@mapContinue
mapContinue=false
onMapSingleClick { mapPos = nil; mapUnits = nil; mapShift = false; mapAlt = false }
_playerGroup = units player
[player] join grpNull
(_playerGroup - mapUnits) join player
patrolUnit = leader (mapUnits select 0)
patrolMovePosX = mapPos select 0
patrolMovePosY = mapPos select 1
publicVariable "patrolUnit"
publicVariable "patrolMovePosX"
publicVariable "patrolMovePosY"
exit
moveserver.sqs? !(local server) : exit
#update
patrolUnit = objNull
patrolMovePosX = 0
patrolMovePosY = 0
patrolUpdate = true
publicVariable "patrolUpdate"
#retry
~0.01
_unit = patrolUnit
_movePosX = patrolMovePosX
_movePosY = patrolMovePosY
? ( (_unit == objNull) OR (_movePosX == 0) OR (_movePosY == 0)) : goto "retry"
patrolUpdate = false
publicVariable "patrolUpdate"
_unit move [_movePosX, _movePosY, 0]
goto "update"
PLEASE!!!! I beg you guys on my bare knees... We have been working from 00:00 to now (05:30) and we still havn't had any luck! (We have tried to solve it before, but now we're outta ideas...)