How do I make npcs go from node to node?

Get help using Construct 2

Post » Sun Dec 18, 2016 6:24 pm

I'm having a problem getting npcs from node to node. They go to one, and then stay there. I don't really see how i could make them go to different ones each time.
I tried using random(nodeY,NodeX) but that didn't really go so well.

Picture of the code V
https://gyazo.com/1de11be1181508ace62009dc18c58902
B
16
S
5
Posts: 22
Reputation: 1,087

Post » Mon Dec 19, 2016 3:19 am

You haven't picked any nodes so it will always go to the one node, usually the one with lowest UID or that was created first. To pick a random one in this case it would be something like Movement = 1 - Pick random instance of WalkNode - Find path to WalkNode.X, WalkNode.Y.

Also I don't know what you want exactly in your game but based on that logic your Sprite is going to be getting told to path to new nodes on the way to other nodes. You might want to try using On Arrived with your logic if you want them to move to a node first before finding a new one.
B
47
S
18
G
84
Posts: 2,265
Reputation: 49,784

Post » Mon Dec 19, 2016 6:35 am

@plinkie
Thanks mate, it worked!
B
16
S
5
Posts: 22
Reputation: 1,087


Return to How do I....?

Who is online

Users browsing this forum: babymumu and 4 guests