Forum: PogamutUT2004

Opponent Weapon Info

The Player class has a method called getWeapon() which just returns a String.

I would like to be able to find out more about an opponent's weapon than its name. Basically, I want access to a lot of the methods in WeaponDescriptor. Now, I know that I should not be able to access an opponent's ammo, but I should be able to tell whether their weapon has splash damage, or is flaming, simply by knowing its name.

How do I use a String returned by getWeapon() to get this info?
Hi!

This is not implemented yet, but its a good suggestion.

What you need to do now is to parse the string to get the weapon type. String obtained by getWeapon() is unique weapon id, however if the weapon will be a flak cannon, substring "FlakCannon" can be found in this id, for rocket launcher "RocketLauncher" etc. When you have the item type you should be able to obtain additional info etiher from ItemCategory messages or maybe from the Weapon module (not sure about this).

Best,
Michal