Jump to content
Sign in to follow this  
hairydavey

How to find out weapon/magazine classnames

Recommended Posts

Hi,

Apologies if this sounds like a daft question but............

I'm pretty up to speed with downloading weapon packs and using the initialization field to bring up weapons and load said unit with magazines using the removeallweapons this; etc,etc, but I've downloaded a few packs that don't state the weapon or magazine classnames in the readme and the weapons only seem to be useable with a specific unit for example;

I could download a mod, a specific unit could be armed with an M60E4, but nothing in readme for finding out how to implement said weapon into the initialization field for another unit.

Is there any way to find out where the classnames are, if they can be found at all?

Sorry if it sounds slightly obscure, hoping someone gets the jist of it!

smile_o.gif

Cheers!

Share this post


Link to post
Share on other sites

wrong forum (i think?) but at any rate you've probably got two options:

1. Contact the author, inform him that he's an idiot for not adding such information to the read me and then ask him nicely for the classnames.

2. Download one of the pbo tools available from such news sites as www.armedassault.info and unpack the addon pbo. Inside there will be a text file named config.cpp and in there you'll be able to find out the classnames. It will be near the top in a set of brackets named weapons, e.g. weapons : {weaponname1, weaponname2, etc};

Share this post


Link to post
Share on other sites

Oops! Sorry if I posted in the wrong place, new to here and it seemed at first glance the place to post as the mod discussion isn't for these kind of questions.

Thanks for the info about the .pbo tools, I will be sure to check that out! smile_o.gif

Share this post


Link to post
Share on other sites

Also, from in-game you can simply write this in the unit's init field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hint format ["Weapons: %1", weapons this];

And you'll get a nice hint à la

Weapons: "M16A4", "M9", "NightVisionGoggles", "Binocular", "M136Launcher"

And so on. smile_o.gif So just harvest the weapon names from there. Same can be done with magazines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hint format ["Mags: %1", magazines this];

G'luck!

Regards,

Wolfrug

Share this post


Link to post
Share on other sites
Also, from in-game you can simply write this in the unit's init field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hint format ["Weapons: %1", weapons this];

And you'll get a nice hint à la

Weapons: "M16A4", "M9", "NightVisionGoggles", "Binocular", "M136Launcher"

And so on. smile_o.gif So just harvest the weapon names from there. Same can be done with magazines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hint format ["Mags: %1", magazines this];

G'luck!

Regards,

Wolfrug

ah yes, good way of doing it... yours is a far more refined and easy way of doing it, but I do prefer my 'rip it apart and see whats going on' method biggrin_o.gif

Share this post


Link to post
Share on other sites

Many thanks to the both of you, and that code works an absolute treat!

Cheers guys, does exactly what I need. biggrin_o.gif

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  

×