Something strange with conditions.

Discussion and feedback on Construct 2

Post » Mon Oct 10, 2016 4:13 pm

Well. The thing is that the 'on end' is buried deep down under a bunch of conditions. This 'on end' is a trigger.

That means, when 'it' happens, the normal top-top down execution of the events is halted. The trigger fires and executes its actions. Then we go further with the normal top-top down execution.

Thing is, when you code a trigger as sub under a condition, the trigger first has to look up if it is allowed to run. The else is no sub, so the trigger cant really go up to its real parent condition. (in my eyes it should) Result: the trigger thinks it can execute its actions. I dont know if this is due the 3th party or a general thing.

You should never bury a trigger that deep down. Always gives you problems.

Solution: Bring the trigger up. Combine it with a 'if player.x > ..." You have now of course another thing to consider. The 'on end' picks only that one that just ended. Need to destroy them all, use 'pick all' or use a function (functions pick from scratch). If this does not solve the problem, it means this 3th party trigger does not look up if it is allowed to execute.

Besides that. As far as i can see. The last dot does not move. The other dots are wayyyyyyyy done moving when the player is reaching quepoint. Therefor, there will be NO trigger happening when the player is past that point.

Again. A trigger happens. You can use it only once and only on the moment that it happens. It is not info that is readable/available from the moment that it happend and later on. It happens now, on this moment and only now on this moment. If you missed the moment, it is gone.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Oct 11, 2016 4:03 am

@Mirlas
Both Ashley and 99Instances2Go are true. The problem lies in the structure of the code and the use of trigger insides of the else clause which the trigger assumes it is a true condition. I am not even sure how to fix or even if it is fixable, so I will pass on that.
If you just want to focus on finishing the job you can just use 'Compare Progress' = 1, which mean it has reached the end of the tween. Compare Progress is a condition, which is not a trigger like On End, so it will work
B
36
S
6
G
2
Posts: 190
Reputation: 4,223

Post » Tue Oct 11, 2016 8:35 am

Ok, I have a solution for that, but it's hard for me to understand how you can run the trigger if the "else player.x <= 74 * 16" is false and no instance is collected.

Well, I did another test and this really works as I hope.
The objects are destroyed only if prematurely get to the coordinate where the trigger is activated.

Otherwise the objects are not destroyed by the trigger is not running.

You can try to run it if you press the right cursor, the sprite moves and "NOW" is written, now the objects are destroyed when the timer ends.

Image

https://dl.dropboxusercontent.com/u/60803633/testTimer.capx

Thank you all!.
B
30
S
13
G
21
Posts: 837
Reputation: 14,654

Post » Wed Oct 12, 2016 6:35 pm

Hello, can anyone explain to me why the latest example with timer does not behave like the example above with tween ?.

It confuses me.

Please @Ashley
You could only tell me if this is a bug of C2 or C2 is working well in the two examples?
In the first example with tween, the first red object is destroyed.
In the second example with timer, the first object is not destroyed.
I do not understand this :?:
B
30
S
13
G
21
Posts: 837
Reputation: 14,654

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: BlueAlfie and 10 guests