Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am giving the player an instanced class of UTWeap_RocketLauncher in an instance of UTGame.

PlayerPawn.CreateInventory(class'FobikRocketLauncher',false); // Does not work
PlayerPawn.CreateInventory(class'FobikLinkGun',false); // Works

Even if I give the original class (eg. UTWeap_RocketLauncher) it does not actually show up. However if I do a "GiveWeapons" cheat, I get it just fine. It also works if I had code it into the map. - But UTWeap_LinkGun works fine either way.

Any ideas? It shows the default ammo amount, and the icon on the HUD.

share|improve this question
    
You might want to use UDK Forum for your question. –  iamcreasy Nov 26 '11 at 12:41
add comment

1 Answer 1

By the GiveWeapons cheat, I'm guessing you mean the AllWeapons cheat?

AllWeapons gives the player the UTGameContent.UTWeap_RocketLauncher_Content weapon, which is a subclass of UTGame.UTWeap_RocketLauncher that references all the rocket launcher art assets.

So, you'll need to either make FobikRocketLauncher "extend" UTWeap_RocketLauncher_Content or copy all the art asset references in UTWeap_RocketLauncher_Content into FobikRocketLauncher.

And the reason the Link Gun works is that it has no such subclass -- UTGame.UTWeap_LinkGun has all the link gun art asset references in it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.