BetterDeadThanZed

[SOLVED] Easy way to get classnames of items

27 posts in this topic

Is there an easy way to get all of the class names of items that a mod has? I know I can go into the game, open the infistar menu and get the classnames that way but is there an easier way to get all of them, preferably into a text file for easy reference when adding items to loot tables, etc?

*EDIT* This has been solved: 

 

Edited by BetterDeadThanZed
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement
6 hours ago, BetterDeadThanZed said:

Is there an easy way to get all of the class names of items that a mod has? I know I can go into the game, open the infistar menu and get the classnames that way but is there an easier way to get all of them, preferably into a text file for easy reference when adding items to loot tables, etc?

...and *still* cant search the 3den objects using classnames.  It's like no one at BIS has ever seen a modern app UI.  It's still 2002 in Prague.

  • Like 2

Share this post


Link to post
Share on other sites

Okay here's the script.

https://drive.google.com/open?id=0ByfqTLjco6LeZXBVeHNYYldEbmc

I don't have a .dll ready right now so outputting to .rpt should do for now.

Run the cfggen.sqf  in your server/local Mission File.

You can do this by adding it to the mission file in a folder called "custom". (mpmissions\Exile.Altis\custom\cfggen.sqf)

And running the script by adding:

[] execVM "Custom\cfggen.sqf";

To the start of your init.sqf  in your mission file's root.

Repack your mission file into a .pbo

Run your server/mission.

Wait a while for it to completely start up and finish printing and look in your .rpt

The start of the list should be indicated by:

"=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#="
"# Config Generator Starting...#"
"=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#="
"--- Printing list now: ---"

And end marked by:

"--- End of list. ---"

Look inside the script and there should be a variable you can change to fit the configFile you're looking for.

To filter out all the stuff you don't want (like filter it to only one mod) I suggest using Notepad ++ and its "Replace" functionality.

Edited by Woeful_Wolf
  • Like 4

Share this post


Link to post
Share on other sites

While that will work for placed units, it will not do for those not placed.

For placed units - just place unit on a blank map and give a name such as UP1, UP2, etc. (UP = Unit Piece).  Save mission then open up the mission.sqm  in a text editor and then search for the 'UP' names.  Using UP or some other 'weird' combo makes search a LOT easier - sorta like a 'key'.

 

For unplaced units, what I do is to un-PBO the files then using ARMA Tools, find and convert the 'config.bin' file and open the converted file with a text editor.  You'll then see the class name.

 

As an example, I took the EVW_v.099 pbo and unzipped it.

Then I took the sud_gw_air and unzipped it

Then I went into the su25 folder and converted the 'config.bin' file

Then I opened converted 'config.bin' file in NotePad++:

class CfgPatches
{
    class SUD_SU25
    {
        units[]=
        {
            "SUD_SU25"
        };
        weapons[]={};
        requiredVersion=0.1;
        requiredAddons[]=
        {
            "A3_Air_F"
        };
    };
};

 

Class name is SUD_SU25!

 

A little work, but it will get the names without having to place them on a map.

 

 

What I did for a lot of items, I just placed them on a map as listed in the first method, then saved, then opened mission in NotePad++.

 

Quick and simple.

 

:)

 

Share this post


Link to post
Share on other sites

i had opened a thread last week about getting weapons classnames and their magazines.

there were a couple examples, this 1 worked well for me for the weapons

Spoiler

=====================================================
to get weapons with classes run this in debug console
=====================================================
_allWeapons = [];
{
    _weapon = configName _x;
    _itemInformation = [_weapon] call BIS_fnc_itemType;
    switch (_itemInformation select 0) do
    {
        case ("Weapon"):
        {
            if ((_weapon find "Exile_") > -1) then
            {
                _allMags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines");
                _allWeapons pushBack [_weapon, _allMags];
            };
        };
    };
}
forEach ('(getNumber(_x >> ''scope'') isEqualTo 2) && {!(getText(_x >> ''picture'') isEqualTo '''')}' configClasses (configFile >> 'CfgWeapons'));

copyToClipboard str(_allWeapons);

 

All i had to do was change Exile_ to the other mod, so example for RHS weapons

I changed Exile_ to rhs_weap_ because i was able to see 1 classname and knew this is what the class started with.

A person could change this up a bit to also export classnames of

CfgVehicles, CfgAmmo, CfgMagazines, CfgWeapons, CfgGroups, CfgVehicleClasses, CfgFactionClasses etc

Share this post


Link to post
Share on other sites

Hello Zed,

#1 - You just open up any map in the editor.

#2 - Place the units down that you want to use or might use.

#3 - Give each unit a unique name (have to anyway - unique name that is) like QZ1, QZ2, QZ3, or BV1, BV2, BV3, etc.

#4 - Once done, save mission.

#5 - Then using some text editor, open the mission file.

#6 - Then search for the name you used, such as QZ or BV.  All units that you gave that name too will show in the search results.

#7 - Cut-n-paste class names from mission file into ???

#8 - Done!

:)

PS - Went back and re-read a tad better.  What I meant is for example, CUP has 25 tanks, you use one on your map.  That script (and my first method) will show only that one tank and not the other 24.  My second method will show all 25 if there is no list with this info already, which I do think exist for CUP and RHS stuff.

My first method does not require any server, script, any type of PBO's, no exec this or exec that, or anything to get class names.  The second method will get you all the names if a list does not already exist.

 

All three will work for ya! 

Six of one, half a dozen of the other!

;)

 

 

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.