Jump to content
Sign in to follow this  
geloxo

Avoid poor performance with respawn in MP missions

Recommended Posts

This is a request to mission makers. I noticed on several servers that performance drops down to unplayable fps when the number of death bodies is high on game modes with player respawn. Solution is simply removing those player bodies after a certain amount of time. Simply use this line on the misión init for each client:

player addEventHandler ["respawn", {_this spawn {sleep 120; deleteVehicle (_this select 1)}}];

This will delete the player´s last dead body 120s after the respawn (you can change the time delay value) and therefore performance stays stable even on long missions. Surely there will be other solutions but this is easy and compatible with all Arma3 and Arma2 versions

Share this post


Link to post
Share on other sites

Tried this.. didn't seem to work for "me"... put in init of each player.. do I need to replace Player with named player or something? or did I miss actual place to put it? Is there an area marker that can be setup and used for total deadbody count..and erase from there?

Edit: Ahhhh..found cleanup.sqf in another posting.. works..

http://forums.bistudio.com/showthread.php?124600-delete-dead-vehicles&p=2016996#post2016996

Edited by Fuby

Share this post


Link to post
Share on other sites

You'd put it in init.sqf or replace player with "this"

Share this post


Link to post
Share on other sites

You have to put this in the mission init.sqf, not on each player unit. It Works (I have tested on our server). See an example of init.sqf:

waitUntil {!(isNull player)};
waitUntil{!isNil "BIS_fnc_init"};

setTerrainGrid 3.125;
setViewDistance 1500;
enableTeamSwitch false;
enableSaving [false,false];
BIS_noCoreConversations = true;

if (isPlayer player) then
{
[color="#FF0000"][b]player addEventHandler ["respawn", {_this spawn {sleep 120; deleteVehicle (_this select 1)}}];[/b][/color]

};

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  

×