zapat 56 Posted March 14, 2013 I have a SP respawn script in Arma2. I attach a onKilled eventhandler to player, and when it is triggered (player dies) my script runs: -I create a new unit and then selectplayer _newUnit; This works great in Arma 2, since the engine waits for the script to finish before triggereing endgame. In A3 I always get a black screen when player dies. The killed EH runs my script, but doesn't wait for it. Is it a bug? Is there a workaround for this for anyone? Thanks Share this post Link to post Share on other sites
cuel 25 Posted March 14, 2013 Use the local host MP editor. Share this post Link to post Share on other sites
buliwyf 4 Posted March 15, 2013 I´m sure there was a SP Respawn Script for ArmA2... somewhere in the depth of the internet... =/ Think you can use it for SP... ^^ Share this post Link to post Share on other sites
Gunter Severloh 4075 Posted March 15, 2013 Quote I´m sure there was a SP Respawn Script for ArmA2 http://forums.bistudio.com/showthread.php?121814-Single-Player-respawn-script Share this post Link to post Share on other sites
zapat 56 Posted March 15, 2013 You misunderstood me. My A2 respawn works in A2. Problem is that A3 cuts black after player is dead. After some experiments I found out that this is "only" a cut, so if I wait until its finished, I can cut it back with a cutText ["","BLACK IN", 1]; So this is more of an annoyance than a real bug, since the engine is not stopped, just hidden. Share this post Link to post Share on other sites
Tajin 349 Posted March 15, 2013 If you want an alternate solution, you could probably also use a http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#HandleDamage - Eventhandler and makes sure the damage of a player never really reaches 1, at which point you simulates his death and allow him to "respawn". Share this post Link to post Share on other sites
Gunter Severloh 4075 Posted March 15, 2013 I was only replying to what Buliwyf had said. Share this post Link to post Share on other sites
zapat 56 Posted March 15, 2013 NP :) Tajin: I've thought about it as well, but it would require a robust system. All for by-passing an unnecessary black screen. Share this post Link to post Share on other sites
TraxusIV 1 Posted March 30, 2013 zapat, could you share your script please? I'm having trouble creating a new unit and being able to selectPlayer it. Share this post Link to post Share on other sites
zapat 56 Posted March 30, 2013 (edited) My script is a part of a lot larger framework and contains many things which is connected to other stuff. Here is the method which actually respawns the player. I just wrote the eventhandler around it, so you'll probably need to tidy this up a bit, but this will do for a quick demo on how to do this: player removeAllEventHandlers "killed"; player addEventHandler ["killed", { if (_this select 0 == player) then { []call //actual respawning script: if spawned, wait 6 seconds! (with accTime 1) { setAccTime 1; cutText ["","BLACK IN", 1]; //cut back to visible _oldPlayer = player; _newPos = getMarkerPos "respawn"; //or write any position here _newGrp = createGroup west; //dead player will be civilian! So you either save his side in the beginning, or hard code it _newPlayer = _newGrp createUnit [typeOf _oldPlayer , _newPos, [], 0, "FORM"]; selectplayer _newPlayer; //[_newPlayer,PREVIOUS_LOADOUT] call fn_setLoadout; //I am using get/set loadout script. Must be saved periodically, as dead player will have unassigned weapons. deleteVehicle _oldPlayer ; }; }; }]; Trick is, that player becomes civilian and unit of a <null-group> when killed. So if you want some data from the killed player (previous loadout, side, units in group) you'll need to save it periodically while player is alive, because you can't get these infos anymore when the player is dead. And player is dead when the killed eventhandler triggers, right? If you don't call the script, but spawn it, you'll need to wait 6 seconds until BIS black cut is finished. Edited March 30, 2013 by zapat Share this post Link to post Share on other sites
KevsNoTrev 44 Posted March 30, 2013 have you tried to use something similar to the MP revive? http://forums.bistudio.com/showthread.php?148085-BTC-Revive It does have a weird glitch where you go back to base for a few seconds then end up in the same spot (even in mid air), it is more the eventhandler you may ba able to use to prevent the black screen and eventual mission end. Share this post Link to post Share on other sites