Jump to content

Egosa-U

Member
  • Content Count

    175
  • Joined

  • Last visited

  • Medals

Posts posted by Egosa-U


  1. With OA there seems to be an error causing the unit to spawn with its standard loadout.

    I setup a CDF-medic with only a handgun and after respawn he got his whole equip back (AKS and everything else)

    In his init I got the postet eventhandler from here. The code in the weaponrespawn.sqf is the following (and worked prior to OA):

    while {true} do {
       waitUntil {!alive P1};
       _weapons = weapons P1;
       _magazines = magazines P1;
       waitUntil {alive P1};
       _p = P1;
       _p setVehicleVarName "P1";  
       removeAllItems _p;
       removeAllWeapons _p;
       {_p addMagazine _x} forEach _magazines;
       {_p addWeapon _x} forEach _weapons;
       _primw = primaryWeapon _p;
       if (_primw != "") then {
           _p selectWeapon _primw;
           // Fix for weapons with grenade launcher
           _muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
           _p selectWeapon (_muzzles select 0);
       };
    };

    In the *.rpt it says:

    Error in expression <til {!alive P1};_weapons = weapons P1;_magazines = magazines P1;w>

    Error position: <P1;_magazines = magazines P1;w>

    Error Missing ;

    Can anyone help me plz. I want the "you respawn with what you die with"-feature back;


  2. I think that should go along with Mr. Murrays Editing Bible. Because as soon as the code gets to complicated, People always want to copy'n paste stuff - It even starts when setting units in certain heights, until you get to know about that setpos-getpos-stuff...

    So wait until Mr. Murray got his next version Bible up and extend its usability with a work-along clip.

    greetz.

    Egosa-U


  3. Hi.

    I am trying to sort out how to use the lobby-parameters as a tool to ease up my coop-mission.

    I'd like to select between 2 options: Normal and easy-mode.

    In the normal-mode the players should only be able to choose between 3 non-scoped weapons and in the easy mode, some more weapons can be chosen.

    I tried to get this to work but cant figure out how to setup the weapons? How do i have to edit that part what I underlined in the following code:

    titleParam1 = "Difficulty:"; valuesParam1[] = {[u]0,1[/u]};
    defValueParam1 = 1;
    textsParam1[] = {"Easy", "Normal", };
    

    And please dont tell me, i should use two missionfiles - that would be the option I want least..

    Thnx in advance for any help.


  4. @CarlGustaffa: You're right. Of course you can synchronize more: Movements of groups, Transport & cargo...

    Imho jpinard's post did have some sort of "guard/sentry until an event occures which switches to move/attack".

    @jpinard: Set your vehicles waypoints like this

    1.) Sentry/Guard/etc.

    2.) Cycle

    3.) Movement-WPs

    4.) Use your trigger to ask about the condition of the specific unit that has to be destroyed (e.g. !alive specunit)

    5.) Set trigger-state to switch.

    6.) Sync trigger with 2.)

    After the death of the specunit, the vehicle doesnt cycle the previous waypoint(s) and jumps to 3.).


  5. Tried out the code in the weapon-respawn-script (Thanx to someone who posted this somewhere) - doesn't work (tested in MP)..

    Player-Name: P1

    Init Player:

    _xhandle = this addEventHandler ["killed", "_this execvm 'weaponRespawn1.sqf'"];

    weaponRespawn1.sqf:

    while {true} do {
       waitUntil {!alive P1};
       _weapons = weapons P1;
       _magazines = magazines P1;
      [b] _backpack = unitBackPack P1;[/b]
       waitUntil {alive P1};
       _p = P1;
       _p setVehicleVarName "P1";
      [b] if (unitBackpack _p != objNull) then {removeBackpack _p};[/b]
       removeAllItems _p;
       removeAllWeapons _p;
       {_p addMagazine _x} forEach _magazines;
       {_p addWeapon _x} forEach _weapons;
       [b]_p addBackPack _backpack;[/b]
       _primw = primaryWeapon _p;
       if (_primw != "") then {
           _p selectWeapon _primw;
           // Fix for weapons with grenade launcher
           _muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
           _p selectWeapon (_muzzles select 0);
       };
    };

    it does remove the backpack though.. either the code-part about getting the backpack-information is wrong or the equipping of the player is wrong...

    I think, re-equipping a backpack isn't possible. The code must be modified with weaponcargo and magazinecargo, but i'm still a noob in scripting. So if anyone can help out, i'd appreciate it..

    I think, that should work, but need the code for getting the cargo-list (purple code-part):

    while {true} do {
       waitUntil {!alive P1};
       _weapons = weapons P1;
       _magazines = magazines P1;
       //_backpack = unitBackPack P1;
     _magazinec = [color="Purple"]magazinecargo[/color] P1;
       _weaponc = [color="Purple"]weaponcargo[/color] P1;
       waitUntil {alive P1};
       _p = P1;
       _p setVehicleVarName "P1";
       //if (unitBackpack _p != objNull) then {removeBackpack _p};
       removeAllItems _p;
       removeAllWeapons _p;
       [color="Red"]clearweaponcargo _p;
       clearmagazinecargo _p;[/color]
       {_p addMagazine _x} forEach _magazines;
       {_p addWeapon _x} forEach _weapons;
       [color="Red"]{_p addMagazinecargo _x} forEach _magazinec;
       {_p addWeaponcargo _x} forEach _weaponc;[/color]
    //_p addBackPack _backpack;
       _primw = primaryWeapon _p;
       if (_primw != "") then {
           _p selectWeapon _primw;
           // Fix for weapons with grenade launcher
           _muzzles = getArray(configFile>>"cfgWeapons" >> _primw >> "muzzles");
           _p selectWeapon (_muzzles select 0);
       };
    };


  6. Anyone tested this one yet??

    Ran over the same issue when respawning with the weapons via script - the Rucksack stays the initial-loadout one...

    @BelgarionNL:

    You should call this code via script.

    Remove the _backpack variable and use the equivalent classname.

    if (unitBackpack player != objNull) then {removeBackpack player}; //Get rid of any default one

    player addBackPack _backpack;

×