Announcement

Collapse
No announcement yet.

Ignores Moveto!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ignores Moveto!

    Just wondering if there is any other...hmmm, function? I'm not sure what it's called, but is there anything else I can place in an Ignore statement to stop a pawn from moving? I've tried Move, MoveTo, MoveToward (or was is forward?) and it doesn't allow me to compile properly. This is to remedy a sliding problem my pawn has when it's blocked by something. For instance, if I'm surrounded by monster pawns, the ones that can't get to me and are blocked by the others in the way will slide to an opening (Moves but plays idle anims) and it looks hilariously silly. I'd like to make it so that the pawn stops in it's tracks if it can't get to me, and I think I can do it in one of the attack or hunt ignore functions.

    #2
    Heheh... so many coincidences, people seem to be working on the same issues I've been having at the same time. Just started working with MoveTo() yesterday.

    MoveTo can only be called in a state, not inside a function. So like this:

    Code:
    state Something
    {
        function Dealie()
        {
            SomeStuff;
        }
    
    Begin:
        MoveTo(Somewhere);
    }

    To get it to stop, try MoveTo(Pawn.Location);

    So, when you want to stop the pawn, just put:

    Code:
    GoToState('Stopping');
    In whatever function you're using, then set it up like this:

    Code:
    State Stopping
    {
    Begin:
        MoveTo(Pawn.Location);
    }

    Comment


      #3
      ACK! I get this funky error 'bad command or function' when I compile after I place it in my state.

      Comment


        #4
        Do you have it after Begin: or some other word with : after it? States use those as locators, with Begin being automatic. For instance, if you did:

        Code:
        state Whatever
        {
            SomeFunction()
            {
                SomeStuff();
            }
        
        Dealie:
            MoveTo(Wherever);
        }

        To have it use your MoveTo function, do this:

        Code:
        GoToState('Whatever','Dealie');
        To have it go to the state and execute the stuff at Dealie. If you had Begin: instead, you wouldn't have to tell it to go there with the second variable in the GoToState function, it will go there automatically if it exists. For some good examples of this, look at the state code in the Mover class.

        Comment

        Working...
        X