Jump to content
Sign in to follow this  
spades_neil

Make players respawn where they started, not at a base.

Recommended Posts

My current respawn script is set up to have players respawn at one of dozens of random markers across the map. I don't really want this. I want units to respawn at a specific location depending on which unit it is.

For example, I want pilots to respawn at the air base and other units to respawn at the camp to the south.

Despite doing some googling, I can't find what I'm looking for. Anything respawn related is just the basics; Instant respawn, base respawn, and respawning on AI (which I don't really count).

Can anyone help?

Share this post


Link to post
Share on other sites

The Eventhandler MPRespawn should be able to do something like that. Maybe set a variable per player in init or whatever and have the MPRespawn code shunt them to whatever marker is their variable?

Share this post


Link to post
Share on other sites
The Eventhandler MPRespawn should be able to do something like that. Maybe set a variable per player in init or whatever and have the MPRespawn code shunt them to whatever marker is their variable?

You're going to have to explain that again, but with the knowledge that I have absolutely no idea what I'm doing. <_>

If it's possible to have a player only respawn at a particular marker and not be given the option to spawn elsewhere, this could work.

Share this post


Link to post
Share on other sites

No, they'll respawn to the respawn_west marker. But the eventhandler MPRespawn can run code when they do that would them move them wherever. There was a recent post about this kind of thing a few days ago. Instead of moving the player into a parachute you'd just move the player to the airfield if they are a pilot for example.

Share this post


Link to post
Share on other sites
No, they'll respawn to the respawn_west marker. But the eventhandler MPRespawn can run code when they do that would them move them wherever. There was a recent post about this kind of thing a few days ago. Instead of moving the player into a parachute you'd just move the player to the airfield if they are a pilot for example.

So what you're saying is, if I gather correctly, they respawn (technically) at the west marker--but then teleport to the desired location? How would I go about setting this up?

Share this post


Link to post
Share on other sites

By using the example I linked above and instead of moving them into a parachute you'd move pilots to the airfield. :)

Share this post


Link to post
Share on other sites

I was wanting to do the same for this but could never figure out, I always just used the respawn_west thing but I could prob work something up for it.

Share this post


Link to post
Share on other sites

Simply move the "respawn_west" marker locally to the position where the unit should spawn.

Place a trigger in the editor, condition "local player" and in On Act. add:

"respawn_west" setMarkerPosLocal (position player);

This will move the "respawn_west" marker per connected client.

Xeno

Share this post


Link to post
Share on other sites
Simply move the "respawn_west" marker locally to the position where the unit should spawn.

Place a trigger in the editor, condition "local player" and in On Act. add:

"respawn_west" setMarkerPosLocal (position player);

This will move the "respawn_west" marker per connected client.

Xeno

I'm not sure that makes sense in the context of what I want to do.

I'm trying to make it so players in one group who are all pilots spawn at the air base, while players who are foot soldiers spawn on the other side of the map.

Share this post


Link to post
Share on other sites

Something like toss this in your init.sqf where p1, p2 and p3 are the pilot units.


_pilots = [p1, p2, p3];

if (player in _pilots) then {
    "respawn_west" setMarkerPosLocal getMarkerPos "airbase";
};

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  

×