dex01 0 Posted September 10, 2018 Hi all, I hope this is the right section to post my questions that I previously posted in another section but I could not move here or delete.. I'm playing DRO missions in SP and in MP with a friend and I'd like to limit total respawns in the mission (now is illimitate) adding a mission parameter. Someone can tell me how can I do this? part of description.ext respawn = 3; respawnButton = 1; respawnDelay = 45; respawnDialog = 0; respawnOnStart = 0; respawnTemplates[] = {"MenuPosition", "Tickets", "Spectator", "EndMission"}; class Params { class Respawn { title = "Respawn"; values[] = {0,1,2,3}; texts[] = {"20 Seconds", "45 Seconds", "90 Seconds", "Disabled"}; default = 1; }; class RespawnPositions { title = "Respawn Positions"; values[] = {0,1,2}; texts[] = {"Both", "Starting location only", "Team only"}; default = 0; }; }; OnPlayerRespawn.sqf diag_log format ["DRO: %1 respawn: %2", player, _this]; waitUntil {!isNull player}; if (!isNil "loadoutSavingStarted") then { if (loadoutSavingStarted) then { playerRespawning = true; _loadout = player getVariable "respawnLoadout"; if (!isNil "_loadout") then { diag_log format ["DRO: Respawning with loadout = %1", _loadout]; player setUnitLoadout _loadout; }; if (!isNil "respawnTime") then { setPlayerRespawnTime respawnTime; }; deleteVehicle (_this select 1); playerRespawning = false; }; }; if (!isNil "droGroupIconsVisible") then { if (droGroupIconsVisible) then { setGroupIconsVisible [true, false]; }; }; Thanks Share this post Link to post Share on other sites
pierremgi 4850 Posted September 10, 2018 You can use the function for respawn tickets. See also: description.ext. Share this post Link to post Share on other sites
dex01 0 Posted September 11, 2018 On 10/9/2018 at 5:59 PM, pierremgi said: You can use the function for respawn tickets. See also: description.ext. I read what you suggested but I do not understand how to adapt it to my files. What code should I implement in my OnPlayerRespawn.sqf file? description.ext class Params { class Respawn { title = "Respawn"; values[] = {0,1,2,3}; texts[] = {"20 Seconds", "45 Seconds", "90 Seconds", "Disabled"}; default = 1; }; class RespawnPositions { title = "Respawn Positions"; values[] = {0,1,2}; texts[] = {"Both", "Starting location only", "Team only"}; default = 0; }; class RespawnNumbers { title = "Respawn Numbers"; values[] = {0,4,8}; texts[] = {"Disabled", "4", "8"}; default = 1; }; }; How can I activate the respawn number parameter in the OnPlayerRespawn.sqf ?? Thank you Share this post Link to post Share on other sites
pierremgi 4850 Posted September 11, 2018 For your respawn parameters: in description.ext: You have to define the right values for respawn time. So, the values should be: values[] = {20,45,90,0}; // i don't know how do you script for 0 or disabled.... default = 45; in description.ext, also: respawnTemplates[] = { "Counter", "Tickets" }; title = "Respawn Numbers"; values[] = {-1,4,8}; // -1 for disabling respawn > so, player will die texts[] = {"Disabled", "4", "8"}; default = 4; in init.sqf: waitUntil {!isNull player}; player addEventHandler ["Killed",{setPlayerRespawnTime ("respawn" call BIS_fnc_getParamValue) }]; // so you read the right value. Must be in EH killed. Command doesn't work on its own. if (isServer) then {[WEST,("RespawnNumbers" call BIS_fnc_getParamValue)] call BIS_fnc_respawnTickets}; EDIT: if you want to display some remaining counter, just replace the EH by: player addEventHandler ["Killed",{ setPlayerRespawnTime ("respawn" call BIS_fnc_getParamValue); ["Remaining life: "+str (([west] call BIS_fnc_respawnTickets)-1), 2] call BIS_fnc_respawnCounter }]; Share this post Link to post Share on other sites
HazJ 1289 Posted September 11, 2018 For disabled you could use -1 and then check == -1 then end mission... Share this post Link to post Share on other sites
pierremgi 4850 Posted September 11, 2018 7 minutes ago, HazJ said: For disabled you could use -1 and then check == -1 then end mission... Yep. But it's already done with respawn numbers. I wasn't sure if dex01 would like "no delay" (that could input some issue, especially when respawning on start), or another disabling respawn system. Share this post Link to post Share on other sites
HazJ 1289 Posted September 11, 2018 I assumed anything 0 or below would instantly respawn regardless. Hence the check to end mission. Share this post Link to post Share on other sites
dex01 0 Posted September 12, 2018 Tonight I'll try to edit the files as you suggested. Thanks to all for the support. Share this post Link to post Share on other sites
dex01 0 Posted September 12, 2018 I tried and it seems to be what I was looking for ! But I did not understand how to end the mission when I finished respawn. Could you show me how to do this? Thank you Share this post Link to post Share on other sites
pierremgi 4850 Posted September 12, 2018 you have all you need in the editor. See attributes / multiplayer / respawn... Mission fail when everyone is dead or single player death. Or add a trigger #lose when all players are dead : {!alive _x} count allplayers == 0 && count allPlayers > 0 Share this post Link to post Share on other sites
dex01 0 Posted September 13, 2018 15 hours ago, pierremgi said: you have all you need in the editor. See attributes / multiplayer / respawn... Mission fail when everyone is dead or single player death. Or add a trigger #lose when all players are dead : {!alive _x} count allplayers == 0 && count allPlayers > 0 Thank you! Share this post Link to post Share on other sites