[Pogamut-list] Death Location - HeatMap
grover999
pogamut-forum at artemis.ms.mff.cuni.cz
Sun May 10 21:25:13 CEST 2009
Re: Re: Death Location - HeatMap
Author: grover999
Hi dude,
I've just tried to check out this code and I have a problem... the code compiles fine for me in NetBeans 6.1, but when trying to run it, I get the following message in the dedicated server shell:
"We are in gained child 2, it is DM-Flux2.BotConnection
Lost Child DM-Flux2.BotConnection"
And the bot cannot get inside the game. Do you know why is it due to?
Thanks a lot beforehand.
> If you want to count the Frags of you agent here is code that should work:
>
> //prepare listener class and variable we will store frags in
> int frags = 0;
> RcvMsgListener myListener = new RcvMsgListener() {
>
> @Override
> public void receiveMessage(RcvMsgEvent e) {
>
> PlayerKilled pk;
>
> pk = (PlayerKilled) e.getMessage();
> if (pk.killerID == getMemory().getAgentID())
> {
> frags += 1;
> }
> }
> };
>
> //here we will register our listener for PLAYER KILLED messages
> @Override
> protected void postPrepareAgent(){
>
> this.getBody().addTypedRcvMsgListener(myListener, MessageType.PLAYER_KILLED);
> }
>
> If you want to know when your bot die, use BOT_DIED listener.
>
> best,
> michal
More information about the Pogamut-list
mailing list