[Pogamut-list] mapping bot
jakub.gemrot
pogamut-forum at artemis.ms.mff.cuni.cz
Wed Oct 1 07:34:35 CEST 2008
Re: mapping bot
Hi cazub!
Try it - if it fails then there is some problem with the PogamutCore
version or it's compilation
(but this should be for the version 1.1)
private NavPoint runTo = null;
protected void doLogic() {
log.warning("LOGIC ITERATION");
if (runTo == null) {
runTo = memory.getKnownNavPoints().get(random.nextInt(memory.getKnownNavPoints().size()));
log.info("Selected navpoint: " + runTo.UnrealID);
}
log.info("Searching path to: " + runTo.UnrealID);
switch (gameMap.pathManager.retrievePathGB(runTo.location)) {
case NO_PATH:
log.severe("Can't find path to navpoint: " + runTo.UnrealID);
runTo = null;
break;
case OBTAINING_PATH:
log.severe("Waiting for the path.");
break;
case PATH_FOUND:
log.info("Path found to: " + runTo.UnrealID);
switch(gameMap.pathManager.runAlongPath()) {
case PATH_BROKEN:
log.severe("PATH BROKEN");
runTo = null;
break;
case PATH_ENDED:
log.info("PATH ENDED");
runTo = null;
break;
case RUNNING_ALONG:
log.info("Continuing the movement to: " + runTo.UnrealID);
break;
}
}
}
This code should show you how exactly you have to work with retrievePathGB() it is the simplest bot that runs around random navigation points + using retrievePathGB().
Jakub
----
Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=247&comments_parentId=222&post_reply=1#form>
More information about the Pogamut-list
mailing list