Robustcolor 31 Posted July 2, 2021 addRespawnPosition function duplicates and overwrite names and it also replaces the editor placed respawn_west markers name when a vehicle is destroyed in the respawn menu. I have two markers on the editor called respawn_west and respawn_west1. I'm also creating different vehicles then adding respawnPositions to them from scripts. variable _veh is not used in same script. I've tried both of these _rsp = [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition; _rsp1 = [west, _veh, "Boat"] call BIS_fnc_addRespawnPosition; _rsp2 = [west, _veh, "Car"] call BIS_fnc_addRespawnPosition; [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition; [west, _veh, "Boat"] call BIS_fnc_addRespawnPosition; [west, _veh, "Car"] call BIS_fnc_addRespawnPosition; When a vehicle is destroyed. waitUntil {!alive _veh}; [_veh] call BIS_fnc_removeRespawnPosition; This don't work properly. Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 2, 2021 1 hour ago, Robustcolor said: This don't work properly this tells nothing! Also your usage of BIS_fnc_removeRespawnPosition is wrong. read its biki entry. Share this post Link to post Share on other sites
Robustcolor 31 Posted July 4, 2021 I will try this _rsp = [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition; waitUntil {!alive _veh}; _rsp call BIS_fnc_removeRespawnPosition; Also, i remember using a script command in initServer for showing the respawnPosition markers a while back, can't find it again. Anyone know? Share this post Link to post Share on other sites
mrcurry 511 Posted July 5, 2021 On 7/4/2021 at 9:32 AM, Robustcolor said: Also, i remember using a script command in initServer for showing the respawnPosition markers a while back, can't find it again. Anyone know? Are you perhaps thinking about the "MenuPosition" respawn template?https://community.bistudio.com/wiki/Arma_3:_Respawn#Official_Templates Or do you just want to add markers to them on the map? If so any old "tracking marker"-script will do: Spoiler // Run on server only [ [_veh, _name], { params ["_veh", ["_name", ""]]; private _m = createMarkerLocal [ "resp_" + (_veh call BIS_fnc_objectVar), getPos _veh]; _m setMarkerTypeLocal "mil_flag"; _m setMarkerTextLocal _name; _m setMarkerColorLocal "ColorBLUFOR"; while {alive _v} do { sleep 0.5; // Change to update as often as you like _m setMarkerPosLocal getPos _veh; }; deleteMarkerLocal _m; } ] remoteExec ["spawn", [0, -2] select isDedicated, _veh]; // Or if you want to make it CfgRemoteExec safe: // Step 1: Define the remoteExec'd code as a function using the Functions Library, see: https://community.bistudio.com/wiki/Arma_3:_Functions_Library // Step 2: On the server exec this [_veh, _name] remoteExec ["YOUR_fnc_namehere", [0, -2] select isDedicated, _veh]; Note if you are using this for ALOT of vehicles (unlikely); To avoid clogging up the JIP-queue and scheduler I would update all markers in a single loop instead. Share this post Link to post Share on other sites
Robustcolor 31 Posted July 31, 2021 Question, Instead of using this code below i would like to pass my variable _rsp into an killed eventHandler for the created vehicle, how can i fetch the variable inside the EH? _rsp = [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition; waitUntil {!alive _veh}; _rsp call BIS_fnc_removeRespawnPosition; Example. _rsp = [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition; _veh addEventHandler ["Killed", { _rsp call BIS_fnc_removeRespawnPosition; }]; Share this post Link to post Share on other sites
sarogahtyp 1109 Posted July 31, 2021 _rsp is a local variable which is not known in a EH. You have to use a global variable 1 Share this post Link to post Share on other sites
pierremgi 4910 Posted July 31, 2021 _veh setVariable ["rsp", [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition]; _veh addEventHandler ["Killed", { params ["_veh"]; (_veh getVariable ["rsp,[]]) call BIS_fnc_removeRespawnPosition; }]; 1 Share this post Link to post Share on other sites
Robustcolor 31 Posted July 31, 2021 28 minutes ago, pierremgi said: _veh setVariable ["rsp", [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition]; _veh addEventHandler ["Killed", { params ["_veh"]; (_veh getVariable ["rsp,[]]) call BIS_fnc_removeRespawnPosition; }]; I was just going to ask if i could attach it to the object in this case _veh with a setVariable command. @pierremgi How can i check if the specific _veh has this variable you wrote with getVariable? I'm just familiar with true/false or isNil with set/get variable. is a if (!isNil {_veh getVariable "rsp"}) then {}; enough? Thanks. Share this post Link to post Share on other sites
pierremgi 4910 Posted July 31, 2021 Yes! Anyway, the getVariable fails safe with [] call BIS_fnc_removeRespawnPosition ([] as default). Sorry for the typo. I omitted a quote (corrected). 1 Share this post Link to post Share on other sites
Robustcolor 31 Posted July 31, 2021 51 minutes ago, pierremgi said: Yes! Anyway, the getVariable fails safe with [] call BIS_fnc_removeRespawnPosition ([] as default). So if i understand this correct is that _veh setVariable ["rsp", [west, _veh, "Helicopter"] call BIS_fnc_addRespawnPosition]; causes no error with (!isNil {_veh getVariable "rsp"}) check? Share this post Link to post Share on other sites
pierremgi 4910 Posted July 31, 2021 ... And no error without it, as far as you write/test: _veh getVariable ["rsp",[]] 1 Share this post Link to post Share on other sites