How does system picking works?

Get help using Construct 2

Post » Sat May 03, 2014 11:53 pm

Hello! I am trying to implement a sprite mirroring in conjunction with the pathfinding behavior. If I try to pick instances with the system condition like this

Image

sprites only get mirrored but do not revert to their unmirrored state.

However, if I use a normal/object picking, everything works as expected. Here is the script

Image

The problem is that I do not want to revert to every tick hack in order to synchronize the custom instance variable with behavior defined variable. It is not an elegant solution and it wastes CPU and memory.

A side question: is there a way to test for the value of behavior defined instance variable - eg. MovingAngle of pathfinding behavior - directly in the object's condition? Currently, I can only see a way to test custom instance variables with "Compare instance variable" condition.
B
6
S
2
Posts: 64
Reputation: 576

Post » Sun May 04, 2014 12:08 am

If your worker.pathfinding.currentnode< worker.pathfinding.currentnode+1 then you are going left?

I mean the x of those nodes.
curnodex.jpg
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Tue Jun 30, 2015 10:44 am

Thx very much Newt for the idea I was struggling for the same reason as Lunarovich, my sprites "sometimes" wouldn´t get mirrored when using pathfinding.movingAngle with some angle value conditions.

Added some "for each" to update the movement status for my sprites and replaced your first section with simply
sprite.X > sprite.Pathfinding.NodeXAt(collBox_breedling.Pathfinding.CurrentNode) // Action: Sprite set Mirrored

now they always face the right direction :)
B
10
S
4
G
4
Posts: 25
Reputation: 3,174


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 11 guests