Keeps on looping my actions

Get help using Construct 2

Post » Mon Oct 28, 2013 8:29 pm

Hi all,

I've got a lack of basic knowledge i find out now..

First i will explain what i am doing.

I have a script that:
Checks if a object is close to a point where it has to be ( player is draggin it ). Once on drop it will check if it is close to that point.

If yes it has to put score -1, disable drag and drop and set a position.

This all worked perfect, but not my score.

My score is looping the -1 :-(!

How it looks now:


Im checking my globals if the position is almost correct. If yes it will do the actions.

So.. I am showing my score with: Every tick > Set "text" to "pieces". ( pieces is my score global )

Thanks in advance!
B
10
S
4
G
3
Posts: 165
Reputation: 2,511

Post » Mon Oct 28, 2013 8:47 pm

I cant see your entire capx so I am not sure, but this is a suggestion on something you can check.

From the tiny bit you of actions you have shown there is nothing stopping it from going into that condition many times. It depends on if the position you are setting is a whole different location, then my comment is invalid. But if the location you are setting is still below the distance of the 16 then you will keep on deduction 1 from pieces.

If the above is a correct assumption you need to add another condition, could be a check for if dragDrop is disabled, or your could set a variable on the p92 object that it has the right position.

From what you have shown me that is my best bet. If that does not help, I would need some more info to be able to help you.

Hope it helps.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Mon Oct 28, 2013 8:51 pm

your conditions are true every tick, so every tick the variable is reduced by 1.

add an is dragging condition would help because in the actions you disable the drag and drop, so it's only true once.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 28, 2013 11:16 pm

add system: trigger once while true as condition and it will only activate once
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Yahoo [Bot] and 17 guests