Potato's Recent Forum Activity

  • Actually thats kinda weird when the condition runs like my post above,

    because still using the same example:

    <img src="http://i44.tinypic.com/ir8fb8.jpg" border="0" />

    Set 1: Kid 13, Kid 77, Kid 56, Kid 56, Kid 12, Kid 77, Kid 80

    Let say player is overlapping with Set 2: Clown 77, Clown 12

    Action usually run like this:

    Kid 13 = Clown 77

    Kid 77 = Clown 12

    Kid 56 = Clown 77

    Kid 56 = Clown 12

    Kid 12 = Clown 77

    Kid 77 = Clown 12

    Kid 80 = Clown 77

    and it will not destroy anything since no match happen,

    but that's not what happens here, because the event successfully destroy the correct Kid.

    Is the way Condition run & Action run is different ?

  • So what is exactly happens in there, how the condition flows internally ?

    Let say, player is overlap with Clown 77 & Clown 12

    Does it flow like this:

    Kid 13 = Clown 77

    Kid 77 = Clown 77 -> Destroy Kid 77

    Kid 56 = Clown 77

    Kid 56 = Clown 77

    Kid 12 = Clown 77

    Kid 77 = Clown 77 -> Destroy Kid 77

    Kid 80 = Clown 77

    Kid 13 = Clown 12

    (Kid 77 Already destroyed)

    Kid 56 = Clown 12

    Kid 56 = Clown 12

    Kid 12 = Clown 12 -> Destroy Kid 12

    (Kid 77 Already destroyed)

    Kid 80 = Clown 12

  • Thanks Noga, looks like using "for each" work like it was intended.

    Now... please check this out, this really blows my mind,

    the exact same logic is applied to this Clown Destroying Kid :D

    and it works just fine, without even using "For Each".

    <img src="http://i44.tinypic.com/ir8fb8.jpg" border="0">

    capx:

    http://dl.dropbox.com/u/39382262/ClownDestroyKids.capx

    demo:

    http://dl.dropbox.com/u/39382262/Clown/index.html

    How come it works fine in this case ?

    I really need someone to explain how this whole condition thing works <img src="smileys/smiley29.gif" border="0" align="middle">

  • Thanks a lot Danijerry,

    now everything start to make sense to me.

    I guess i can't rely on comparing instance variable to do the filtering / picking, i'll use a direct UID picking as your example in the future <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Thanks Danijerry,

    but if i delete the

    "Shadow --> casterID = ShadowCaster.casterID"

    Then it will destroy all of the shadow, like so:

    http://dl.dropbox.com/u/39382262/EventDestroyAll.capx

    i thought that condition is in there so that it will only destroy Shadow for ShadowCaster outside of the Player.

    <img src="http://i42.tinypic.com/qn04jr.jpg" border="0">

    When reading the Destroying Shadow event above, i thought these what suppose to happen:

    1. Pick all ShadowCaster that's not overlap with the Player

    2. Filter again with ShadowCaster that only has Shadow

    3. Pick Shadow that have a "casterID" the same as ShadowCaster filtered from step 2. -> Destroy this picked Shadow

    hmmm... something is not right

  • Puck, i make a mistake on the example i posted above,

    it happens when more than one ShadowCaster overlap the culler at the same time.

    I still don't understand why either, I'm asking about it in here,

    it confused the heck out of me:

    http://www.scirra.com/forum/confusion-on-how-event-works_topic50372.html

    sorry for using your capx for example, i hope you don't mind <img src="smileys/smiley2.gif" border="0" align="middle">

  • My brain is fried trying to figure out why this simple event doesn't work as I expected.

    So here it goes:

    1. Move your red Player with arrow keys to the right.

    2. When the red Player overlap with the ShadowCaster, they will spawn a Shadow.

    3. When the red Player is not overlap with the ShadowCaster, shadow will be removed from ShadowCaster.

    Event works fine when all of the ShadowCaster is not line up in X coordinate:

    http://dl.dropbox.com/u/39382262/EventWorks.capx

    The exact same event fail when ShadowCaster line up on X coordinate:

    http://dl.dropbox.com/u/39382262/EventFail.capx

    it will no longer destroy the shadow.

    Could someone help me out and explain why this happens ?

    Thanks

  • Ah i got it, thanks R0J0hound

    I thought all the action will automatically run, as many times as the number of filtered instance <img src="smileys/smiley17.gif" border="0" align="middle" />

    Thanks again

  • I just notice today that, these condition:

    - Compare instance variable &

    • Is boolean instance variable set

    only pick 1 instance instead of filtering all the instance that match the condition,

    so i have to actually use "For Each" to filter all instance that match the condition.

    Example capx:

    http://dl.dropbox.com/u/39382262/ConditionFilter.capx

    my question is:

    • Is this by design ?
    • Is there any condition that behave like this too that i should be aware of ?

    I'm confused because according to the manual:

    http://www.scirra.com/manual/75/how-events-work

    When certain criteria are met in the condition, it will filter the instances meeting the condition.

    turns out it's not always work that way, like in the above case (only picking 1),

    this could create some confusion for those newcomer like me :P

  • Maybe Trigger Once got confused because there are more than one ShadowCaster triggering the event ?

    I'm not sure how to explain it, I'm kinda confused myself trying to understand how trigger once work in this particular case.

    btw, I remove the trigger once condition and replace it with a boolean variable, (also adding a casterID to destroy the right shadow) and it sort of work :

    http://dl.dropbox.com/u/39382262/TriggerOncePotato.capx

    i hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Anyone in here getting iPad 3 ?

    How is the performance of HTML5 (or C2) games on it ?

    Does iPad 3 browser (Safari) support webgl already ? <img src="smileys/smiley4.gif" border="0" align="middle" />

    I wish i have enough cash to get one <img src="smileys/smiley5.gif" border="0" align="middle" />

Potato's avatar

Potato

Member since 9 Mar, 2012

None one is following Potato yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies