Restrict Spawn Selection Based On Corpse Location

3 posts in this topic


I'm looking for some help. I've been trying to get my spawn selection to only show spawn points that are a certain distance away from the player's corpse.

I've been attempting to achieve this by overwriting "ExileClient_gui_selectSpawnLocation_show.sqf", this is the block of code that finds and populates the spawn selection list:


lbClear _listBox;
	if (getMarkerType _x == "ExileSpawnZone") then
		_listItemIndex = _listBox lbAdd (markerText _x);
		_listBox lbSetData [_listItemIndex, _x];
forEach allMapMarkers;
_numberOfSpawnPoints = {getMarkerType _x == "ExileSpawnZone"} count allMapMarkers;
if (_numberOfSpawnPoints > 0) then 
	_randNum = floor(random _numberOfSpawnPoints);
	_randData = lbData [24002,_randNum];
	_randomSpawnIndex = _listBox lbAdd "Random";
	_listBox lbSetData [_randomSpawnIndex, _randData];


I know what needs to be done... just no idea how to do it. I can read the code and understand what it does, but I cannot write code nearly well enough to do something like this.

When a player dies, according to "ExileClient_object_player_event_onKilled.sqf" it creates a maker with the type of "KIA" and the name of "Death%1" where %1 is the time of death. What needs to happen is while ExileClient_gui_selectSpawnLocation_show.sqf is populating the list of respawn locations, it needs to compare the coordinates of the ExileSpawnZone markers vs the KIA marker and if they're within a certain distance of each other (say 5KM) then don't add it to the list. I'm assuming you could use the getMarkerPos command to get the location of the KIA marker and the ExileSpawnZone marker and compare the distances. I just have no idea how to code this properly.

Any help would be greatly appreciated.

Share this post

Link to post
Share on other sites

Can anyone help me with this? I have tried to get this to work on my own, but each time it just breaks the spawn selection dialog.

Share this post

Link to post
Share on other sites

I cant really write code or anything, but this would be a really nice feature to add to Exile as a whole. That way if the server has specific or random spawns, and you kill one or more people in a fire fight, they cant get to there bodies extremely fast. Hopefully someone can help you out with this!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.