Respawning

  1. 8 years ago

    Hi there

    I want my players to respawn at the base, so I set up the Module and the Marker.
    If my player die, I do respawn at the building. But I got two mayor things I want to change:
    First of all, I want them to spawn with new / predefined gear, since I have an arsenal near the spawn point.
    Second one is a problem, which could be fixed by the first one: If the player respawns, it duplicates the backpack and puts it on the ground beneath him.

    Any suggestions?

  2. You can set "respawn" eventhandler for each players with your predefined loadout.

  3. I did find the respawn option in the eden editor. Wasn't an eventhandler, but I found it with the Multiplayer options. Now the backpacks don't duplicate anymore.
    But I don't know where to put the predefined loadouts. Can you give me more detailed information?

  4. Edited 8 years ago by DaVidoSS

    Inside eventhandler code. Put this code inside init field of playable unit. Edit loadout as you wish.

    	this addEventHandler ["Respawn", {
    	
    		params ["_newP", "_oldP"];
    	
    		removeAllWeapons _newP;
    		removeAllItems _newP;
    		removeAllAssignedItems _newP;
    		removeUniform _newP;
    		removeVest _newP;
    		removeBackpack _newP;
    		removeHeadgear _newP;
    		removeGoggles _newP;
    		_newP forceAddUniform "U_B_CombatUniform_mcam_vest";
    		_newP addItemToUniform "NVGoggles";
    		_newP addItemToUniform "muzzle_snds_338_black";
    		_newP addVest "V_PlateCarrierGL_rgr";
    		for "_i" from 1 to 2 do {_newP addItemToVest "HandGrenade";};
    		_newP addItemToVest "SmokeShell";
    		_newP addItemToVest "SmokeShellGreen";
    		_newP addItemToVest "SmokeShellBlue";
    		_newP addItemToVest "SmokeShellOrange";
    		_newP addItemToVest "130Rnd_338_Mag";
    		_newP addBackpack "B_Carryall_mcamo";
    		for "_i" from 1 to 3 do {_newP addItemToBackpack "130Rnd_338_Mag";};
    		_newP addHeadgear "H_HelmetB_desert";
    		_newP addGoggles "G_Combat";
    		_newP addWeapon "MMG_02_black_F";
    		_newP addPrimaryWeaponItem "acc_flashlight";
    		_newP addPrimaryWeaponItem "bipod_01_F_blk";
    		_newP linkItem "ItemMap";
    		_newP linkItem "ItemCompass";
    		_newP linkItem "ItemRadio";
    		_newP linkItem "ItemGPS";
    		deleteVehicle _oldP;
    	}];
    
  5. Thank you very much, Kind Sir.

  6. Unfortunetly I hijack this thread/question for the same Issue/question.
    Is this not the correct way please be patient with me and give me a hint that I is needed for a new Thread.

    In some Mission the player has custom loadout at the beginning.
    But when he logged later back in the player should be the loadout and the other stuff from the persistence save.
    Most this was not a problem, but now has the player a full custom loadout from clothes to cigarretes and after log back in the beginning loadout backpack is on the ground with the full loadout. All other things are normal saved.

    Normally i use a loadout.sqf in the mission that is called from initPlayerLocal.sqf
    Or, LEA
    Or, in the player Init
    Or, i call the script from the Init.
    And some other things.
    To avoid the item duplicates in MP normally i used the initPlayerLocal.sqf and my loadouts.

    Murdock, you solved the Issue cause you use Eden with the Multiplayer Arsenal option?
    The thing for me is, that i stay away from Eden, cause HeadlessClient Issues, and all the other Issues with placed objects. So for me this Issues broke all stuff in my Missions and i do it like before with other Tools but i create Mission at the moment not in Eden.

    The questions is, what i miss here for the "one-time-loadout" at the beginning.

    No respawn templates.
    Respawn is 3 and most i used ALiVE Multispawn variants.
    For additional information.

    Thank you

  7. Edited 8 years ago by Murdock

    Hej Timeless
    I think you did it right, don't add too many threads if not needed.
    As I understand the script/eventhandler DaVidoSS posted, the loadout will only be put into the character, if he respawns. So if he normally spawns, they do get the normal loadout, not the one described in the eventhandler.
    But yes, I solved the issue for my mission with the arsenal. You don't have to use Eden. Just put down a box (or Person/anything) and put the following line in the init of that object:
    this addAction ["Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }];
    Every player will be able to get everything for himself and his controlled AI comrades at the arsenal.
    I just didn't want the guys to respawn with everything they had when they died. It would duplicate everything, since the corpse still has the gear.
    The Eden Editor is just for nice placement of person/buildings/things, in my opinion. And you can edit all those things pretty nice in a way, you couldn't in 2d.

  8. after log back in the beginning loadout backpack is on the ground with the full loadout

    I can't be certain it is the cause of your problem, but I believe there is another mod that causes this.

  9. Friznit

    1 Apr 2016 Administrator

    Likely to be TFAR - it creates a unique items after you spawn in which replaces your backpack

  10. Edited 8 years ago by Murdock

    Well. I do have ACE,CBA and TFAR activated.
    And I do have the answer. TFAR puts a long-range-radio in the backpack slot. Well, the old backpack will be put on the ground then. Anyone know how to disable that long-range-spawning-radio? [edit: tf_no_auto_long_range_radio = true; has to be put in the init of the unit to prevent a long range radio to be spawned]

    But the respawn... If I respawn, I still got the gear I died with.

    My description.ext says about respawn:
    respawn = 3;
    respawnDelay = 5;
    respawnVehicleDelay = 120;
    respawnDialog = 0;
    respawnOnStart = -1;
    respawnTemplates[] = {};

    ALiVE Multispawn, not synced to any other module.
    Debug: No
    Respawn Type: Respawn in building
    Respawn Timeout: 0
    Enemy Check: No

    Ace Respawn Module:
    Save Gear: No
    Remove bodies: No

    The init of all playable units:
    this addEventHandler ["Respawn", {
    params ["_newP", "_oldP"];
    removeAllWeapons _newP;
    removeAllItems _newP;
    removeAllAssignedItems _newP;
    removeUniform _newP;
    removeVest _newP;
    removeBackpack _newP;
    removeHeadgear _newP;
    removeGoggles _newP;
    _newP forceAddUniform "U_B_CombatUniform_mcam_vest";
    deleteVehicle _oldP; }];

    Any ideas what I'm doing wrong?

  11. Edited 8 years ago by DaVidoSS

    tf_no_auto_long_range_radio = true;
    this is radio_settings.hpp line.
    File is located in \Arma 3\userconfig\task_force_radio

    Change the line :

    tf_no_auto_long_range_radio = 0;

    to

    tf_no_auto_long_range_radio = 1;

    And you do not need to force that anywhere else

    If you are trying to set this on server change this on server in the same way.

  12. Friznit

    1 Apr 2016 Administrator

    There's also a TFAR module you can place and turn off autoassign LRR

  13. The duplicated backpacks, made by TFAR Long Range Radio, are gone.
    Can anyone help me with the respawning-topic?

  14. Edited 8 years ago by Timeless

    Ok Thanks here for the replies.

    I tried it all.
    First, TFAR is using but is configured that all automatic distribution is diable/off.
    Long Rang is not in use all in all.
    Additional i tried it without TFAR but the backpack still there.

    ACE Save gear respawn.
    Yes, i have this on yes and this was never a problem. It is only a respawn eventhandler for the gear that i have when i die and have then the same after respawn, or?
    It is off, i spawn in regular vanilla loadout. So yes the problem is gone, but i have not loadout at all.
    May here the issue?

    My loadout (at the moment)
    In player init i call this.

    null = [this] execVM "loadoutST1.sqf";

    In the Mission is this loadoutST1.sqf (shorter for forum thread only example)

    _unit = _this select 0;
    
    removeAllWeapons _unit;
    removeAllItems _unit;
    removeAllAssignedItems _unit;
    removeUniform _unit;
    removeVest _unit;
    removeBackpack _unit;
    removeHeadgear _unit;
    removeGoggles _unit;
    
    _unit addBackpack "B_mas_rus_m_Bergen_rus";
    _unit addItemToBackpack "hlc_muzzle_snds_g3";
    _unit addItemToBackpack "acc_pointer_IR";
    for "_i" from 1 to 2 do {_unit addItemToBackpack "ACE_adenosine";};
    for "_i" from 1 to 12 do {_unit addItemToBackpack "ACE_elasticBandage";};
    for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
    _unit addItemToBackpack "ACE_DefusalKit";
    for "_i" from 1 to 2 do {_unit addItemToBackpack "ACE_epinephrine";};
    for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_CableTie";};
    _unit addItemToBackpack "ACE_MapTools";
    _unit addItemToBackpack "ACE_PreloadedMissileDummy_RPG18_CUP";
    for "_i" from 1 to 7 do {_unit addItemToBackpack "EWK_Cig1";};
    for "_i" from 1 to 2 do {_unit addItemToBackpack "EWK_Cigar1";};
    _unit addItemToBackpack "murshun_cigs_lighter";
    _unit addItemToBackpack "SmokeShellRed";
    for "_i" from 1 to 3 do {_unit addItemToBackpack "MiniGrenade";};
    _unit addItemToBackpack "ACE_M84";
    _unit addHeadgear "H_mas_med_beanie_O";
    _unit addGoggles "T_HoodTanBlk";
    
    _unit addHandgunItem "acc_mas_flash_gun";
    _unit addHandgunItem "optic_mas_MRD";
    _unit addWeapon "ACE_Vector";

    This setup works, i have all save and all restore. But additional the backpack spawn on the ground with the full gear. So when we log out and have only 1ammopack or something and log in and have the backpack again full.

    Normally i use a initPlayerLocal.sqf and call this line local.

    0 = [player] execVM "loadoutST1.sqf";

    In this case saves nothing, all are overwritten with the loadout.
    LEA loadout overwrites all.
    Player Init loadout duplicates in MP.

    respawn = 3
    No templates using
    Alive Multispawn, nothing more.

    So what loadout mechanics use you guys here?
    At which mission initialisation point come the Alive persistence loadout variables?
    It is possible to sleep 30sec before [Alive_persistence,true] or something like that :)
    One solution is vanilla loadout, and after beginn all go in Arsenal and grab his loadout....but....

    @Murdock
    Thank you for explain.
    Yes the things with Eden are clear but there other issues that are not fixed so i not useable for my mission/maps. I tried the Arsenal Multiplayer function in Eden and yes it solved the problem.
    But i want know what kind of script line is in the background that this loadout applies only one time and after that every time Alive Persistence.
    Have I understand you right, the problem is for you that you want the loadout from beginning after respawn too?

    Thank you guys

  15. @Timeless
    What loadout my players have at initial spawning is not relevant, since they can get to an arsenal box and get whatever they want.
    After their first login the Alive Persistence should work and as soon as they login again, they should login where they logged out, with the stuff they logged out.
    As soon as they die, I want them to spawn with a predefined loadout (which would be uniform only). At the moment they spawn with exactly the gear they died with, altough their corpse with all the stuff is still on the ground. So each time they die, they duplicate everything. Which is not an issue right now, but will be when I keep developing the mission (later on there will be different sides to join while each side has it's own specific weapons/uniforms/gear in the arsenal or in crates)

    Right now I personally am playing wth predefined loadouts in the arsenal, so as soon as I die and respawn, I just go to the box and load one of those, to get rid of half-empty mags and stuff. Not nice, but it's working.

    Did I understand you right, that you still got a duplicated backpack altough you disabled TFAR?

  16. highhead

    6 Apr 2016 Administrator

    Hey!

    This in the init.sqf of your mission will simply do the trick.

    if (hasInterface) then
    {
    player addEventHandler ["RESPAWN", {
    removeallweapons (_this select 0);
    removeallitems (_this select 0);
    removeVest (_this select 0);
    removeheadGear (_this select 0);
    removeGoggles (_this select 0);
    }];
    };

    • On first connect the standard loadout is used (or a custom empty one from init-field of the unit).
    • Players will gear up at your box and save to DB on disconnect.
    • On reconnect, players will load their formerly loadout from DB.
    • If they die and respawn all gear is removed and they have to gear up again.

    I probably covered many usecases in the ALiVE Sabotage MP Showcase mission already, take a look at that.

  17. highhead

    6 Apr 2016 Administrator

    PS: dont use the multispawn module in those cases, they will re-add your gear that you had when you were killed.

  18. Thanks a lot highhead,
    I'll put the lines in today or tomorrow and tell you how it went.
    If I delete the multispawn module, i'll have to put down a respawn_west marker, right?

  19. @Murdock
    Thanks for the answer.

    Yes the Arsenal is a solution in this case, maybe i should provide something similar only at the start of the Mission.
    I tried all at the moment except one thing.
    Kicked TFAR out from the repo....

    There are 2 Playergroups only one player has a TFAR longrange in loadout.
    Serverside is all disabled. But what i see is that may TFAR give IDs for every Radio/Pack and this bring up the issue also for Units they dont need anything from it.
    Backpack spawn further, but only the backpack.
    May give ACRE a try....also when TFAR is not further in development.

    But anyway big thanks for the replys and i post here when this bring up a solution.

  20. Well, it's done.

    First problem: On Start-spawn and restart there was a backpack on the ground. To overcome that one, I put those lines in the init of the playable units:

    tf_no_auto_long_range_radio = true;


    Maybe It's possible to put it in the init.sqf too, but I don't have one yet. So, it works. And on the ACE Respawn Module I disabled save gear and remove bodies.

    Second problem: On respawn my units had still all the gear they died with. Prior I used the alive multispawn module. Since I wanted to respawn the units in a building, I deleted the multispawn, put a respawn_west marker down and the following lines in the init of the playable units:

    this addEventHandler ["Respawn", { params ["_newP", "_oldP"];
    removeAllWeapons _newP;
    removeAllItems _newP;
    removeAllAssignedItems _newP;
    removeUniform _newP;
    removeVest _newP;
    removeBackpack _newP;
    removeHeadgear _newP;
    removeGoggles _newP;
    _newP forceAddUniform "U_B_CombatUniform_mcam_vest";
    deleteVehicle _oldP; }];

    Many thanks to @highhead for the help.

  21. Newer ›
 

or Sign Up to reply!