OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ice Man 3:16 on 13 Apr 2004, 04:16:51

Title: spawning enemys when trigger is activated
Post by: Ice Man 3:16 on 13 Apr 2004, 04:16:51
Is it possible to have a trigger that continuously spawns  enemys when you activate the trigger, and possibly a trigger to turn off the enemy spawn when you leave?

I'm mainly interestd in the trigger to spawn enemys, shutting off enemy spawn is not as important.
Title: Re:spawning enemys when trigger is activated
Post by: Raptorsaurus on 13 Apr 2004, 06:05:43
There are some spawning scripts in the editor depot.  You could make a trigger that when activated would execute one of these respawn scripts.  You could also put a createunit command in the trigger, but this would only make one unit at a time. Eg. in the on activation filed:

Code: [Select]
"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha
For MP make sure you make also have game logic called "server" and this line at the begining of the script:

Code: [Select]
?!(local server) : exit
If you put the createunit command directly in the trigger for MP you will have to put in the condition field of the trigger:

Code: [Select]
this and (local sever)
Hope this helps (you might want to double check my command syntax also).