Squibble's Forum Posts

  • It's a bit of a work around, but Cut and Paste works. If you want to move events into a group or drag it into a sub-event, first create a temporary event (or sub-event), cut the event you want to move, paste it to the temporary event and then delete the temporary event.

    @Ashley If the method Constructbot suggests, that would be nice. Or maybe make it were you need 2 fingers to scroll. That's what art apps do. 1 fingers draws on canvas, 2 fingers to pan/scroll the workspace.

    Nevermind. I missed the subtext of Ashley's response.

  • Great link, thank you!

  • When you create a family instance it just randomly chooses one of the object types in the family and creates an instance from that.

    I'm not really asking you this, just questioning it out loud, but why is it random? I'm asking C3 to create a duplicate "For Each" member of the family. The order it chooses the objects should be the order the duplicates are created. That way they would match up. If I wanted it to be random, then I would ask C3 to make it random.

    So to actually duplicate objects in a family you’d probably need to just copy the first two events multiple times and handle each object type in the family specifically. That or just use different animations of one type instead of families.

    But that's not very efficient if you have 30+ objects. Again, not your problem, but isn't the purpose of Families is to avoid repeating events?

    Maybe I missed it, but I didn't read in the manual about anything added to a family being random, and it kinda defeats the purpose. The event sheet reads from top to bottom in order. Why doesn't that same logic apply to objects in Families?

    igortyhon You are a genius! Very creative to use arrays. I love it when you reply to my questions, because you'll have a creative solution and an explanation of how it works. I don't know why you, R0J0hound, and others hang around these for forums to help noobs like me, but I'm very grateful. Thank you!

    Btw, do you have a YouTube channel where you walk viewers through your thought process?

  • Here's one way to do it that's basically what you described:

    https://www.dropbox.com/scl/fi/lfmr9x6woehinwv3unnsf/dropshadow_idea.c3p?rlkey=5dg9g6cl1u8qrd34f20rfwkfw&st=o9tf4aop

    The meat of it is the instances are duplicated and placed on the shadow layer. Then to position the shadow you need to access the position (xy) of the instance it was copied from and then you position the shadow with:

    set position to x+(x-light.x)*0.1, y+(y-light.y)*0.1

    The way I handled pairing the instance duplicates is by storing the uid of the shadow instance in the original instance then doing some picking juggling. There are probably other strategies with various pros and cons.

    This is great! There's a lot I can learn from this. Thank you for demonstrating how to do it. But why doesn't it work with Families? Isn't it still asking for the UID of the family member, except maybe it's not because it's assigning the shadows wrong. The Family as a whole doesn't have a UID, does it? How can I fix this to work with Families?

    FamilyDropShadow.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So notifications? You can search here for "notification" plugins here:

    https://www.construct.net/en/make-games/addons

    There's a few in the Store.

  • I would like to find a way to recreate the Shadow Light/Shadow Caster effect without the shadow being drawn from the base of the object. Something like this:

    I was thinking of maybe duplicating all the objects on the object layer to the shadow layer (with layer effects), pinning the shadows to the original objects and offsetting the shadows 15 pixels opposite of the direction of the LightSource Sprite every tick, but I have no idea how to begin to do this. Can I even pin a copy of a sprite to itself? Maybe with UID, but then how would I know what that UID would be?

    Here's how I have the layers set up:

    DropShadowIdea.c3p

  • I need somehow to detect users activity generally while my app is not in focus.

    I'm curious to why you need this?

  • Is overlaping does not loop nor trigger actions. It test for overlap with another object like the description say. And returns true or false.

    I'm clearly using "trigger" as a verb. It means to cause an event or situation to happen. It states in the manual that the conditions must be met for the action to run.

    That directly contradicts what you were arguing before.

    Here's some examples, In this case Is overlapping is allways true because the layout starts with the two sprites already overlaping:

    1- Only run actions one time On start of layout

    2- Only run actions one time every second passes

    3- The sprite doesn't have animations so action will never run.

    4- Will trigger once.

    5- Only run actions when sprite2 is created and also overlapping. Only once.

    6- This event will call a function that will run once every time a blue sprite is destroyed on screen.

    That's only applicable to your case, in the examples it will not "loop" the actions even tho is allways overlapping. So that will be a wrong description.

    That's not at all what I meant. I was talking about actions and only using IsOverlapping as the condition. By adding more conditions, you're just proving my point that conditions have an effect on the actions. Besides, everyone else has already said the reason the animations were looping was because of the IsOverlapping condition. I trust them. I can't tell if you are trying to be helpful or just argumentative, but I don't really care to continue this conversation with you any longer. All the best.

    (Edited for clarity and kindness)

  • WackyToaster I appreciate the description, but I already know C3 events are read from top to bottom, every tick, which is around 60 times a second. I know there are 3 types of conditions, normal, triggered and looped. And the green arrow indicated a condition is triggered. No issue there. I'm basically just asking for more clarity in the descriptions for new users, and maybe future me. I might stop using this software, come back years from now and try to learn it again. Already happened once...

    Is overlapping can't specify "every tick" in the description, that's only true in your case not in all cases.

    Is there a case where if overlap condition is met, the event actions don't loop? Beside maybe destroy sprite, because it can't keep destroying something that's already been destroyed? That would be some good information to know. Please share.

    It can't say "will run actions" because conditions don't run actions, the event run actions when all conditions in the block are true.

    Never said that.

    I understand that it's frustrating and the grenade example is funny, but the description is not an instruction, the grenade description should say something like "exploding device" and you choose how to make it explode.

    We can talk about that briefly, if you want. What are instructions? It's a description of how to do something. What's a description? Description is a spoken or written representation or account of a person, object, or event. An event is a thing that happens. See how they relate? Here:

    "Object: Select the object to test for overlap with." Is that not an instruction? Is it not describing what's happening? But I digress, because it's not the point I was making. The purpose of the example describing how to use a grenade is that one of the most important parts of what the condition does is left out of the description. "IsOverlapping" loops the actions when the condition is met. There's nothing that implies it's looping the actions when the conditions are met. And I understand the point that if you know everything about how C3 events work, it should be obvious. But this software isn't marketed to users that know everything about the software.

    A better description would be "Object: Select the object to test for overlap, while true, the event's actions are looped." That description tells me all I need to know.

  • Squibble

    Yes, it can be evaluated every tick, but that comes from how the event sheet runs and not from the condition itself. In your case, the animation kept looping because the event was running every tick, so the condition was being checked every tick.

    It only loops when the condition is met. So how can you say it's not from the condition itself? Without the condition, the animation doesn't loop.

    Anyways, the point was that the description of the condition shouldn’t be changed. This applies to all normal conditions, like “Is visible” as well. They’re just state/comparison checks. They don’t define when they run, only what they check.

    I respectfully disagree. Take a look at this popup from C3, and explain to me how I'm to deduce that this condition will trigger the following actions attached to it every tick when met?

    There's a lot baked into that condition not explained. The description is lacking. Many descriptions in C3 are lacking. There's a lot of curse of knowledge going on here. The description isn't for people like you that don't need them and already have a deep understanding on how C3 functions. It's for people like me that are trying to learn and understand C3. I wasted hours trying to figure out why my animations were looping before posting here. That creates frustration. I want to save others from that trouble. If the description doesn't fully explain something, then what's the point?

    If the instruction for how to use a grenade only explains that once you pull the pin, the pin comes out, wouldn't you want to also know that pulling the pin triggers the grenade to explode?

  • This is not how it works. "Is overlapping" is only a condition check. It will be evaluated whenever the event runs. Note that the event sheet runs all events in top-to-bottom order every tick.

    If you place it in the event sheet without any triggers, it will run every tick. If it is placed under a trigger, it will run only when that trigger fires.

    But isn't the condition a trigger? Conditions met --> triggers actions? The original question is basically asking why do my animation loop when I don't set them to loop? WackyToaster said it's because "Is overlapping" is every tick. When the condition of objects overlapping is met, it's triggering the animations every tick, yes? If not, the questions remains. Why do the animations loop?

    Construct3 offers many ways to achieve this.

    That’s why I’ve created two versions: one runs and checks continuously, while the other runs only when something happens.

    You can uncomment the desired group to test it.

    https://fex.net/s/sxn9cmc

    I really like variant 2. On collision triggers once and you're checking if the default animation is already playing. I like that way of thinking. I can use that in different ways. Thanks so much for showing me this!

    P.S. No, fortunately I’ve never been a tank driver; I draw tanks and make games with them because my son is into it, and he draws them much more often.

    Ah! That explains the cartoony faces on some of the tanks. You're a good father. My son was into Venus flytraps when he was younger, so I made a really simple game where you could catch flies and drag them to the flytrap and it would eat them. Anyway, I was going to say I was a gunner on a M551 Sheridan tank when I was stationed at NTC (National Training Center), and briefly a gunner on a M3 Bradley (kinda like a tank). Very cool your son is into tanks!

  • The issue is that the pineapple is constantly "not cooking" so this event runs every tick. You could track that with an instance variable.

    Ah! It didn't occur to me the condition was every tick, but I guess it makes sense C3 would check if sprites are overlapping every tick. But why apply that to the actions? I can't find any documentation explaining this. Even the "Is overlapping" description implies only one test is going on. "Object: Select the object to test for overlap with." Shouldn't "test" be plural?

    DiegoM If it's not too much trouble, is there anyway to change the "Is overlapping" description to "Object: Select the object to test every tick for overlap with." This would be very helpful to noobs like me to know every tick is being applied to the actions.

    Pineapple is overlapping flame -> set pineapple.cooking to true

    Pineapple is not overlapping flame & pineapple.cooking = true -> set animation not cooking, set pineapple.cooking = false

    On animation not cooking end -> set animation to default

    Something along those lines

    That works! I felt like I already tried that before, but I must've made some mistake. Then I thought since I was already checking if sprites are overlapping with a function, I could work the sprite animation actions in there too, but it works better separated. I really appreciate your help and I learned something new about the overlapping sprites. Thank you!

    rozpustelnik I tried that, but something about it didn't work and I've long forgotten why. I think maybe because I was using multiple sprite overlaps and it needed to be triggered more than once.

    igortyhon Thanks, but WackyToaster helped me solve the animation issue. Can you help with something else though? I have a function counting how many sprite are overlapping, but once you overlap the sprites and then remove them, the count never goes back to 0. What am I doing wrong?

    OverlapFunction.c3p

    I noticed you like tanks a lot. If you don't mind me asking, were you once a tanker?

  • I should add there are multiple Flames and Pineapples on the screen at once, which is why I have the function. I want the Pineapples to interact with the Flames individually.

  • Can anyone please help me with this. When the Pineapple is overlapping the Flame, it should trigger a "Cooking" sprite animation and when it's not, it should play the "NotCooking" animation once and then stop. The problem is that the "NotCooking" animation loops, even though looping is not enabled for the sprite. I don't want it to loop.

    Edit: Updated Screenshot

    I've tried many ways to fix it. I tried Trigger Once, For each, Picking UID, Nesting, Else, On animation finished, and I'm not doing it right. I don't know why the animation loops when it's not set to loop.

  • Excellent! That second example is the best and I really like the logic in it. I've learned a lot from you. Thank you so much!

    So here's the final working example file if anyone needs it. Look at it, play with it, add it to your app!

    ZoomToggleFinal.c3p