Jump to content
Sign in to follow this  
Yuka

Respawn to multiple bases via helicopter

Recommended Posts

Greetings.

I'm making a persistent multiplayer mission that features multiple bases from which a player can select to be based out of.

The intent: Players will choose a base to be stationed out of. Each base will have a platoon-sized element (roughly 30 depending on what type of unit it is). As such, each base will harbor a different type of unit, offering players different equipment and as such, creating various challenges for them as they will have to use the equipment that they have at whichever base they choose to work out of to overcome challenges that the mission gives them.

I'm working on a realistic respawn system for this. When a player dies, instead of spawning back at the patrol base that they are based out of, they respawn at the airfield and wait for a helicopter to pick them up and fly them to their respective base. This also offers a nice buffer that will hopefully make people value their ingame life a little more and avoid unrealistic suicide tactics while also providing the risk of the "respawn bird" getting shot down while in transit from the airfield to the base. My future plans are to make this respawn bird also resupply ammo and fuel stores on its respective patrol base, further increasing its importance.

Now the requirements.

I'd like the player to have limited or zero control in the respawn process. They all respawn at the air field but based on which unit they belong do they are somehow forced to board the respawn bird for that base when it arrives back at the airfield. I don't want them respawning at the airfield and running off although that could be enforced by the fact that there is nothing for them to do at the airfield besides walk back to their base. Once onboard, they should be locked out until it drops them off at their patrol base. If the bird is disabled and shot down en route, I'd like the player to be given controls so they may attempt to eject and survive the crash... only to be stranded and possibly wounded in the middle of nowhere.

I have the birds set up with waypoints that will have them unload their cargo and even using basic scripting to make them respawn properly and continue their job when/if they are shot down. However, I have no clue how to force the players onto their respective bird after respawning. I can probably set up unique names for each player slot and then do a large switch and move them to a "holding pen" for each bird and then when the bird arrives have it automatically moveInCargo all players that are currently in each holding pen, but I think that is a bit clunkier than I'd like to implement.

Also, I'm having problems with the birds doing the cinematic landing at the HLZ and holding for a set amount of time before taking off and continuing their flight. They only do this if they have a player to unload and they take off immediately after the cargo is unloaded.

If I made it so players had to board the bird for their base, how can I make it so a player for base A cannot get onto the bird going to base B?

Any suggestions?

Edited by Yuka

Share this post


Link to post
Share on other sites

Let them spawn anywhere and put them right away (with moveincargo) into the helicopter which is always travelling between the bases..lock the heli and unlock only, if the heli recieves damage above certain level or is inside a base and landing..

Share this post


Link to post
Share on other sites

After some thought, I think I might make the helicopters into a shuttle service between the patrol bases and the airbase. I'll allow anyone to board any of the helicopters.

My issue now is making the helicopters land at the airbase, stay there for 180 seconds, then take off, go to its respective patrol base, land there, hold for 180 seconds, then return to the airbase... rinse repeat.

Now my issue is not only making that happen, but making it happen when the respawn bird respawns... how do I give a spawned AI vehicle such complex waypoints? I tried using that vehicle respawn script but the respawned bird just hovers over the airfield after the first cycle.

Share this post


Link to post
Share on other sites

I've been banging away at it and perhaps I am not visualizing how the engine handles these scripts.

The following is used by the vehicle respawn script to respawn the helicopters after they are destroyed. EagleBird is the unique name given to the helicopter itself. PBEagle1 is the marker at the patrol base that the bird is travelling to and PBEagle2 is the return marker at the airbase. This code does not do what I want it to do... that is land at each marker and hold with the bird still spun up for 180 seconds and then take off and continue on the cycle. I realize the code may represent only holding at the airbase, but at this point, I'm only worried about getting it to work on one end... then I can duplicate the code for the other end instead of rewriting the code for each end with every attempt.

Script called when respawning the bird to program its waypoints

_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"PBEagle1",0];
_waypoint0 setWaypointScript "scripts\pbland.sqf EagleBird"; 
_waypoint0 setWaypointSpeed "FULL";

_waypoint1 = _group addwaypoint[getmarkerpos"PBEagle2",0];
_waypoint1 setWaypointScript "scripts\abland.sqf EagleBird"; 

_waypoint2 = _group addwaypoint[getmarkerpos"PBEagle2",0];
_waypoint2 setwaypointtype "CYCLE"; 
_waypoint2 setWaypointScript "scripts\respawnbirdresupply.sqf Eaglebird";

abland.sqf

this land "LAND";
sleep 180;
_waypoint1 setWaypointType "MOVE";

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  

×