[Pogamut-list] mapping bot

Jakub Gemrot jakub.gemrot at gmail.com
Thu Sep 11 09:50:38 CEST 2008


Sorry, I was little too brief...

if(pathFound.equals("PATH_FOUND")) is checking whether the result is
equal to String instance "PATH_FOUND",
but you should rather use PathManager.PathResult.PATH_FOUND like:

if (gameMap.pathManager.retrievePathGB(this.choosenNavPoint.location)
== PathManager.PathResult.PATH_FOUND) {
... do some stuff here ...
}

But I don't see why your code should not work. Are you sure you
provide always the same location here
retrievePathGB(this.choosenNavPoint.location) ?

Anyway - I would suggest to log the results of pathFound property +
location of the navpoint like this:

<code>

String pathFound = "";
log.info("Obtaining path to: " + this.choosenNavPoint);
pathFound = gameMap.pathManager.retrievePathGB(this.choosenNavPoint.location).toString();
log.info("Path result: " + pathFound);
if(pathFound.equals("PATH_FOUND")){
                log.info("path found! running along path...");
                this.gameMap.pathManager.runAlongPath();
} else {
                log.warning("Path is not ready yet!");
}

</code>

Check it inside NetBeans and see what you've got.

Also a good practice is to log iterations of the logic, put this as a
first command of doLogic()

<code>
log.warning("LOGIC ITERATION");
</code>

To mark the begginning of each logic iteration to be able to tell
which logs are which.

To see logs at runtime, click to + next to the agent instance under
services / Unreal Tournament Servers / your server.

Cheers, Jakub



On Thu, Sep 11, 2008 at 9:33 AM, cazub
<pogamut-forum at artemis.ms.mff.cuni.cz> wrote:
> Re: Re: Re: mapping bot
> ok jakub i'm stuck :( ,  i don't think i understand how to check for PATH_FOUND
>
> String pathFound = "";
> pathFound = gameMap.pathManager.retrievePathGB(this.choosenNavPoint.location).toString();
> if(pathFound.equals("PATH_FOUND")){
>                this.gameMap.pathManager.runAlongPath();
> }
>
> is what i'm doing and that doesn't seem to be working, how do i do this exactly??
>
> ----
>
> Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=236&comments_parentId=222&post_reply=1#form>
>
>
> _______________________________________________
> Pogamut-list mailing list
> Pogamut-list at artemis.ms.mff.cuni.cz
> https://artemis.ms.mff.cuni.cz/mailman/listinfo/pogamut-list
>



More information about the Pogamut-list mailing list