[Pogamut-list] players.getNearestVisiblePlayer() throws null

Lukas1115 pogamut-forum at diana.ms.mff.cuni.cz
Sat Oct 29 15:22:59 CEST 2011


Re: players.getNearestVisiblePlayer() throws null

Author: Lukas1115

I already changed the code, but now  it's just throws one error, sometimes

Cause:    class java.lang.NullPointerException: null (at cz.cuni.amis.pogamut.ut2004.examples.hunterbot.HunterBot.logic(HunterBot.java:281))

code at line 281:

System.out.println("nearestItem(" + info.getNearestItem().getType().getName() + "," + info.getNearestItem().getNavPointId().getStringId()+ ").");

 i think probably  sometimes info.getNearestItem() throws null, i solve it with condotion

I have one more question:
I want to find out more about all bots (players), but only what I have is locations & weapon

                         .............
                        System.out.println("onPostition(" + tmap.get(k).getName() + "," + tmap.get(k).getLocation() + ").");
                        System.out.println("equippedWeapon(" + tmap.get(k).getName() + "," + tmap.get(k).getWeapon() + ")."); 
                         .............

I want to get  healt, or for example bot1 is shoting on bot2 etc., or isMoving(bot1,dm_flux2_pathNode_5).?? and more...

thx

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=849&post_reply=1#form>





More information about the Pogamut-list mailing list