1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ You might want to use UDK Forum for your question. \$\endgroup\$ – Quazi Irfan Nov 26 '11 at 12:41
2
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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