Jump to content
Elite IV

Did B.I Developers change anything in "CfgWeapons" ??

Recommended Posts

Hello everyone,

 

I was just wondering if anyone knew if the developers changed anything in CfgWeapons.

 

(isArray (configFile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems"))

This returns false in the debug console, I swear it never returned false before? 

 

 

This still returns true so I'm glad that's okay but can anyone tell me if anything has changed in the CfgWeapons? 

(isClass (configFile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo"))

I'm still learning too so any help or pointers will be very appreciative. 

 

Here is the reason why i need isArray to return true:

as you can see the condition is that the code will proceed if "CfgWeapons >> THE WEAPON >> "WeaponSlotsInfo" >> SLOT >> "compatibleItems" returns true but because when i debug console this - It always returns empty array and false. Hench I cannot get the data I need.

A temporary fix i did was use the "BIS_fnc_compatibleItems" and stored those returned results into a local var then used later on and works but I want to get to the bottom of the actual issue i am faced with.

if (isArray (configFile >> "CfgWeapons" >> _item >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems")) then {
                        _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_item,"WeaponSlotsInfo","CowsSlot","compatibleItems");
                        {
                            _itemArray pushBack _x;
                        } forEach _slotArray;
                    };

so "isArray" is always going to return false now because when i went into the debug console and used "getArray" it always returned empty "[]" 😞

 

I tried:

hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems"));

hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"));

hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems"));

They all return empty now. What's changed?

 

I've had a look here and can't seem to see anything: 
CfgWeapons Config Reference - Bohemia Interactive Community (bistudio.com)

 

 

I did see this note in the website link just above saying this:

 

Quote

// class names with items supported by weapon compatibleItems[] = {}; // moved to each weapon

 

Moved to each weapon? So how will i pull the information I need now? What do i do to get that information from the weapon?

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

Depending on what your primary weapon is...

 

 

It was a MX series gun, It was equipped on the player when I was using the debug console.

 

Also when I do:

 

(primaryWeapon player) BIS_fnc_compatibleItems
  

I get the list of array of compatible items for weapon.

 

So far I am just using that command as a fix but I would like to maintain Tonic's code as there was nothing wrong with it until recently.

 

You go into debug console and type in:

hint str (getArray (configfile >> "CfgWeapons" >> (primaryWeapon player) >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems"));

with any weapon you choose and it will always return empty and if you try to use it as a condition with "isArray" - it will always return false as if there isn't an array that exists when compatibleItems function is called.

Share this post


Link to post
Share on other sites
3 hours ago, opusfmspol said:

You can view in Config Viewer to see what classes and values are present.

 

Thank you, I'll actually take a look at this after work.

  • Like 1

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

×