Jump to content

Sgt. Dennenboom

Member
  • Content Count

    93
  • Joined

  • Last visited

  • Medals

Posts posted by Sgt. Dennenboom


  1. Some helicopter pilot and co-pilot slots don't have eject capabilities.

     

    Instead of using:

    _unit action ["eject",_vehicle];

    Use something that checks whether you're being booted from a heli:

    if (_vehicle isKindOf "helicopter") then {moveOut _unit;} else {_unit action ["eject",_vehicle];};

    It's also possible to check whether the pilot is able to eject using the config (beware, jets DLC ejection seats count as not able to eject here):

    getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "driverCanEject") == 0;

     

    • Like 1

  2. _greaterThan = {if (_randomNumber > 500) then {_case = 1};};

    Never actually runs this code, so _case = {}, which breaks the switch as you compare it with numbers.

     

    Your code fixed:

    _randomNumber = 1000;
    _randomNumber = floor random _randomNumber;
    _case = {};
    if (_randomNumber > 500) then {_case = 1};
    if (_randomNumber <= 500) then {_case = 2};
    _infoType = {};
    
    switch (_case) do {
    	case 1: 	{hint format ["%1",_case];}; 
    	case 2: 	{hint format ["%1",_case];}; 
    };
    sleep 5;
    hint "Script is Over";

    Though Lucullus' script is cleaner.

    • Thanks 1

  3. The error message says exactly what is wrong.

    class B_30mm_MP_Tracer_Green;
    class autocannon_30mm_CTWS: B_30mm_MP_Tracer_Green {};
    class B_30mm_APFSDS_Tracer_Red;
    class autocannon_30mm_CTWS: B_30mm_APFSDS_Tracer_Red {};

    You've got the "autocannon_30mm_CTWS" class defined twice. You'll need to define two versions of the 30mm_CTWS for the two parents.


  4. So your script in an infinite loop could look something like this:

    _distance = 6.5;
    
    while {true} do {
        if (count (nearestObjects [player,["House","Building"],_distance]) > 0) then {
            systemChat format ["%1 is inside",name player];
        };
        sleep 0.1;
    };
    
    

    There are also different ways of checking whether a player is inside a building. Killzone Kid made a nice and much more accurate check for whether the player is in a house on this wiki page: lineIntersectsSurfaces


  5. There is a nifty command to get all the objects being slingloaded by a vehicle: ropeAttachedObjects

     

    So in a trigger condition that detects you pickup up any kind of cargo:

    !isNull getSlingLoad heli1

    And in a trigger condition that detects you pickup up cargo1 object:

    cargo1 == getSlingLoad heli1

     

    You do want the enableRopeAttach to be put on the cargo object after it has been dropped where it needs to go, otherwise it can indeed by stolen again!

    So where you call your detach script add some extra stuff:

    heli1 setSlingLoad objNull; cargo1 allowRopeAttach false;

     

    • Thanks 1

  6. I'm not sure what you are trying to with the setVariable and toString stuff, it is not necesary if this is in a single script, and in your case doesn't work.

    I've simplified your script a bit. You should look into the forEach command in the wiki, it's very useful!

     

    _items = uniformItems player;
    player forceAddUniform "marpat1_CamoRS";
    {player addItemToUniform _x;} forEach _items;

     

    I'm not a modder though, so I do not know how to make equipping the uniform automatically give you the action...


  7. Does anybody have a fix for pylon weapons not being removed by setPylonLoadout when they are added to a non-expected turret?

     

    Pylon weapons in turrets which are not the main gunner cannot be gotten through the "weapons" command for manual removal.

     

    Pylon image can be gotten through vehicle config:

    getText (configFile >> "CfgVehicles" >> typeOf vehicle player >> "Components" >> "TransportPylonsComponent" >> "uiPicture")


  8. 7 hours ago, Grumpy Old Man said:

    Will this even work?

      ...

    _velInitial will always be the same, most likely [0,0,0] when the variable has been defined.

     

    The _velInitial variable is updated in the while loop so it doesn't need to be determined twice every iteration.

    I've copied BIS's function and improved it slightly, so all the variables are the same as theirs.

    • Like 1

  9. 4 hours ago, snoops_213 said:

    ... Noticed that if you launch then land and re launch, as soon as you attach to a cat you launch straight away...

     

    This happens because the plane's "bis_launchState" variable keeps its value 1 (successfull launch) after launch, which means that on the next attach it doesn't wait for the hold button action to actually set this variable to 1.

     

    This variable needs to be set to nil or -1 after either detach or launch.

×