Home   Help Search Login Register  

Author Topic: How to spawn enemy units...?  (Read 534 times)

0 Members and 1 Guest are viewing this topic.

Wedgie_Mutha

  • Guest
How to spawn enemy units...?
« on: 07 Jul 2003, 17:08:03 »
Hi there,

I have searched about the forums and I can't find a thread about this one...

Can anyone tell me the best way to have enemy units spawn on a trigger activation? I have a mission Im writing thats getting reaally slow beacuse of the number of units on the map. What I'd like to do is have non-essential units (units that you're not engaging at the time) spawn on a trigger activation. I have seen this done in some of the SP missions Ive downloaded, but havent figured out how to do it yet.

Any advice would be much apprecated.
Ta
Wedgie.

_hammy_

  • Guest
Re:How to spawn enemy units...?
« Reply #1 on: 07 Jul 2003, 19:48:41 »
i think this will work..... you might ahve to change some stuff for it to work :)

Code: [Select]
; made by HAMMY
;[number_of_guys_per_wave] exec "spawn.sqs"


;how many guys do you want in each wave
_cre = _this select 0

#restart
_n = 0

#check
~0.1
!alive groupAlpha:goto "create"
goto "check"

#create
_n = _n + 1
_n >= _cre:goto "stop"
~0.3
'SoldierWB' createunit [getmarkerpos 'barracks',groupAlpha]
groupAlpha move getpos player ;******remove this line if you dont what the newly created units to move to the player****
~0.1
groupAlpha setbehaviour "COMBAT"
groupAlpha setcombatmode "RED"
~0.1
goto "create"

#stop
;waits 30 seconds between sending the next wave of guys
;change this number to change delay between each wave
~30
goto "restart"

exit