OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Father.Jack on 24 Apr 2004, 11:29:57

Title: Respawning enemy groups
Post by: Father.Jack on 24 Apr 2004, 11:29:57
Hi im trying to figure out how to spawn enemy groups that will immediately respawn to a designated area when they have been wiped out. Can i have a few examples to work on please, including the mao coordinates for where the enemies will respan again. Thx ;D

OH AND BTW I HAVE SEARCHED AND IT COMES UP WITH COMPLICTED CRAP :)
Title: Re:Respawning enemy groups
Post by: Zombie on 24 Apr 2004, 13:11:07
Try this:
make a marker where you want them to respawn, named whatever you like, I'll use "here" for this example
make a trigger covering the mission area, activated by enemyside not present repeatedly
on activation [] exec "needmore.sqs"

then in a script called needmore.sqs
"unit type" createunit [getmarkerpos "here", groupalpha]

repeat that line as many times as required

at the marker area put a trigger activated by the enemy side present repeatedly
on activation [groupalpha,1] setwpppos getmarkerpos "gohere"

make another marker where you want them to go and name it gohere

that should work for you, haven't tried it, all off the top of my head.  good luck!
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 18:24:13
Thanks, but what for example do i put in the unit type bit?
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 18:33:52
'unit type' will be the type of soldier you require.



Planck
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 18:37:41
Yeah i know that but i need an exaple of what to put in its place coz i cant put a simple "soldier". Im new so i have no idea what to put. ALSO , should i include the quotes?
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 18:50:17
Hmmm.......ok......try some of these:


"SoldierEB"
"SoldierEG"
"SoldierEMedic"
"SoldierEMG"
"SoldierELAW"
"SoldierEAT"
"SoldierEAA"
"OfficerE"
"OfficerENight"

Presuming you want east soldiers



Planck
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 19:01:56
Hmm i tried it and it doesn't work. Can you check the script above to see if there are any faults. Does it work in map editor preview?

and does the marker have to be a specific type?
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 19:17:21
HELP!! ^^^^  ;D
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 19:37:13
Yes it all works,,,,,,however there is a syntax error in this line:

[groupalpha,1] setwpppos getmarkerpos "gohere"

It should read:

[groupalpha,1] setwppos getmarkerpos "gohere"


Planck
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 19:46:17
Yeah i saw that but it still doesnt work for me. Any ideas?

BTW WHAT TYPE OF MARKER SHOULD I USE?
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 19:52:07
One little thing......you need groupalpha to already exist.

What I did with my little test mission was:

I put down one east soldier and made him groupalpha with this in his init line:

groupalpha = group this

Make sure he is inside the area of the trigger that detects enemy NOT present.

Then I shot him dead.

This started the respawn of the rest of the soldiers.

Who then shot me dead

ANY MARKER YOU WANT.....btw


Planck
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 19:59:11
Thats brilliant! Thanks alot mate  ;D. Just needed to have grp alpha like ya said. Thanks again
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 20:17:50
Ahh damn! These guys only respawn 2 times and then they never return :( how do i fix that?

+

They refuse to move to the 'gohere' marker
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 20:48:38
No NO NO........they just keep coming here...........there are thousands of bodies piling up here.

In fact it is getting hard to hit them now because of the dead bodies in the way.


Planck
Title: Re:Respawning enemy groups
Post by: Father.Jack on 02 May 2004, 20:54:15
Thats weird, for some reason the repeat thing on the trigger only works a few times  >:(
Title: Re:Respawning enemy groups
Post by: Planck on 02 May 2004, 21:00:54
Try this little test mission.

Set on Intro.



Planck

Title: Re:Respawning enemy groups
Post by: Father.Jack on 03 May 2004, 10:21:21
Thx, even with your mission they will respawn a few times then they would never return. What patch do you have btw?
Title: Re:Respawning enemy groups
Post by: Father.Jack on 03 May 2004, 15:04:37
does anyone know?  :-[
Title: Re:Respawning enemy groups
Post by: DrStrangelove on 03 May 2004, 16:30:36
Check this out, mate: http://www.ofpec.com/editors/resource_view.php?id=585 (http://www.ofpec.com/editors/resource_view.php?id=585)

Requires Resistance with 1.91
Title: Re:Respawning enemy groups
Post by: Planck on 03 May 2004, 20:16:11
My game is fully patched to 1.96.

The mission I posted:

I can play this for ages..........and they just keep respawning.

The place gets littered with bodies.

Of course, they always get me in the end, when I run out of ammo.

I have no idea why they don't continue to respawn for you.


Planck