Kingsley1997 39 Posted July 18, 2015 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
Schatten 290 Posted July 18, 2015 https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition Share this post Link to post Share on other sites
Kingsley1997 39 Posted July 18, 2015 https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition I'm aware of this function, but it requires you to know the respawn ID that's returned from BIS_fnc_addRespawnPosition Share this post Link to post Share on other sites
Schatten 290 Posted July 18, 2015 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
Kingsley1997 39 Posted July 18, 2015 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
Schatten 290 Posted July 18, 2015 Also take a look at this function: https://community.bistudio.com/wiki/BIS_fnc_getRespawnPositions. Share this post Link to post Share on other sites
ianbanks 30 Posted July 18, 2015 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
Schatten 290 Posted July 18, 2015 (edited) {[_myGroup, _x] call BIS_fnc_removeRespawnPosition} forEach (_myGroup call BIS_fnc_getRespawnPositions); Edited July 18, 2015 by Schatten Share this post Link to post Share on other sites
ianbanks 30 Posted July 18, 2015 {[_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
Schatten 290 Posted July 18, 2015 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
Kingsley1997 39 Posted July 18, 2015 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
Schatten 290 Posted July 18, 2015 Can you provide source code? Share this post Link to post Share on other sites
Larrow 2822 Posted July 18, 2015 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