Results 1 to 4 of 4
  1. #1
    Iron Guard
    Join Date
    Jun 2008
    Posts
    818
    Gamer IDs

    Gamertag: Black Fang666

    Question Ai - Is there a function called upon reaching a destination?

    I have figured out how to use the scripted move states to tell my AI where to go, but I am not sure how to script what it should do when It gets there. Can anyone help point me in the right direction? This is the first project that I have gotten far enough to start working on AI.

    Thanks for your help.
    Want to collaborate? Want to chat UDK? Message me on Skype, Craig Delancy. Check out my UDK Youtube channel: http://www.youtube.com/user/xblBlack...ew=0&flow=grid

  2. #2
    Redeemer
    Join Date
    Jul 2011
    Location
    London, UK
    Posts
    1,749

    Default

    yeah there is a function that gets called when reaching a destination, i belive it's whatodonext

  3. #3
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,892

    Default

    yes there is one. when the guy reaches his destination an event 'ReachedPreciseDestination();' will be called. however for it to be called you must set 'bPreciseDestination = TRUE;' or else it will not be called.
    this one exists in AIController so you don't need to extend from UTBot to have it.

    I don't personally use it because if he gets there and you want the guy to do something else afterwards, there will be a slight moment of lag that spans the time in which he decides what to do next until he finally goes out to do it (shorter or longer depending on your decision-making routines, but I extend from AIController and my decision-making process was quite simple and still I noticed some slight hiccup)

    you can also check 'Pawn.ReachedDestination(Actor)' which returns a bool saying if he's reached that actor.
    this one also exists at Pawn level, so you don't need to be extending from UTPawn to have it

    I myself just check every tick for the distance between the Pawn and his destination, and if the distance is small enough then I just assume he reached it

  4. #4
    Iron Guard
    Join Date
    Jun 2008
    Posts
    818
    Gamer IDs

    Gamertag: Black Fang666

    Default

    I had been trying to do it through tick like you said but for had trouble for some reason. Both of you have been very helpful, thank you.
    Want to collaborate? Want to chat UDK? Message me on Skype, Craig Delancy. Check out my UDK Youtube channel: http://www.youtube.com/user/xblBlack...ew=0&flow=grid


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.