Jump to content
Sign in to follow this  
HeroesandvillainsOS

How to make players respawn but AI playable units die forever?

Recommended Posts

So I'm making a SP/COOP 1-6 mission. Ideally, in MP, I want the physical human players to respawn at two set respawn points I've made, but for the playable AI to just die.

Basically, in SP, death is permanent for players and AI. Since I usually way outlive the AI guys, I have placed some AI spawners, which are seperate from the grouped AI, at the respawn points. So when it's ultimately just me left, I return to base and recruit some more AI units. In MP, I like the idea of players respawning because it's kind of a long mission. But since the AI can't really use transport choppers or vehicles like the player can to join back up after death, I find it less than ideal to have to wait forever and ever when an AI guy dies and he physically walks several miles to rejoin the group.

I know the easiest solution would be just to disable the AI altogether in MP and let the player recruit them on mission start and have no playable AI at all. Except in the mission, our initial spawn point is on a boat and nowhere near the AI spawners.

Is there a way to set it up like this for the players to use respawn but the AI slots to have permanent death?

EDIT: Well now I'm thinking about what would happen in a JIP situation. Obviously, if their slot was gone because an AI died and couldn't respawn, that wouldn't be ideal either. Man, I don't know how you SP/COOP mission guys do it lol. It must be agonizing to get missions working in both SP and MP modes. :)

Share this post


Link to post
Share on other sites

Thinking overnight about this, it would probably just be easier to disable AI, change my initial spawn location and let smaller groups or SP'ers recruit AI from there.

That or wait until BIS implements revive for AI (or find a community script solution).

I'm still very curious how you SP/COOP mission makers choose to handle respawn/revive when grouped AI in the mix in missions that could last a few hours (where having just one life wouldn't be very fun).

Share this post


Link to post
Share on other sites

I'm still very curious how you SP/COOP mission makers choose to handle respawn/revive when grouped AI in the mix in missions that could last a few hours (where having just one life wouldn't be very fun).

I usually check how many AI units are still alive and if it's below certain threshold then I spawn a truck / heli and have i deploy the units where I need them to fill the gap.

Keeps the AO populated and even allows for some interesting things like temporarily or permanently disabling reinforcements when communication towers are destroyed or some objective is achieved.

 

TL;DR I just spawn new units with a script. Grouping them isn't a problem.

Share this post


Link to post
Share on other sites

Yeah I use an AI spawner from Spyder Addons which is excellent because I can limit the recruitment size (example, if the mission is for up to 6 players, you can set it to never allow more than 6 units in your group. This is great for maintaining the balance of the mission). The way it works is you place his module down in the editor, and sync it to an object. Done. It adds an add action for an AI recruitment spawner. It's amazing.

The problem I'm having is, where I want the player(s) to initially spawn, is physically on an assault boat (rather than near an AI spawner) en route to the first task. The only way I can think of filling the slots with AI from this spawn location is to leave the the grouped AI playable and enabled, which makes them subject to the respawn parameters. The spawned AI with the AI spawner though, they are not (when they die, they die for good).

All in all it would probably just be easier for me to change the initial spawn point and let the players recruit AI before boarding the boat. The only reason I don't do that is because I'm playing on Isola Di Capraia and the only place I can put the boat, the AI can't navigate to it! "Cannot comply!"

As a workaround, I added an add action to the boat itself to teleport the grouped AI inside it. It works pretty well but it just *feels* cooler to have 6 dudes already inside the boat on mission start, rather than on the dock.

I'll probably just look for an AI revive solution and just get rid of respawn altogether. I could just have us respawn on our own bodies too but then it would feel like you never died at all.

I'll figure it out. Sigh. Any additional suggestions are welcome and thanks for the reply.

Share this post


Link to post
Share on other sites

You could simply disable playerAI and then run a script at missionstart that counts the number of players and spawns a regular AI for every unoccupied slot.

 

That way people can JIP and the AI wont respawn.

Share this post


Link to post
Share on other sites
if (isServer) then {

    playerslots = 8;
    playercount = count allPlayers;
    botstospawn = playerslots - playercount;
    bottypes = ["B_Soldier_02_f","B_Soldier_03_f","B_Soldier_02_f","B_Soldier_F","B_Soldier_GL_F","B_Soldier_03_f","B_soldier_AR_F","B_soldier_LAT_F"];
    player1 = allPlayers select 0;
    
    for [{_i=1},{_i<=botstospawn},{_i=_i+1}] do {
        _type = bottypes select (_i - 1);
        _bot = _type createVehicle position player1;
        [_bot] joinSilent (group player1);
        
        _bot assignAsCargo boat1;
        _bot moveInCargo boat1;
        if (vehicle _bot == _bot) then {
            _bot assignAsCargo boat2;
            _bot moveInCargo boat2;    
        };
    };

};

Something like this.

(assuming you have 2 boats, named boat1 and boat2)

Share this post


Link to post
Share on other sites

Basically it spawns an AI soldier for every empty slot at the start of the mission and makes them join the group.

Since they're regular AI, they won't respawn.

  • Like 1

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  

×