Fastfood4Bigfoot 0 Posted January 1, 2019 Hi, I'm currently trying to get the "Role Description" attribute of a vehicle. Would like to get this value for a script, but as one of the comments on https://community.bistudio.com/wiki/roleDescription says: "roleDescription works for playableUnits only. [...]" Using it on a vehicle return an empty string. Is there any way to optain this value? Thx! Share this post Link to post Share on other sites
HazJ 1288 Posted January 1, 2019 I think you mean displayName? getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName") Adjust accordingly. getText (configFile >> "CfgVehicles" >> "C_SUV_01_F" >> "displayName") // Returns: SUV Share this post Link to post Share on other sites
killzone_kid 1326 Posted January 1, 2019 15 minutes ago, Fastfood4Bigfoot said: Hi, I'm currently trying to get the "Role Description" attribute of a vehicle. Would like to get this value for a script, but as one of the comments on https://community.bistudio.com/wiki/roleDescription says: "roleDescription works for playableUnits only. [...]" Using it on a vehicle return an empty string. Is there any way to optain this value? Thx! Role description is what you see on role selection screen when you select what unit you want to be, since you cannot be a vehicle then you cannot have role description for a vehicle. You obviously want something different but not telling what, but looking in the wrong direction Share this post Link to post Share on other sites
Fastfood4Bigfoot 0 Posted January 1, 2019 16 minutes ago, HazJ said: I think you mean displayName? getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName") Adjust accordingly. Don't think that's what I'm looking for. Rightclick on a quad bike for example. "Attributes..." > "Object: Control" > "Role Description". It's explained in hover overlay as "Multiplayer role description visible in the multiplayer lobby. When undefined, the object type name will be used by default." Because https://community.bistudio.com/wiki/roleDescription says "Returns unit description set in Editor and visible on role selection screen in MP. Works in MP and SP.", I hoped to be able to access the value in any game mode from a script. The value can be set in editor also for unplayable objects like vehicles. Any idea what I could instead use to determine an assigned vehicle class? I want to be able to define to which class a vehicle belongs to react with a script function. Until now I use if (vehicleVarName _x find "loadoutMG" >= 0) then {...} but wanted to avoid using the variable name field to store that info. Maybe some custom variable in the Init text field? Share this post Link to post Share on other sites
HazJ 1288 Posted January 1, 2019 Huh??? What are you trying to do? "assigned vehicle class" ??? Please specify more details. No point in me guessing. Share this post Link to post Share on other sites
killzone_kid 1326 Posted January 1, 2019 You can always set a variable on the vehicle this setVariable ["vehiclerole", "garbage truck"]; and check it in a script. if ( _vehicle getVariable "vehiclerole" == "garbage truck" ) then { hint "it's a garbage truck!"}; 1 Share this post Link to post Share on other sites
Fastfood4Bigfoot 0 Posted January 7, 2019 Thx killzone_kid, that's exactly what I was looking for, had problems with the scope. I was working on loadout script to initialize vehicles. To use it, create a Init.sqf: // Quadbike, all variants { if (_x getVariable "replaceLoadout" == "true") then { clearBackpackCargoGlobal _x; clearMagazineCargoGlobal _x; clearItemCargoGlobal _x; clearWeaponCargoGlobal _x; }; if (_x getVariable "vehicleRole" == "loadoutAT") then { _x addItemCargoGlobal ["FirstAidKit", 2]; _x addItemCargoGlobal ["launch_NLAW_F", 1]; // PCML launcher _x addItemCargoGlobal ["NLAW_F", 6]; // PCML missile }; if (_x getVariable "vehicleRole" == "loadoutMG") then { _x addItemCargoGlobal ["FirstAidKit", 4]; // First Aid Kit _x addItemCargoGlobal ["MMG_02_sand_F", 1]; // SPMG (Sand) _x addItemCargoGlobal ["optic_DMS", 1]; // DMS scope _x addItemCargoGlobal ["muzzle_snds_338_sand", 1]; // Silencer .338 (Sand) _x addItemCargoGlobal ["acc_pointer_IR", 1]; // Laser pointer _x addItemCargoGlobal ["optic_Hamr", 1]; // RCO scope _x addItemCargoGlobal ["130Rnd_338_Mag", 3]; // SPMG mag }; //... } forEach nearestObjects [[worldSize / 2, worldsize / 2, 0], ["B_Quadbike_01_F", "B_G_Quadbike_01_F", "B_T_Quadbike_01_F"], 1000000]; // Prowler, all variants { if (_x getVariable "replaceLoadout" == "true") then { clearBackpackCargoGlobal _x; clearMagazineCargoGlobal _x; clearItemCargoGlobal _x; clearWeaponCargoGlobal _x; }; if (_x getVariable "vehicleRole" == "loadoutAT") then { _x addItemCargoGlobal ["launch_NLAW_F", 2]; // PCML launcher _x addItemCargoGlobal ["NLAW_F", 4]; // PCML missile }; //... } forEach nearestObjects [[worldSize / 2, worldsize / 2, 0], ["B_T_LSV_01_armed_F", "B_T_LSV_01_AT_F", "B_T_LSV_01_armed_CTRG_F", "B_T_LSV_01_unarmed_F", "B_T_LSV_01_unarmed_CTRG_F", "B_LSV_01_armed_F", "B_LSV_01_AT_F", "B_LSV_01_unarmed_F", "B_CTRG_LSV_01_light_F", "B_LSV_01_armed_black_F", "B_LSV_01_armed_olive_F", "B_LSV_01_armed_sand_F", "B_LSV_01_unarmed_black_F", "B_LSV_01_unarmed_olive_F", "B_LSV_01_unarmed_sand_F", "B_T_LSV_01_armed_black_F", "B_T_LSV_01_armed_olive_F", "B_T_LSV_01_armed_sand_F", "B_T_LSV_01_unarmed_black_F", "B_T_LSV_01_unarmed_olive_F", "B_T_LSV_01_unarmed_sand_F"], 1000000]; Afterwards you can add e.g. this setVariable ["vehicleRole", "loadoutAT"]; this setVariable ["replaceLoadout", "false"]; to the Init textbox of a vehicle and the choosen loadout gets applied (instead or on top of the default inventory). Still thinking about how to use this for Zeus mode. Best would be an event handler which opens a GUI dialog box (with a combo where you can select one of the predefined loadouts) as soon as you spawn a vehicle. Better ideas? I'm just a complete beginner regarding scripting in Arma. Share this post Link to post Share on other sites