Something strange with conditions.

  • Hello, this capx something happens that I do not understand.

    For example:

    Why the first red object is destroyed when the tween ends ?.

    But the text has not been written with the word "NOW".

    Besides that, the first condition:

    player.x <= 11 * 16

    It remains true, therefore there is no reason to run the condition:

    On liteTween end

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

    What happens here ?, any idea ?.

  • I could be wrong, like totally wrong, but I'd think it is because it's a trigger event and not a regular event under the else. Maybe something the plugin maker or Ashley could explain, as I never used Else with a trigger under it.

  • It's easier to help if you don't use third-party addons, since 1) I don't have to go and find the right addon, which often ends up being a different and incompatible version to the one you used, and 2) it eliminates the chance the problem is caused by the third-party addon.

    Just looking at the picture, I don't think that trigger is going to work like you think. Triggers in subevents check all their parent events are true, but the "else" is checked on its own without referring to previous events in that case, so it probably doesn't do what you want.

  • Tested and working using lastest beta (r237) with liteTween 1.7 as the only installed 3rd party behaviour.

  • Just looking at the picture, I don't think that trigger is going to work like you think. Triggers in subevents check all their parent events are true, but the "else" is checked on its own without referring to previous events in that case, so it probably doesn't do what you want.

    I understand this but I did so to remove code and put the least.

    I will comment with the author of the plugin.

    Thank you all come back with news.

  • It's working fine... Are you using the latest version of LiteTween ?

  • It's working fine... Are you using the latest version of LiteTween ?

    Of course, use the latest version (1.7 liteTween and Release 237 of C2) and the fault exists.

    Are you sure you understand the failure to which I refer?

  • > It's working fine... Are you using the latest version of LiteTween ?

    >

    Of course, use the latest version (1.7 liteTween and Release 237 of C2) and the fault exists.

    Are you sure you understand the failure to which I refer?

    Yes. I do understand. I'm not as retarded as you think. But I'm not perfect so correct me if I'm wrong:

    The events are running well.

    Proof: (The "Now" does show)

    If you are asking why the red circles aren't destroyed. I'ts simply because at the time that the 3rd Else If (Condition) is ran, all the red circles have already finished running litetween. It's a subevent trigger, so the else must run first before the Litetween ends.

    I have asked your liteTween version since the author (lunarray) fixed many bugs on the older versions and it might be the reason why you're having problems.

    I'm also using LiteTween v1.7 & r237 Beta Release.

  • Yes. I do understand. I'm not as retarded as you think. But I'm not perfect so correct me if I'm wrong:

    Those thoughts were never in my mind.

    The events are running well.

    Proof: (The "Now" does show)

    If you are asking why the red circles aren't destroyed. I'ts simply because at the time that the 3rd Else If (Condition) is ran, all the red circles have already finished running litetween. It's a subevent trigger, so the else must run first before the Litetween ends.

    I have asked your liteTween version since the author (lunarray) fixed many bugs on the older versions and it might be the reason why you're having problems.

    I'm also using LiteTween v1.7 & r237 Beta Release.

    Regarding the rest, the question is:

    Why is the first red object is destroyed when the tween finishes playing ?.

    All this happens without pressing any key.

    I have the latest version (liteTween) of the official thread, the downloaded yesterday to make sure I have the latest version.

  • My bad. I was so focused on the TEXT object & the 3rd Red Circle that I ignored the other two. O,o I didn't notice that the 2 events don't have destroy actions.

    But still, I've read Ashley's post about the 'else' doesn't pick objects. So I never use 'else' on my event whenever it requires picking especially triggers.

    It's not my place to tell this but it's like you are expecting 'else' to be more than it is. It's simply just returns true or false from a past event so in a sub-event trigger things go crazy. Then again, forget what I said, I may be wrong anyway.

  • 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.

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

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

    Thank you all!.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)