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!
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.