Jump to content
Sign in to follow this  
Wildebeest

Add information box to custom weapon?

Recommended Posts

You know that little "i" box at the corner of a BIS weapon in the Gear tab in OFP that shows you information about the weapon... how can I add one of those to my gun? Can it be done or ist it hard-codedly impossible?

I want to be able to display information about my weapon and magazines.

Thanks

Share this post


Link to post
Share on other sites

Everyone says its impossible, but one year ago reflecting water was also impossible....

Share this post


Link to post
Share on other sites
Everyone says its impossible, but one year ago reflecting water was also impossible....

Who is telling, it's impossible?

Of course it's possible!

All you have to do is to edit the equipment*.html-files in the dtaext.pbo. Just look into them to see how BIS did it.

But there is one problem: You need to do a Mod-directory to have extra information for your weapons, so it doesn't work with addons PBOs.

Share this post


Link to post
Share on other sites

Sorry to dig this up, but would you mind showing an example of how its done, I can't get it to work?

STGN

Share this post


Link to post
Share on other sites
Who is telling, it's impossible?

Of course it's possible!

All you have to do is to edit the equipment*.html-files in the dtaext.pbo. Just look into them to see how BIS did it.

But there is one problem: You need to do a Mod-directory to have extra information for your weapons, so it doesn't work with addons PBOs.

Won't work. There's nothing indicating which weapons are all the info entries assigned to and there's not even any config entries defining it in CfgWeapons part of the weapons' config. Editing the html files and adding new entries won't do a thing. It must be a hard-coded thing, thus impossible to make for custom weapons.

Share this post


Link to post
Share on other sites
There's nothing indicating which weapons are all the info entries assigned to

And what about this?

<a name="EQ_carlgustavlauncher"></a>

It is EQ_ followed by the weapons class name. You can check this for all other entries: They all relate to a class in the config.

It is possible; I have no sample right now, but AFAIR the FFUR 85-mod had custom info.

Share this post


Link to post
Share on other sites

FFUR mod had the info by editing the existing info entries, overwriting them. Remember, FFUR mod replaces the vanilla weapons, keeping the original classnames. But totally new entries for new weapons are not possible. Believe me, I've tried. :( We discussed this same thing with Sanctuary not long time ago and came into conclusion that it's impossible.

But if you're really saying that it's possible, I'd love to see you give an example of it. Would help a lot of people here.

Share this post


Link to post
Share on other sites

If it is indeed possible, i would really like to hear the method to use.

Share this post


Link to post
Share on other sites

Ok, I just tested it, and this is how it worked for me:

In dtaext/equip/w I copied w_carlgustavlauncher.paa and renamed it to w_testweapon.paa.

I opened equipment.html and added the following before the carl gustav entry:

<! Test Weapon – – – – – – – – – – – – – – – – – – – – – – – – – – – –>
<h1 align="center"><a name="EQ_testweapon"></a>Test Weapon</h1>
<h2 align="center"><a name="EQ_testweapon"></a>Anti-tank weapon</h2>
<br><p align="center"><img src="@equip\w\w_testweapon.paa" width="140" height="70"></p>
<br>
<h4>This is a test weapon.</h4>
<h4> 
<br><a href="#testweapon_page2">Parameters</a></h4>

<address>
<a href="#equipment"><img src="sipka_left.paa" border="0" width="20" height="20"></a> 
</address>
<hr>

<!– – – – – – – – – – – –>
<h1 align="center">Test Weapon</h1>
<h2 align="center"><a name="testweapon_page2"></a>Parameters</h2>
<br><h3 align="center"><img src="@equip\w\w_testweapon.paa" width="140" height="70"></h3>
<h4> 
<br>
<b>Length:</b> 2 m
<br><b>Weight:</b> 15.6 kg
<br><b>Mount:</b> 0.4 kg



</h4>

<address>
<a href="#EQ_testweapon"><img src="sipka_left.paa" border="0" width="20" height="20"></a> 
</address>
<hr>

Then I opened the main config.cpp (in this case WW4Mod1 config.cpp) and added the following class (I copied and edited CarlGustavLauncher):

class TestWeapon:LAWLauncher
	{
	magazineType="6 * 		256";
	model="carlgustav84_proxy";
	modelOptics="optika_CarlGustav";
	canLock=1;
	valueWeapon=20;
	valueMagazine=10;
	ammo="CarlGustav";
	displayName="Test Weapon";
	displayNameMagazine="Test Weapon Rocket";
	shortNameMagazine="Test Weapon Rkt.";
	uiPicture="isat";
	};

Then go into Editor, take some soldier:

this addWeapon "TestWeapon"

Then check the fully functional info entry.

If I should guess why it doesn't work for you guys: It probably works only for weapons that are defined in the main config.

Share this post


Link to post
Share on other sites

Well I'll be damned. :) It works. I wouldn't have guessed that it would work from the main config. That's pretty unfortunate though, because it still wouldn't work with addOns like STGN's, but this could be useful in total conversion mods with their own main config.

Share this post


Link to post
Share on other sites
If I should guess why it doesn't work for you guys: It probably works only for weapons that are defined in the main config.

Must be that, as the BIS addon weapons (the ones not defined in the main config) have no description too, i tried so many things for my bunch of weapons without any description appearing ingame.

Very unfortunate.

Share this post


Link to post
Share on other sites

Yes, but you now can include a dtaext pbo file in the dta folder of your mod, can't you ?

Share this post


Link to post
Share on other sites

But that will not work, we tried, the problem is that to use the info boxes, every weapons must be defined in the main config.cpp/config.bin.

config inside an addon will not "link" to the dtaext.pbo unfortunately.

Share this post


Link to post
Share on other sites

What's wrong with defining them in the main config? Let's say like that:

class CustomGun : InheritsSomeWeapon {};

If weapon info requires any class properties then add them here and voila.

Edited by Faguss

Share this post


Link to post
Share on other sites

Nothing wrong with it.

You could give people the option of having the standalone addons,or a mod folder with an edited main config and DTAext.Whether or not it's worth it for 1 or two PBOs would be the question.

But the addons could still be used outside the mod folder.Unless I've missed something. :)

Share this post


Link to post
Share on other sites

Will test around this, i wonder if it is possible without leading into some unsuspected problems to have a weapon/ammo class both defined the same in the main config and in the addons folder in the same time.

As i want the troopers and so the weapons they use from my mod to be usable in other mod folders if some people do not want to use the new animations but only the troops/weapons, if this creates some problems i will not bother too much.

Share this post


Link to post
Share on other sites
Will test around this, i wonder if it is possible without leading into some unsuspected problems to have a weapon/ammo class both defined the same in the main config and in the addons folder in the same time.

As i want the troopers and so the weapons they use from my mod to be usable in other mod folders if some people do not want to use the new animations but only the troops/weapons, if this creates some problems i will not bother too much.

I think what Faguss meant, is that you don't define but only declare the weapon classes. So the full classes are only in the addon PBO. Perhaps you have to play around with access-property (AFAIR there are four possible values: READ_WRITE, READ_CREATE, READ_ONLY and READ_ONLY_VERIFIED; those are of course defines, so you should look the values of those defines up).

So you would want READ_WRITE or READ_CREATE as the access-property in the main-config for your weapon classes, and READ_ONLY in your addon PBO.

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
Sign in to follow this  

×