Jump to content
Sign in to follow this  
Blitzen

AI respawning

Recommended Posts

**Note** This thread is not intended to answer a specific question about a specific script but instead is intended to quinch my curiosity on how most scripts handle AI respawning...

Im starting a new project for OFP that will require quite a bit of AI respawning. Ive been doing some research on the subject on this forum and on the editing center and ended up downloading some scripts to test out. After digging through their readme files I became curious as to how AI respawning actually works in Operation Flashpoint. From what I've gathered so far, it seems that scripts accomplish respawning by recreating copies of specified AI "dummy" groups. I was wondering if this was generally correct? :391:

I was also curious why respawned AI dont seem to be very smart. Im assuming that scripts which controll AI behaviour are run at the initiation of the mission and can not be re-run later on?

Finally, I've downloaded these respawn scripts: Weapons_respawn, utility_respawn_scripts, spawn manager, and spawn manager 2 (with AI update). Is there a universal respawn script that everyon uses? For example, CoC Unified Artillery is to Artillery as ___:confused:____ is to Respawning.

Thanks for the help guys! :cheers:

Share this post


Link to post
Share on other sites

Oooh my spawn manager at work again, after all these years. (2003) :)

If you take a look into the script, its as simple as it can get. Groups cant be copied, but a unit can join a grpNull, in that case a new group is created by OpF from scratch, with that unit being the sole member. Since that unit needs to be existent, you use a dummygroup which serves 2 purposes:

1. Every type of unit you want to spawn later, needs to be set down in the editor in some group in order to let OpF load the resources for that unit before you spawn them (model, texture, etc...). If you spawn somethin which is not present in the mission editor already you'll notice a 1 sec lag before the spawn, very annoying.

So one way to handle it is to have all unit types you want to spawn later in the dummygroup (1 grp for each side) already to get rid of the spawn lags.

2. In order to spawn a unit into a group you need space. I killed all units but the leader in the dummygroup to give enough space for a new unit and to know the group only has 1 member at any time (only the leader). So the spawned unit would be (units group select 1) and that one is joining grpNull, creating a new group.

"SoldierWB" createUnit [_pos, _dummygroupwest];

_newunit = (units _dummygroupwest) select 1;
[_newunit] join grpNull;
_newgroup = group _newunit;

After you have the new group active, you can spawn the rest of the units into it the normal way:

"SoldierWB" createUnit [_pos, _newgroup];
"SoldierWMedic" createUnit [_pos, _newgroup];
"SoldierWAT" createUnit [_pos, _newgroup];
etc...

There are threads with more infos: http://forums.bistudio.com/showthread.php?t=105320

DL with mission example: http://www.ofpec.com/ed_depot/index.php?action=details&id=313&game=OFP

Edited by ])rStrangelove

Share this post


Link to post
Share on other sites

DrStrangelove,

I've been playing around with your respawn scripts for quite awhile now and I've stumbled upon some more questions:

1. Would it be possible to have spawned groups execute Kronzky's Urban Patrol Script upon being spawned? This would add some randomness to the AI groups as well as some group communication. I tried to do this by putting a spawn position within a trigger that would have all present units run the patrol script. However, I could never get it to work because I couldnt figure out the syntax. Is there a simpler way to do this?

2. How can you add in respawn delays for the AI groups?

3. Is there a way to make a respawn point (I use gamelogics) move around within a trigger? This way AI groups would be spawned at different points but would remain within a general area.

Thanks for your help! Im really enjoying these scripts

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×