Loading...
 

General


Noise and pickup Listeners

Hi!

I'm playing with some listeners like Noise and pickup object listeners and i have a problem.

IWorldEventListener botHearNoiseListener = new IWorldEventListener() {

@Override
public void notify(HearNoise event) {
//escoltar si hi ha soroll pel voltant, d'on ve, com ha sigut produit...
body.getCommunication().sendGlobalTextMessage("Noise source: " + event.getSource().toString());
body.getCommunication().sendGlobalTextMessage("Noise type: " + event.getType());
body.getCommunication().sendGlobalTextMessage("Noise rotation: " + event.getRotation().
body.getCommunication().sendGlobalTextMessage("Noise distance: " + event.getDistance());
}
};

the 2 last code lines (rotation and distance) doesn't work until the bot dies. if i shoot him with the shootgun he dies and i can see the rotation and distance but if i shoot near the bot the rotation is 0.0, 0.0, 0.0 and the distance is 0.

Does anyone know why this happens?
By the way, i initialize them in prepare bot:
public void prepareBot(UT2004Bot bot) {
getWorldView().addEventListener(HearNoise.class, botHearNoiseListener);
}
You mean that event.getRotation() and event.getDistance() are not always filled?

Did I understand that right?

Cheers!
Jimmy
Exactly! they are filled when the bot dies, when he is alive they are always empty

Thanks!

Joan Marc
Thanks xD

Regards, Joan Marc.
Fixed. Code in svn repository.
 

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.