Loading...
 

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
 

News

News RSS RSS feed for News link



Pogamut

Quarterly RSS RSS feed for quarterly reports

Acknowledgement

This work is supported by GA UK 1053/2007/A-INF/MFF (2007-8), GA UK 351/2006/A-INF/MFF (2006-8), the Ministry of Education of the Czech Republic (grant MSM0021620838) (2008-9), by the Program "Information Society" under project 1ET100300517 (2006-9), and the project Integration of IT Tools into Education of Humanities (2006-8) and by the project CZ.2.17/3.1.00/31162, which are financed by the European Social Fund, the state budget of the Czech Republic, and by the budget of Municipal House Prague.