Home   Help Search Login Register  

Author Topic: Object creation  (Read 931 times)

0 Members and 1 Guest are viewing this topic.

Offline six6six

  • Members
  • *
Object creation
« on: 24 Aug 2008, 16:09:47 »
Im trying to make a script which spawns invisible targets on known enemies, so you can get an SLX style suppressing fire on possible enemy position, however I have come across 2 problems.
1 is the fact that it refuses to accept the name of an array as an arguament.
The second is that although the global chat telling me a target has been spawned, it doesnt. Ive tried it spawning other things, like M1s and it works, but even trying to spawn enemy targets on them to see wether it has spawned and it doesnt work. Please help!
Code: [Select]
;[who, east_units]exec "targetspawn.sqs"
_who = _this select 0
_enemy = _this select 1

#start
? (!(alive _who)) then exit
_list = [_who,_enemy, true] call knownUnits

;_who GlobalChat format ["close: %1", east_units]
~1
_pos = (getpos (_list select 0))
_side = side (_list select 0)
? (_side == west): goto "west"
? (_side == east): goto "east"
? (_side == Resistance): goto "res"

~1
goto "start"

#east
 "FOX2_E_M_HI_IT" CamCreate _pos
_who GlobalChat format ["east target spawned %1",  _pos]
~5
goto "start"
#res
"FOX2_G_M_HI_IT" CamCreate _pos
_who GlobalChat "res target spawned"
~5
goto "start"
#west
"FOX2_W_M_HI_IT" CamCreate _pos
_who GlobalChat "west target spawned"
~5
goto "start"

Here is the script, and for ease of use I have it spawning only on the nearest known enemy.

Offline dr. seltsam

  • Members
  • *
Re: Object creation
« Reply #1 on: 24 Aug 2008, 19:54:40 »
It is possible, that your target was spawned correctly, but is covered by the model of the unit in its position. In that case independent AI will not shot on it. Try to spawn it a bit away, and check again.

 :)