Results 1 to 7 of 7

Thread: Respawn help

  1. #1

    Respawn help

    Hey, ive been making a mission and I want to make it so players can respawn back at base but I dont want them to have the weapons that there unit would normally have because im trying to limit te weapons everyone uses to like m16a2s etc. I know about Norrins revive thing but I dont want to use that in this mission because I dont want people's bodies to dissapear when they respawn.

  2. #2
    First Lieutenant PuFu's Avatar
    Join Date
    Feb 17 2007
    Location
    unallocated
    Posts
    5,385
    This forum is for ADDONS - Configs and Scripting. MISSION editing is on another sub-forum.

    Spoiler:

  3. #3
    Please make sure you post in the correct forum before making a post.

    It's not that hard to figure that respawn has nothing to do with addon editing but is related to mission editing.

  4. #4
    // OPTIONS FOR PLAYER'S DEAD BODIES AND EQUIPMENT - Additional revive functions with many thanks to alef (0 - off, 1 - on except for _bury_timeout)
    _drop_weapons = 1; //array no.93 - should the respawned player drop his weapons where he died?
    _cadaver = 1; //array no.94 - should the respawned player's body remain there?
    _bury_timeout = 120; //array no.95 - if drop weapons OR player body, how long before the body is buried?
    // 0=maximum (1200s) , n=seconds up to 1200s (hard coded)
    That is around line 165 in Norrin's Revive Script 'revive_init.sqf'. 1200 seconds is 20 minutes, but if that is truly not long enough, give this a whirl for your weapons deal:

    init.sqf
    // Default soldier loadout.
    BIS_EVO_pallammo = ["30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd _556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x4 5_Stanag","30Rnd_556x45_Stanag","15Rnd_9x19_M9","1 5Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9"];// The players default load out
    BIS_EVO_pweapons = ["M16A2","M9","Binocular","NVGoggles","ItemGPS","It emRadio","ItemMap","ItemWatch","ItemCompass"]; // The players default load out

    // Reset everyone's weapons since we're using generic classes.
    removeAllWeapons player;
    removeAllItems player;
    {player addMagazine _x;} forEach BIS_EVO_pallammo;
    {player addWeapon _x;} forEach BIS_EVO_pweapons;
    _primary = primaryWeapon player;
    if (_primary != "") then {
    player selectWeapon _primary;
    // Grenade launcher Fix
    _muzzles = getArray(configFile>>"cfgWeapons" >> _primary >> "muzzles");
    player selectWeapon (_muzzles select 0);
    };
    Then, in a new file...

    refill.sqf
    // Respawn with previous gear

    // Give back the weapons the player had when he died.

    removeAllWeapons player;

    {player addMagazine _x;} forEach BIS_EVO_pallammo;

    {player addWeapon _x;} forEach BIS_EVO_pweapons;

    _primary = primaryWeapon player;
    if (_primary != "") then {
    player selectWeapon _primary;
    // Grenade launcher Fix
    _muzzles = getArray(configFile>>"cfgWeapons" >> _primary >> "muzzles");
    player selectWeapon (_muzzles select 0);
    };
    You might have to tinker with this a bit. Anyway, with normal respawn you will respawn with the stock weapons for that specific soldier. That script in the init.sqf will change all player's initial loadout from stock to whatever you want it to be (M16A2 for this specifically). Then on death and respawn the refill.sqf should again remove all stock gear and replace it with whatever you died with.


  5. #5
    If you're going to do that might as well save the weapon loadout when you pick up something new too, place a trigger over the whole AO:

    Condition =
    Code:
    animationState player == "amovpercmstpslowwrfldnon_gear" or animationState player == "amovpercmstpsraswrfldnon_gear"
    OnDea =
    Code:
    BIS_EVO_pallammo = magazines player;BIS_EVO_pweapons = weapons player; hintSilent "Weapons Saved";

  6. #6
    Quote Originally Posted by Black0ps View Post
    im trying to limit te weapons everyone uses to like m16a2s etc. I know about Norrins revive thing but I dont want to use that in this mission because I dont want people's bodies to dissapear when they respawn.
    You realize that the two bold statements doesn't really go well hand in hand? If you want to enforce such limits (I'm a fan of those myself), you need to get rid of the killed players body before others can nick its equipment. Otherwise you may find yourself with two MAAWS launchers in the battle when you only intended to allow a single one (since player will respawn with his). Then three, then four etc - with a huge potential to ruin a scaled mission.

    It's problematic, I know. On one hand you want to be nice and let others use his equipment when he falls. But giving too many will break mission scaling. Letting him respawn without his launcher may be a viable solution in a closed community, but it will fail miserably on a public server where people have to respect for other peoples "property".

    For me, the only way to achieve playable balance with public players in mind, was to deny the possibility of grabbing the fallen ones gear, even if not realistic.

    You can of course, also remove "key items" upon death, and leave the rest. I.e. a MAAWS launcher or scoped rifle (in historic mission) is something you want to have in extremely limited supply so these are removed. But players who have only iron sights and an M136 which may be in plenty supply might not get removed.

    Just something to keep in mind.
    Last edited by CarlGustaffa; Jul 18 2010 at 00:40.
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  7. #7
    Quote Originally Posted by W0lle View Post
    Please make sure you post in the correct forum before making a post.

    It's not that hard to figure that respawn has nothing to do with addon editing but is related to mission editing.
    sorry, I must have saw scripting in the forum name and just automatically clicked on it.



    You realize that the two bold statements doesn't really go well hand in hand? If you want to enforce such limits (I'm a fan of those myself), you need to get rid of the killed players body before others can nick its equipment. Otherwise you may find yourself with two MAAWS launchers in the battle when you only intended to allow a single one (since player will respawn with his). Then three, then four etc - with a huge potential to ruin a scaled mission.

    It's problematic, I know. On one hand you want to be nice and let others use his equipment when he falls. But giving too many will break mission scaling. Letting him respawn without his launcher may be a viable solution in a closed community, but it will fail miserably on a public server where people have to respect for other peoples "property".

    For me, the only way to achieve playable balance with public players in mind, was to deny the possibility of grabbing the fallen ones gear, even if not realistic.

    You can of course, also remove "key items" upon death, and leave the rest. I.e. a MAAWS launcher or scoped rifle (in historic mission) is something you want to have in extremely limited supply so these are removed. But players who have only iron sights and an M136 which may be in plenty supply might not get removed.

    Just something to keep in mind.
    Ya its not really a problem, I mean the only thing that isnt avaiable to the rest are a couple spec op weapons that I gave to a specific team and I dont mind if they pick that kind of stuff up, I just dont want them to easily gain access to them.




    Quote:
    // OPTIONS FOR PLAYER'S DEAD BODIES AND EQUIPMENT - Additional revive functions with many thanks to alef (0 - off, 1 - on except for _bury_timeout)
    _drop_weapons = 1; //array no.93 - should the respawned player drop his weapons where he died?
    _cadaver = 1; //array no.94 - should the respawned player's body remain there?
    _bury_timeout = 120; //array no.95 - if drop weapons OR player body, how long before the body is buried?
    // 0=maximum (1200s) , n=seconds up to 1200s (hard coded)

    That is around line 165 in Norrin's Revive Script 'revive_init.sqf'. 1200 seconds is 20 minutes, but if that is truly not long enough, give this a whirl for your weapons deal:

    init.sqf

    Quote:
    // Default soldier loadout.
    BIS_EVO_pallammo = ["30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","3 0Rnd _556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x4 5_Stanag","30Rnd_556x45_Stanag","15Rnd_9x19_M9","1 5Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9"];// The players default load out
    BIS_EVO_pweapons = ["M16A2","M9","Binocular","NVGoggles","ItemGPS" ,"It emRadio","ItemMap","ItemWatch","ItemCompass"]; // The players default load out

    // Reset everyone's weapons since we're using generic classes.
    removeAllWeapons player;
    removeAllItems player;
    {player addMagazine _x;} forEach BIS_EVO_pallammo;
    {player addWeapon _x;} forEach BIS_EVO_pweapons;
    _primary = primaryWeapon player;
    if (_primary != "") then {
    player selectWeapon _primary;
    // Grenade launcher Fix
    _muzzles = getArray(configFile>>"cfgWeapons" >> _primary >> "muzzles");
    player selectWeapon (_muzzles select 0);
    };

    Then, in a new file...

    refill.sqf

    Quote:
    // Respawn with previous gear

    // Give back the weapons the player had when he died.

    removeAllWeapons player;

    {player addMagazine _x;} forEach BIS_EVO_pallammo;

    {player addWeapon _x;} forEach BIS_EVO_pweapons;

    _primary = primaryWeapon player;
    if (_primary != "") then {
    player selectWeapon _primary;
    // Grenade launcher Fix
    _muzzles = getArray(configFile>>"cfgWeapons" >> _primary >> "muzzles");
    player selectWeapon (_muzzles select 0);
    };

    You might have to tinker with this a bit. Anyway, with normal respawn you will respawn with the stock weapons for that specific soldier. That script in the init.sqf will change all player's initial loadout from stock to whatever you want it to be (M16A2 for this specifically). Then on death and respawn the refill.sqf should again remove all stock gear and replace it with whatever you died with.
    thanks this looks like what I need, so the init reset everyones weapons to the default of an m16, and then the refill gives people what they died with? Sorry seems kind of confusing to me that both are giving the player weapons, ill try it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •