Jump to content
Sign in to follow this  
deadlyfishes

Specific respawn points for specific squads/units

Recommended Posts

I'm building a multi-task Co-Op mission involving several squads with different roles such as;

CAS Jet Pilots

Fighter Jet Pilots

Fireteam Squads

Recon Squads

Each group has it's own squad that spawn in different locations. I want players to be able to respawn as many times as they'd like, so basically a BASE type respawn.

The problem is, if you choose the CAS Jet Pilot unit to play as, you can spawn at any of the four locations I created, but I would like for that one single unit to only spawn at the respawn point or points of my choosing.

Basically looking to force certain units to only have certain spawn points available to them.

Did some digging around and couldn't really find much except the basic respawn stuff.

Any ideas here? I'm sure many others would like to know this as well.

Thank you!

Share this post


Link to post
Share on other sites

You can use the "respawn" eventhandler and within that you can have your if statements checking the specific unit's classname (i.e. Jet Pilot) and then simply have it setpos of the unit to your marker position.

Put this in your init.sqf:


player addEventHandler ["Respawn", {

if (typeOf _this == "PilotClassname") then {_this setpos (getmarkerpos "PilotRespawn"); } else { if (typeof _this == "OtherClassname") then {..same code, different marker..} else {..so on};

}];

Sorry for the bad spacing currently doing this on my phone. And you may need some JIP checks as well, but we will see, someone may make that point hereafter my post :p.

And if you don't want to use the event handler then the if statements can be used for conditions of multiple triggers that encompass the normal "respawn_west" marker, and the onAct would be your get and setpos commands.

And for groups, aside from checking classname, all you would need to do is instead of "typeof player" you would do "group player" and then the other side of the == would be the group leader id or group id.

Edited by JShock
  • Like 1

Share this post


Link to post
Share on other sites
Similar thread here.

I was going to make the same comment Iceman, but seeing how these were players and not NPCs, I figured I could explain it out :p.

Share this post


Link to post
Share on other sites

All very helpful and useful guys. I hope more find this information here useful as well!

Thanks so much :D

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  

×