Jump to content

- - - - -

Solved: Weapon information pages for ADDON Weapons

  • Please log in to reply
4 replies to this topic

#1 *Zeewolf*



  • Members
  • 184 posts

Posted 31 March 2012 - 01:37 PM

I have just been trying to figure out how to make the game provide an "i" information button for any weapon. Based on this thread this is an unsolved problem for weapons being defined in addon .pbos. So I thought I'd share.

The key is to never use the picture attribute in any weapon or magazine class. The default picture="" is what is used by all of the original non-resistance BIS weapons. This is what causes the game to search DTAEXT.pbo for an entry and (if it finds a matching picture in dtaext\equip\w) and description in dtaext\equipment.html display an "i" icon in gear.

This does mean that a dtaext.pbo has to be provided with the addon containing weapon, magazine pictures and equipment html entries for every CfgWeapons class in the addon that requires an "i" icon.

So as a quick example if I wanted to convert for example an addon weapon class called AN94 which uses the magazine AN94mag to provide an "i" icon:

1. Remove any "picture" attributes from the classes an94, an94mag, make sure that none of the parent/grandparent classes override the picture attribute to anything other than "" (ideally this should only be defined in CfgWeapons.Default).

2. Depbo Dtaext and add html entries for each class to equipment.html (just copy any other weapon's entry) change the EQ_ fields in the address to EQ_an94 and EQ_an94mag respectively. Change the _page2 addresses to unique values.

3. Create a picture for the weapon in dtaext\equip\w with the file name w_an94.paa, create one in dtaext\equip\m\ with the name m_an94mag.paa.

4. Repbo Dtaext and check out your new weapon information in game.

5. Feel free to customise the equipment.html entry once you've got a working "i" icon in gear for that weapon. For example I'm going to change my parameters pages to display a screenshot of the modeloptics used by each weapon to give people a better feel for what they're selecting when choosing weapons in a mission briefing (this will probably require me to add the screenshots to dtaext so equipment.html can access it).

Once again it isn't important which .cpp the weapon is defined in (whether it be in the main config or an addon) the critical thing is not to override the picture attribute so the game accesses dtaext for equip\w_classname.paa. The same should be true for magazines which require a picture entry in dtaext\equip\m\.

Obviously for small single weapon releases, forcing the user to replace their dtaext is impractical but for larger weapon collections, total conversions and mods it is well worth authors considering putting all their inventory pictures in a custom dtaext.pbo rather than an addon pbo.

Edited by *Zeewolf*, 31 March 2012 - 05:49 PM.

#2 Icarus


    Staff Sergeant

  • Members
  • 266 posts

Posted 31 March 2012 - 04:45 PM


Now that is just amazing!
Good work, I hope every mod creator sees this. :)


#3 *Zeewolf*



  • Members
  • 184 posts

Posted 18 April 2012 - 06:59 PM

More useful information...

Rather than using picture="" which causes the game to search DTAExt.pbo for equip\w\w_classname.paa or equip\m\m_classname.paa (so it's effectively picture = this) you can also get the i icon to display by entering a different classname.

E.g. picture = "AN94";

Would cause the game to search for equip\w\w_an94.paa or equip\m\m_an94.paa and the EQUIP_AN94 entry in dtaext\equipment.html regardless of the name of the class. This allows you to use the same custom equipment entry for multiple weapon classes.

#4 DanAK47


    Staff Sergeant

  • Members
  • 398 posts

Posted 19 April 2012 - 07:04 AM

Does this mean the engine will properly assign magazine pictures?

#5 *Zeewolf*



  • Members
  • 184 posts

Posted 19 April 2012 - 05:05 PM


If the class has scopeMagazine = 2 (public) and is instantiated by addmagazine, addmagazinecargo or by the Magazines class of description.ext, then it is added to the unit as a magazine and the game will search dtaext\equip\m for the image m_x.paa, where x is either the provided string (picture="x") or the magazine's class name (picture = ""). You have the option of using the weapon's gear description or creating a separate one in equipment.html.

The same is true of weapons, a cfgWeapons class instantiated in a mission using addweapon, addweaponcargo or in the Weapons class of description.ext is assumed to be listed in dtaext\equip\w as w_x.paa, using the same method. If the image is missing from your dtaext.pbo you should see an error prompt showing the path of the image the game was looking for.