For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Help with paths

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Age
OldUnreal Member
Posts: 848
Joined: Sat Dec 29, 2007 5:25 pm

Help with paths

Post by Age »

I've made some state that orders scriptedpawn to go some location.
But when he reachs first pathnode, he stops, start looking behind and walking same time.
I've got some help from .:..: already but it didn't help.

So here's the code:

Code: Select all

class testpawn expands ScriptedPawn;

var actor Path;

state movethe
{
      Begin:
      if( PointReachable(Destination)) 
               MoveTo(Destination); 
      PlayRunning();
      Path = FindPathTo(Destination);
      if( Path!=None )
      {
             MoveToward(Path);
          GoTo'Begin';
      }
}
State and destination change by some exec function.
Last edited by Age on Thu Jun 12, 2008 9:22 am, edited 1 time in total.
User avatar
Age
OldUnreal Member
Posts: 848
Joined: Sat Dec 29, 2007 5:25 pm

Re: Help with paths

Post by Age »

Fixed that bug, but now the scriptedpawn keep running around pathnode(s) and never stop it.
Last edited by Age on Thu Jun 12, 2008 1:40 pm, edited 1 time in total.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Help with paths

Post by Raven »

Because you didn't order pawn to stop :).

Code: Select all

      Path = FindPathTo(Destination);
      if( Path!=None )
      {
            MoveToward(Path);
          GoTo'Begin';
      }
it's a loop :). You have to break it if you want pawn to stop.
Image
User avatar
Age
OldUnreal Member
Posts: 848
Joined: Sat Dec 29, 2007 5:25 pm

Re: Help with paths

Post by Age »

Because you didn't order pawn to stop :).

Code: Select all

      Path = FindPathTo(Destination);
      if( Path!=None )
      {
            MoveToward(Path);
          GoTo'Begin';
      }
it's a loop :). You have to break it if you want pawn to stop.
Then how to stop the loop?

Code look now like this:

Code: Select all

state movethe
{
      Begin:
      if( PointReachable(Desti))
              MoveTo(Desti);
      PlayRunning();
      Path = FindPathTo(Desti);
      if( Path!=None )
      {
            MoveToward(Path);
          GoTo'Begin';
      }
}
Last edited by Age on Fri Jun 13, 2008 10:06 am, edited 1 time in total.

Return to “UScript Board”