Jump to content
  • 0

Mod Classnames?


ElDubya

Question

8 answers to this question

Recommended Posts

  • 0

You can either open pbo and unrap bin files, look at classnames yourself or use sqf commands to extract stuff for you.

 

here's a code snippet from memory:

_cfg = (configFile >> "CfgVehicles");
for "_i" from 0 to (count _cfg) do {
	diag_log (getText (_cfg select _i >> "displayName"));
};

See what I did there? Now, I know that each vehicle has displayName string field, but I am not sure about the rest, this is where you'd have to dive into PBOs to find out defaults, then adjust code to fit the needs.

Link to comment
Share on other sites

  • 0

The code literary outputs every vehicle's display name in game to RPT each in a new line. Should work as is and can be adjusted to other needs you mentioned - skins, weapons etc.

For PBOs I recommend unRap by kegetys or eliteness when you get to .bin files to make them readable. The problem is that you will be opening a TON of pbos. Very slow and daunting process. Code does it for you in split second, then with some notepad++ macros you can compile nice list in under 10mins.

 

An example if you want classnames together with display names then adjust it like this:

diag_log format ["Vehicle: [%1] Classname: [%2]",getText(_cfg select _i >> "displayName"),_i];

getting the idea?

 

edit: as to - what to do with the code, you can literary paste it raw at bottom of your init.sqf on test server, boot it up and it will spit out all the stuff for you as soon as you load into mission. Just remove it when done.

Link to comment
Share on other sites

  • 0
12:32:03 "Vehicle: [] Classname: [any]"
12:32:03 Error in expression <"Vehicle: [%1] Classname: [%2]",getText(_cfg select _i >> "displayName"),_i];	>
12:32:03   Error position: <_cfg select _i >> "displayName"),_i];	>
12:32:03   Error Undefined variable in expression: _cfg
12:32:03 File mpmissions\DayZ_Epoch_21.Oring\init.sqf, line 100

Thanks very much for that little gem of code, but this is the error I get when I use it. I did as you said, and pasted it exactly as you have there at the very bottom of my init.sqf.

#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
	//Anti Zombie Bases
	execVM "custom\fixes\SafeArea.sqf";
	//Trader Safezones
	execVM "custom\fixes\TraderSafeZones.sqf";

diag_log format ["Vehicle: [%1] Classname: [%2]",getText(_cfg select _i >> "displayName"),_i];	 
Link to comment
Share on other sites

  • 0

Oh, you need the whole thing. Second part I gave you is a "replacement" or an "upgrade" to first code.. replace diag_log part with it (if you want) inside for loop. It was meant as another example of cool stuff you can do with configs.

As you can see error is telling undefined variable _cfg, you can find it in first snippet :)

 

so it would look like this:

_cfg = (configFile >> "CfgVehicles");
for "_i" from 0 to (count _cfg) do {
	diag_log format ["Vehicle: [%1] Classname: [%2]",getText(_cfg select _i >> "displayName"),_i]; //replaced part
};
Link to comment
Share on other sites

  • 0

Yeh it includes all buildings and pretty much everything else to do with props and objects. But there is no need to brew a coffee just yet. 

This is where you can start filtering stuff out. Let me give you a better example:

_cfg = (configFile >> "CfgVehicles");
_baseClass = "AIR"; //Land, staticWeapon, car, truck, tractor, tank, plane etc etc... see the link I gave you below

for "_i" from 0 to (count _cfg) -1 do {
	if (configName (_cfg select _i) isKindOf _baseClass) then {
		diag_log configName (_cfg select _i);
	};
};

Change _baseClass to fit your needs (this snippet will only work for cfgVehicles!!!).

 

You can find all structure of config right here (think of them as a folder structure if you will):

https://community.bistudio.com/wiki/ArmA_2:_CfgVehicles

 

coding is fun.

 

edit: i am pretty sure Oring team is using their own naming for vehicles... this is where peaking into PBO files is recommended. Find the main inheritance, add it to _baseclass and boom you just filtered vehicles unique to the mod.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...