Jump to content
Sign in to follow this  
Kingsley1997

Removing all respawn points for a group added by BIS_fnc_addRespawnPosition

Recommended Posts

Is there a way to remove all of the respawn points added through BIS_fnc_addRespawnPosition?

For example...

[_myGroup, "hq_spawn"] call BIS_fnc_addRespawnPosition;
[_myGroup, "fob"] call BIS_fnc_addRespawnPosition;
... and so on ...

// LATER ON IN THE MISSION
[_myGroup] call BIS_fnc_removeAllRespawnPositions;

I've got it at the moment to add respawn positions to a player's namespace but it's too clunky. Ideally I'd like to remove all respawn positions and then I can do whatever...

Share this post


Link to post
Share on other sites

Save arrays which returns BIS_fnc_addRespawnPosition in array:

allRespawnPositions = [];

{allRespawnPositions pushBack (_x call BIS_fnc_addRespawnPosition)} forEach [
[_target1, _position1],
...
];

{_x call BIS_fnc_removeRespawnPosition} forEach allRespawnPositions;

allRespawnPositions = [];

Share this post


Link to post
Share on other sites
Save arrays which returns BIS_fnc_addRespawnPosition in array:

allRespawnPositions = [];

{allRespawnPositions pushBack (_x call BIS_fnc_addRespawnPosition)} forEach [
[_target1, _position1],
...
];

{_x call BIS_fnc_removeRespawnPosition} forEach allRespawnPositions;

allRespawnPositions = [];

Thanks, I'll save this. I'm currently trying it with markers. It's quite a complicated respawn system though, since if groupA is at fobA, they should only be allowed to spawn at fobA, but groupB can spawn at fobB and so on etc.

Share this post


Link to post
Share on other sites
Thanks, I'll save this. I'm currently trying it with markers. It's quite a complicated respawn system though, since if groupA is at fobA, they should only be allowed to spawn at fobA, but groupB can spawn at fobB and so on etc.

You can save the list of identifiers on the group itself:

private "_identifiers";

_identifiers = _myGroup getVariable ["respawnIdentifiers", []];

_identifiers pushBack ...

_myGroup setVariable ["respawnIdentifiers", _identifiers, true];

Alternatively you could be sinful and violate the privacy of the bis_fnc_addRespawnPosition function, and do this:

_myGroup setVariable ["BIS_fnc_getRespawnPositions_list", [-1, [], [], []], true];

Share this post


Link to post
Share on other sites
{[_myGroup, _x] call BIS_fnc_removeRespawnPosition} forEach (_myGroup call BIS_fnc_getRespawnPositions);

Edited by Schatten

Share this post


Link to post
Share on other sites
{[_myGroup, _x] call BIS_fnc_removeRespawnPosition} forEach (_myGroup call BIS_fnc_getRespawnPositions);

Sure that works? BIS_fnc_getRespawnPositions returns a position rather than an id for each point.

Share this post


Link to post
Share on other sites
Sure that works? BIS_fnc_getRespawnPositions returns a position rather than an id for each point.

Yea, my mistake, sorry.

Share this post


Link to post
Share on other sites

I've tried all your suggestions, nothing's working :( I'm just gonna revisit this when I'm not tired, maybe I'm doing it wrong...

Share this post


Link to post
Share on other sites

The respawn positions are stored on the object you specify e.g unit, group, namespace etc in a variable called BIS_fnc_getRespawnPositions_list.

Something like this should do the job

_group = group player;
{
[ _group, _x ] call BIS_fnc_removeRespawnPosition;
}forEach (( _group getVariable "BIS_fnc_getRespawnPositions_list" ) select 1 );

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  

×