Jump to content

cybercoco

Member
  • Content Count

    176
  • Joined

  • Last visited

  • Medals

Posts posted by cybercoco


  1. I doesn't work because mhq is not the name of the vehicle. It's the name of "C_Offroad_01_F" createVehicle getMarkerPos "mk1";

     

    Set the vehicle name when it spawn. Not tested :

    mhq = "C_Offroad_01_F" createVehicle getMarkerPos "mk1";
    deploy = [[mhq,["Deploy MHQ",{execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;
    mhq SetVehicleVarName vehicle_name; // set the name
    
    marker1 = createMarker ["respawn_guerrila1", position mhq];
    marker1 setMarkerType "Empty";
    marker1 SetMarkerPos GetPos mhq;
    
    vehicle_name removeAction deploy;
    undeploy = [[mhq,["UnDeploy MHQ",{execVM "undeploymhq.sqf"} ]],"addAction",true] call BIS_fnc_MP; 
    

  2.  

    This doesn't work, because the if-condition has assignments ("="), but must have comparisons ("==").

     

    Corrected it ! ;)

     

    -EDIT-

    I didn't notice it at first but nice code there !

     

    if (1 == {
        if (1 == _vehicle getHit ("wheel_" + _x + "_steering")) exitWith {1};
    } count ["1_1", "1_2", "2_1", "2_2"]) then {
        hintSilent "Vehicle does not have all wheels anymore.";
    } else {
        hintSilent "Vehicle still has all wheels.";
    };

  3. This code lasts longer than expected. I would like a total duration of 20 sec (the duration of the animation played at the same time). How ?

    with uiNamespace do {
      my_awesome_progressBar = findDisplay 46 ctrlCreate ["RscProgress", -1];
      my_awesome_progressBar ctrlSetPosition [ 0.345, 0.3 ];
      my_awesome_progressBar progressSetPosition 0;
      my_awesome_progressBar ctrlCommit 0;
      my_awesome_progressBar ctrlSetTextColor [0.4,0.804,0,1];
    };
    
    _counter = 200;
    for "_i" from 0 to _counter do {
      (uiNamespace getVariable "my_awesome_progressBar") progressSetPosition (_i/_counter);
    
      //hintSilent format ["%1%2", _i * 100 /_counter, "%"];
        with uiNamespace do {
            x = safezoneX + 0 * safezoneW;
            y = safezoneY + 0 * safezoneH;
            w = safezoneW * 0.8;
            h = safezoneH * 0.8;
                my_awesome_text = findDisplay 46 ctrlCreate ["RscStructuredText", -1];
                my_awesome_text ctrlSetPosition [x,y,w,h];
                my_awesome_text ctrlCommit 0;
                my_awesome_text ctrlSetStructuredText parseText format["%1%2", round(_i * 100 /_counter), "%"];
        };
      sleep 0.1;
      ctrlDelete (uiNamespace getVariable "my_awesome_text");
    };
    
    ctrlDelete (uiNamespace getVariable "my_awesome_progressBar");
    
    
    

  4. I can't get the bar to be more fluid. Looks like the sleep command doesn't work bellow 1...

    with uiNamespace do {
        my_awesome_progressBar = findDisplay 46 ctrlCreate ["RscProgress", -1];
        my_awesome_progressBar ctrlSetPosition [ 0.345, 0.3 ];
        my_awesome_progressBar progressSetPosition 0;
        my_awesome_progressBar ctrlCommit 0;
        my_awesome_progressBar ctrlSetTextColor [0.4,0.804,0,1];
    };
    
    for "_i" from 1 to 20 do {
      (uiNamespace getVariable "my_awesome_progressBar") progressSetPosition (_i/20);
    
      hintsilent format ["%1%2", round(5*_i), "%"]; //debugg
      sleep 1; //interval
    };
    
    ctrlDelete (uiNamespace getVariable "my_awesome_progressBar");
    

    If I set _counter = 20*100 and sleep 0.01 it won't work.


  5. Is there any possibility to define if vehicle has all wheels or not
    _1 = _vehicle gethit "wheel_1_1_steering";
    _2 = _vehicle gethit "wheel_1_2_steering";
    _3 = _vehicle gethit "wheel_2_1_steering";
    _4 = _vehicle gethit "wheel_2_2_steering";
    
    
    if (_1 == 0 && _2 == 0 && _3 == 0 && _4 == 0)
         then {hint "Vehicle has lost all wheels"}
         else {hint "Vehicle has all wheels"};
    

    Each wheel has it's own damage level, going from 0 to 1, like all other vehicle parts.


  6. The config.cpp was missing CfgPatches because while I was trying without it it didn't work.

    Final code :

    class CfgPatches
    {
        class testinggear
        {
            units[] = {"testinggear"};
            weapons[] = {};
            requiredVersion = 1.0;
        };
    };
    
    class cfgMagazines
    {
        class CA_Magazine;
        class sc_bandage: CA_Magazine
        {
    		displayName = "Bandage";
    		count = 1;
    		class ItemInfo
            	{
                		mass = 1;
            	}; 
    		picture = "\testinggear\images\bandage.paa";
    		model="\A3\structures_f_epa\Items\medical\antibiotic_F";
    		descriptionShort = "Hey Wonno";
    	};
    };
    

  7. It's all strange...

     

    I took some files from a different mod, and it works. This is config.cpp

    class CfgPatches
    {
    	class scorch_invitems
    	{
    		units[] = {"scorch_invitems"};
    		weapons[] = {};
    		requiredVersion = 1.0;
    	};
    };
    
    class CfgWeapons
    {
    	class ItemWatch;
    	class sc_bandage: ItemWatch
    	{
    		displayName = "Bandage";
    		count = 1;
    		class ItemInfo
            	{
                		mass = 1;
            	}; 
    		picture = "\scorch_invitems\images\bandage.paa";
    		model="\A3\structures_f_epa\Items\medical\antibiotic_F";
    		descriptionShort = "";
    	};
    

    However the author has set it to the "ItemWatch", I need it to be a inventory item, like the FAK.

    Do I change "ItemWatch" with "FirstAidKit" ?

×