How can I get class name from config file in a result?

ka3ant1p

Member
I know how to get value of some params from config file:
Like this:

_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
_array = getArray (configFile >> "cfgLoot" >> getText(_lootType));

But how can i get class name?
Tried this as test but got nothing:

_type = missionConfigFile >> "CfgVehicles" >> "z_hunter";
_agent = createAgent [_type, _originalPos, [], 10, "NONE"];
 
Just guessing here because lately I have felt like posting my 2 cents worth whether I actually KNOW something or not :confused:

Your z_hunter is a class in zeds.hpp

Code:
class z_hunter : zZombie_Base {
    displayName = $STR_ZNAME_HUNTER;
    zombieLoot = "hunter";
};

So add in the displayname parameter to the end of your query?
 
I have dayz Epoch and if I change comething in config file so players will have to download my version of some addon....
 
I am not saying change it. I am saying that when you put
_type = missionConfigFile >> "CfgVehicles" >> "z_hunter";

add >> displayname

I do a lot of scripting but really haven't fooled with this at all. I should probably have kept quiet as I am just guessing. how about putting in a log output to see exactly what is getting returned into _type ?
 
nevermind, already found how the way of getting class name,
Just had to use configName
It should look like this:

Code:
_type = configName (missionConfigFile >> CfgVehicles >> "z_hunter");
_agent = createAgent [_type, _position, [], _radius, _method];

But actually understood that will not solve my problem...

I am searching the way of how to create custom classes for CfgVehickles not making an additional addon.
But don't know how to call creating agent or vehickle from missionConfigFile isntead of basic ones.

I suppose that there is some file in somewhere which has a description of what to do when using createAgent function, something like getting values from the class indicated in the array (_type in our case).
It should get values of model, textures and so on because config file is only the description and can not create something itself.
 
I am not saying change it. I am saying that when you put
_type = missionConfigFile >> "CfgVehicles" >> "z_hunter";

add >> displayname

I do a lot of scripting but really haven't fooled with this at all. I should probably have kept quiet as I am just guessing. how about putting in a log output to see exactly what is getting returned into _type ?
Tried
Code:
_type = configName (missionConfigFile >> CfgVehicles >> "z_hunter");
_agent = createAgent [_type, _position, [], _radius, _method];
but it didn't work =(

How to rework the script so it will use displayname ?
 
I am running Epoch, I don't have param displayName in my zed classes, only in mother class - zZombie_Base
I understand that it will not help because it will do the same result as if I just write the zombie class name, but just want to know =)
 
Back
Top