[Solved] How do I write a walking route for NPC?

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Okay, maybe the title won't be clear so, my point is:

    I have a Platform layout, with of course, solid platforms, and i have one NPC (Sprite with properly animations [walking, standing, jumping etc...])

    First: Which behaviors i need to activate do achieve the "predetermined route" for that sprite NPC?

    Second: How can I write his movement path?

    Is there a way like this?

     
        NPC moveTo(X,Y)
        wait (2s) // Time until the NPC reaches the point
        NPC jump
        wait (0,5s)
        NPC moveTo(X,Y)
        wait (5s)[/code:17kio1lh]
    
    Maybe this question was answered before, but i couldn't find it.
    I'm starting now with game development and this is what is stucking my learning curve 
    
    Thanks everyone.
  • You can add the platform behaviour to your npc, for moving I sugest you download the behaviour called MoveTo, by rexrainbow. For waiting use System> Wait action. For jumping you can use, Platform> simulate jump action.

  • There is a pathfinding behaviour, but I don't think it would work for this.

    I think a good way to do it would be to create waypoints for each character. Each waypoint is an invisible block. Every time the character hits a waypoint, direct him to the next one. You can use simulate control on a platformer or a custom movement behaviour to make this work.

    Would you like me to go into more detail on this method?

    EDIT : Caiorosisca also gives a good option for you to use.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • In my platform game I have created it by using MoveTo plugin. I need enemy to find a platform and jump into it, to throw axes from it to my hero. I used moveto platform, than I have a general rule (if animation is run and vector x =0, means that smth is not quite good ->simulate jump). But you can do it without plugin, using simulate control options and your imagination

  • hmm, thanks guys for the fast replies, you rock!

    gonna try

  • I just follow yours instructions and came up with this behavior plugin:

    https://dl.dropboxusercontent.com/u/577 ... oveto.html

    so, if anyone has the same issue, just install it and be happy!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)