Loading...
 

PogamutUT2004


Secondary shoots

Hi! I use this code:

------------------------
if (weaponry.getSecondaryWeaponAmmo(weaponry.getCurrentWeapon().getType()) > 0)
{
body.getShooting().shootSecondary(Enemy);
body.getShooting().shootSecondary(Enemy.getLocation());
System.out.println("Secundary shoot");
} else {
body.getShooting().shootPrimary(angerEnemy.getLocation());
System.out.println("Primary shoot");
}
---------------------------

It prints, "secondary shoot" but the bot doesn´t shoot the grenade (secondary ammo of the assault rifle)

How i can make the bot shoots secondary ammo?¿?¿

Thanks!
best regards!
This works similar to how human players shoot secondary ammo from assualt rifle. You need to press and hold right mouse button - assault rifle grenade starts charging and then release the button to fire the grenade.
So for the bot - you need to cal body.getShooting().shootSecondary(enemy); - this will start charging the grenade and afterwards you need to call stopShooting() to release and fire the grenade.
Alternatively you can use methods from AdvancedShooting module that supports these more complex shooting modes natively.

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.