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

Get help using Construct 2

Post » Mon Jul 28, 2014 2:56 pm

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?

Code: Select all
 
    NPC moveTo(X,Y)
    wait (2s) // Time until the NPC reaches the point
    NPC jump
    wait (0,5s)
    NPC moveTo(X,Y)
    wait (5s)


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 :D

Thanks everyone.
Last edited by blinkn on Mon Jul 28, 2014 4:22 pm, edited 1 time in total.
B
8
Posts: 20
Reputation: 302

Post » Mon Jul 28, 2014 3:25 pm

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.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Mon Jul 28, 2014 3:30 pm

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.
Intermediate level Construct 2 developer, looking to build up my portfolio : https://seriouslycrunchy.itch.io/

Current projects : Bite Sized Game Development, please have a look at my tutorials and comment!

I also write for http://moonbooks.net/, please come and check us out!

Follow me on twitter! @SrslyCrunchy I'm always looking for games or templates to highlight, use the hashtag #madeinconstruct !
B
15
S
6
Posts: 52
Reputation: 3,016

Post » Mon Jul 28, 2014 3:34 pm

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
B
7
S
1
Posts: 73
Reputation: 603

Post » Mon Jul 28, 2014 3:53 pm

hmm, thanks guys for the fast replies, you rock!
gonna try :D
B
8
Posts: 20
Reputation: 302

Post » Mon Jul 28, 2014 4:19 pm

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!
B
8
Posts: 20
Reputation: 302


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, nahima and 6 guests