Jump to content
Sign in to follow this  
Muffin Man

Problem getting magazine pic to show

Recommended Posts

Okay, I've got my new weapon to work, the model looks pretty good for a first attempt and it's doing largely what I want it to ingame, but I can't get my pic for the magazine to appear. I just get a smaller version of the primary weapon pic as the magazine pic. I can see what others have done to accomplish that, but when I copy what they have done it doesn't work. The only way I see to make it work is to do something like this (I use "weaponname" to indicate whatever mod name for an example. That's not what's actually entered there in the mods)

Quote[/b] ]class weaponnameMag: weaponnameBase {

scopeWeapon=0;

scopeMagazine=2;

picture="\weaponname\magpic.paa";

};

Now, I have copied that script and added my own wepaon name in the obvious neccessary spots, but the game tells me I have an undefined class base. Obviously the weaponnameBase is the undefined base, but I've searched the mods from which I copied this script from thouroughly and can find no mention of anything called weaponnameBase, other than in that bit of script, in any of them. Is it a reference to an LOD in the model? I've seen no evidence of that. Why does it work for others but not for me when I add my own weapon name in there?

I've kind of asked two questions in one here and hopefully I've articulated my issue enough that someone could enlighten me as to where I'm going wrong. I'm getting frustrated, after coming so far on my own, to get hung up on something so simple.

Thanks

Share this post


Link to post
Share on other sites

I am uncertain if i can be of help, i am pretty much a noob too, i can only make some guesses...

have you assign the correct magazine type for the soldier and weapon?

eg. magazines[]={"weaponnameMag"}

as for undefined, have you copied the class inheritance correctly?

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

class default{};

class MGun: default{};

class Riffle: MGun{};

class weaponnameBase: Riffle{};

class weaponnameMag: weaponnameBase {

scopeWeapon=0;

scopeMagazine=2;

picture="\weaponname\magpic.paa";

};

*assuming weaponnameBase is derived from Riffle, shoulc not be copied

the engine need to be able to work it way up the inheritance to "default" in order to work. this includes any custom and ingame classes in between.

Share this post


Link to post
Share on other sites

Hey, I appreciate you taking a shot at the issue. I do have the correct Magazine type. It loads and the gun fires correctly. In-game, it all works perfectly.

The first thing I did was to take a cpp file I knew worked, and which did similar to what I wanted my weapon to do, and then tried to just swap info, and eleiminate unnecessary info, insofar as I could decipher, with my tiny amount of experience, what was truely needed vs un-needed. Gradually I figured out what wasn't going to work and why and in the end I just ended up creating mine largely from scratch. Using tutorials (there aren't that many out there anymore) and some help tool downloads. I did still follow that original as a guide though.

There are two issues here really, but they tie together. The first was that whole base thing. I tried to take an existing inheritance chain from a mod (we'll use a Kegety cpp for an example because that's what I'm looking at right now)

He has

Quote[/b] ]class Default {};

class MGun: Default {};

class Riffle: MGun {};

class KEGak103Base: Riffle {

The chain is obvious, however, where does KEGak103Base factor in? I can't find a model or file that correlates to that base class, so I assume he pulled that name out of thin air. If I were to replace KEGak103 with my own weapon and call it myweaponbase, the game tells me I have an undefined base class. If I dump the word base and just call it myweapon however, it works fine.

That's all well and good, as far as getting the weapon to work in-game, but it still leaves me with the whole inventory pic issue. Studying Kegety's again, he has this entry:

Quote[/b] ] class KEGak103: KEGak103Base {

scopeWeapon=2;

scopeMagazine=0;

picture="\KEGak103\gear1.paa";

};

class KEGak103Mag: KEGak103Base {

scopeWeapon=0;

scopeMagazine=2;

picture="\KEGak103\gear2.paa";

};

You can see where his inventory pics are referenced and once again he references KEGak103Base. If I duplicate that info with my model it again tells me that I have an undefined base class. I'd love to know how to define KEGak103Base so that I can, in turn, define my own weaponbase and then I could make this go away:

inv.jpg

Basically, it's okay for everyone else to tack Base at the end of their weapon name and get it to work, but if I do, the game red flags me.

For comparrison, here's the inheritance chain from my weapon.

Quote[/b] ]class Default {};

class MGun: Default {};

class Riffle: MGun {};

class XMS : Riffle {};

class SniperRiffle:XMS{};

class Beowulf: SniperRiffle

Works fine, but if I call it BeowulfBase, it doesn't like it. Frustrating. crazy_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  

×