OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wedgie_Mutha 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.
-
i think this will work..... you might ahve to change some stuff for it to work :)
; 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