Jump to content
Sign in to follow this  
Aniallator

Modding question: vehicle flags

Recommended Posts

I'm new to modding and would like to get into it, and was wondering... is anyone willing to explain or provide a link to somewhere that explains how to create and add a flag to a vehicle, as in the below image?

 

2016-02-03_00001.jpg

Share this post


Link to post
Share on other sites

I dont know about modding but you could use attachTo script command to attach the flag to the tank.

Share this post


Link to post
Share on other sites

Give people time to see and read the post.

 

I am doing some research into flags and may have something in the upcoming weeks.  There appears to be a way to do it but I'm not there yet.

  • Like 2

Share this post


Link to post
Share on other sites

Give people time to see and read the post.

 

I am doing some research into flags and may have something in the upcoming weeks.  There appears to be a way to do it but I'm not there yet.

 

Okay thanks, I appreciate it! If it's a hassle don't feel obligated.

Share this post


Link to post
Share on other sites
if !(isServer) exitWith {};
private ["_CheckedVehicles","_NewVehicles","_VehType_btr60","_VehType_btr70","_VehType_btr80","_VehType_m113"];
 
_VehType_btr60 = [
"rhsgref_ins_g_btr60",
"rhsgref_cdf_btr60",
"rhsgref_ins_btr60",
"rhs_btr60_msv",
"rhs_btr60_vdv",
"rhs_btr60_vv",
"rhsgref_cdf_b_btr60"
];
 
_VehType_btr70 = [
"rhsgref_ins_g_btr70",
"rhsgref_cdf_btr70",
"rhsgref_un_btr70",
"rhsgref_nat_btr70",
"rhs_btr70_msv",
"rhs_btr70_vv",
"rhs_btr70_vv",
"rhsgref_cdf_b_btr70",
"rhsgref_ins_btr70",
"rhs_btr70_vdv"
];
 
_VehType_btr80 = [
"rhs_btr80_msv",
"rhs_btr80a_msv",
"rhs_btr80_vdv",
"rhs_btr80a_vmf",
"rhs_btr80_vv",
"rhs_btr80a_vv"
];
 
_VehType_m113 = [
"rhsusf_m113d_usarmy_supply",
"rhsusf_m113d_usarmy",
"rhsusf_m113d_usarmy_M240",
"rhsusf_m113d_usarmy_medical",
"rhsusf_m113d_usarmy_MK19",
"rhsusf_m113d_usarmy_unarmed",
"rhsusf_m113_usarmy_supply",
"rhsusf_m113_usarmy",
"rhsusf_m113_usarmy_M240",
"rhsusf_m113_usarmy_medical",
"rhsusf_m113_usarmy_MK19",
"rhsusf_m113_usarmy_unarmed"
];
 
SQ_Veh_Remove_Flag = {
if (!isServer) exitWith {};
private ["_veh"];
 
_veh = _this select 0;
 
    if !(isNull _veh) then {
 
        { deleteVehicle _x; } count (nearestObjects [_veh, ["rhs_Flag_chdkz"], 3]);
    };
 
};
 
 
SQ_Attach_Veh_Flags = {
if !(isServer) exitWith {};
private ["_veh","_Flag","_flagtexture"];
 
_Veh = _this select 0;
 
_Veh addMPEventHandler ["MPKilled", {if (isServer) then {[_this select 0] spawn SQ_Veh_Remove_Flag}}];
 
_Flag = "rhs_Flag_chdkz" createVehicle [0,0,0];
 
 
_flagtexture = "";
 
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _Veh) >> "side") == 0) then { _flagtexture = "\rhsafrf\addons\rhs_main\data\Flag_rus_CO.paa"; };
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _Veh) >> "side") == 1) then { _flagtexture = "\A3\Data_F\Flags\Flag_us_CO.paa"; };
if (getNumber (configFile >> "CfgVehicles" >> (typeOf _Veh) >> "side") == 2) then { _flagtexture = "\rhsafrf\addons\rhs_c_cti_indep\flag_chdkz_co.paa"; };
 
                        if (_Veh in (nearestObjects [_Veh, _VehType_btr60, 3])) then {
 
                        _Flag attachTo [_Veh, [0.8,-2.5,1.3]];
 
                        };
 
                        if (_Veh in (nearestObjects [_Veh, _VehType_btr70, 3])) then {
 
                        _Flag attachTo [_Veh, [0.1,-3.5,1.4]];
 
                        };
 
                        if (_Veh in (nearestObjects [_Veh, _VehType_btr80, 3])) then {
 
                        _Flag attachTo [_Veh, [0.4,-4,2]];
 
                        };
 
                        if (_Veh in (nearestObjects [_Veh, _VehType_m113, 3])) then {
 
                        _Flag attachTo [_Veh, [1.7,-2,0.6]];
 
                        };
 
                        _Flag setVectorDirAndUp [[0,0.66,0.40],[0,0.40,0.66]];
 
                        _Flag setFlagTexture _flagtexture;
 
};
 
{[_x] call SQ_Attach_Veh_Flags;}foreach Vehicles;
 
    _CheckedVehicles = Vehicles;
    _NewVehicles = [];
 
    while{true}do {
 
        sleep 1;
        _NewVehicles = [];
        _NewVehicles = Vehicles - _CheckedVehicles;
 
        if(Count _NewVehicles > 0) then {
 
            {
                [_x] call SQ_Attach_Veh_Flags;
 
                _CheckedVehicles = _CheckedVehicles + [_x];
                uisleep 0.2;
            } foreach _NewVehicles;
        };
    };

C5044C0177F86DD1F94D3A29CF12B5D8ADBD672F

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×