0 Favourites

I do not understand the result of the condition.

  • Hi, what is the reason why the condition is false if I compare the name of the animation but it is true if I use "pin is pinned" ?.

    I do not understand

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

  • the system: compare two expressions does not pick objects, that may be your issue right here, as with the pin, it'll work.

    I tried a system: pick by comparison instead and it worked.

    however I am still unsure how that is supposed to work without picking so I may investigate further.

  • Hi, what is the reason why the condition is false if I compare the name of the animation but it is true if I use "pin is pinned" ?.

    I do not understand

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

    I have no idea why that does not work, but if you want to pick the star by it's animation, this should work:

    star - Is playing animation "Default2" => [action]

  • Sure, there are other ways to do it but I think that condition should work, I hope someone can clearly explain why the condition does not work

    Star.AnimationName = "Default2"

  • It's because you have a bunch of star objects. If you just say "is star.animationname=default2" how should it know which start to pick?

    Use "for each". For each star object -> star animation is = to default2 -> rotate.

  • C2 should pick up the star that has the animation named "Default2".

    Is not that how it works?

    You put a condition, then the objects that fulfill it pass the condition and are collected.

  • (As already said) The condition 'Compare two values' has no 'pick' component. Only a logic component. It is true or untrue, and thats it.

    The star the action is addressed to is therefor unreferenced.

    If you wanna use an object related expression in the Compare two values (Sprite.X, Sprite.AnimationName, etc) then you have to pick that sprite first. Unless there is only 1 instance of that object. Unless you are only interested in the object with the lowest IID when all are picked.

    The condition 'Is pinned' has a 'pick' component and a 'logic' component.

    Its picks all the stars that are pinned.

    Its true when the picklist is not empty, it is untrue when there is none picked.

  • Thanks, it's a bit clearer, but at the same time it seems a bit strange that objects are not collected using that kind of condition.

  • Thanks, it's a bit clearer, but at the same time it seems a bit strange that objects are not collected using that kind of condition.

    There is the system condition "Pick by comparison" which is more or less the same exact thing but can pick objects, compare two values just compare two values, without any picking as it is not designed to be used that way.

    The picking system is one of the most important part of C2, however not every condition can pick objects.

  • I have to admit, it is not that clear, Mirlas.

    I learned by using.

    In general, conditions are part 'picking' and part 'logic'.

    I think all conditions you find under 'sprite' do pick objects and do have a logic part.

    Except the triggers, they have not a realy logic part, that is why you can not combine them with an 'else'. They just fire and pick.

    The conditions under system do pick when they start with 'pick', or when they start with 'for each'.

    Roughly that could help you.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • On a different note, putting a every x seconds triggered event inside an every tick event kind'a defeats it's purpose, move all your every x condition outside of every tick condition checking events, also if you're checking other values in the event do it after the every x seconds and not before.

    It probably won't matter if you have just one, but for a bunch of them it will.

    Also use 'else' to minimize condition checking, especially for 'for each' events on lots of objects.

    if star is playing

    else if star is playing

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