Jump to content
Sign in to follow this  
Alloy007p

Respawn dead AI

Recommended Posts

I treid searching but couldn't find anything that helped. So how would one go about makeing it so that when an AI or group is killed it respawns at a certain point and then follows the same way point.

Also how would you be able to limit the number of times the AI is allowed to respwan?

Thnak you for any help smile_o.gif

Share this post


Link to post
Share on other sites

+2 i would also like to know how spawn ai groups at a certain marke and then follow waypoints

Share this post


Link to post
Share on other sites

I happen to be working on the exact same thing now. I just got it working to a suitable degree yesterday.

v0.1 beta is still work in progress.

I haven't tested it in MP yet, but since it is intended to work on the server only for local AI, it should be ok. I'll post an update if it changes.

All the respawn times need to be adjusted for final version. (easy to change - use commented suggestion)

Download test mission: (it's only a single script)

AIGroupRespawn_v0.1.Intro.rar

Intended scenario:

- city filled with AI groups

- when each entire group dies, it respawns group outside of city

- it uses it's original waypoint (usually guard) to reenter the city to simulate reenforcements (after 15 minutes or so)

Intended features:

- single script to work for all groups (rather than one script executed per group)

- works with both infantry groups and crewed vehicle groups (recreates crew)

- group id's and waypoints are preserved

- side effect: group knowledge is preserved, but probably doesn't matter after a 15 minute respawn time

- multiple random respawn location markers

- low overhead and resources (it's asleep most of the time)

Future ideas:

- unique respawn time per group via param

- limited respawns overall or per group

- make it work for multiple sides

- pass in markers via param

Usage:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// Call this for each AI group or AI vehicle in it's initialization or elsewhere

nul=[this] execVM 'AIGroupRespawn.sqf';

// Then call this once (from init.sqf) to begin loop.

nul=[] execVM 'AIGroupRespawn.sqf'; // no parameter means start infinite loop

Modify it as you wish, if it's useful. Don't forget to share your work.

Share this post


Link to post
Share on other sites

Thanks very much Dr_Eyeball.

It also solves my problems, trying to figure out why my basic one didn't work.

xmas_o.gif

Will report back if I encounter any problems.

thumbs-up.gif

Share this post


Link to post
Share on other sites

@colligpip: I checked and it works without addons. Just be sure to use Rahmadi island and no mods.

Note: I had a period character in the file name for the version which will cause any saves you make to create a new odd folder name (AIGroupRespawn_v0%2e1.Intro)

Created a small update. This is basically what I'm using now.

Changes:

- enhanced: mounted vehicle & driver recognition (see discussion below)

- fixed: units and crew now spawn at same marker location in order to move as group

- added: param allows group or unit with better duplicate validation

- minor: sleep times moved to #defines - for easier tweaking

- minor: setup 4 respawn markers for this test mission

Download test mission v1:

AIGroupRespawn_v1.Intro.rar

Mounted vehicle & driver recognition:

I have never encountered this before and is something to be aware of for other scripts.

It seems that sometimes during initialization of complex or large missions, units will not actually be in their vehicle at the time of checking during initialization. So in addition to using 'vehicle' and 'driver', I also had to add secondary checks for 'assignedVehicle' and 'assignedVehicleRole' to overcome this.

Share this post


Link to post
Share on other sites

Has anybody kept this file offered for download :

"AIGroupRespawn_v1.Intro.rar"

I really need to see how it was made for my new mission.

Thanks a lot.

Share this post


Link to post
Share on other sites

Yea could someone who has it put up a new link the other ones are down.

Share this post


Link to post
Share on other sites

Temp download of sample mission: AIGroupRespawn_v1_1.Intro.zip

This test mission is updated to include the same version of AIGroupRespawn.sqf found in my missions (in my signature).

The respawn times used in the test mission are for demonstration purposes only.

Share this post


Link to post
Share on other sites

So, if, let's say, you had a group of infantry and a series of waypoints for them, and you wanted them to respawn and then follow the waypoints starting from the FIRST one, and not the one they left off on when they were last alive, would this script do that?

If so, I have one of two missing pieces for my large scale CTF war with respawning vehicles!

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  

×