Squibble's Forum Posts

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

  • Try Construct 3

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

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

  • Yes, but you have to add extra sub-events to compare the variable.

    Set var to (var=0?1:0) allows to toggle a variable in a single action.

    Here's the toggle test I made. Toggling in 3 or 4 events isn't too bad compared to so many examples I've seen. It would help me if I could see it done in fewer events within a working file. Can you show me?

    ToggleTest.c3p (Edit: Scroll down for the best version)

  • Hi hhg21011998 It might be better to ask dop2000 on the thread you linked to so if anyone else searched for drag and drop physics example, they'll find it there.

    Set var to (var=0?1:0) means "if var=0, set it to 1, otherwise set it to 0"

    https://en.wikipedia.org/wiki/Ternary_conditional_operator

    Thanks for the link.

    So if var=0, set it to 1, otherwise set it to 0... which sets it to 1? 0 will always be 1? Why set it back to 0?

    Wouldn't if var=0, set it to 1 do the same thing?

  • This isn't necessary, but you can put dop2000 :)

    It is to me. I appreciate you helping me to learn something new and to think differently.

    That's because CameraZoom can never be 0. Check your logic - first you're adding 1 to CameraZoom, then comparing it to 0. Should be the other way around.

    Ok, but why can't the CameraZoom variable be zero? I'm not using it for its numerical value. I'm using it as a placeholder. I'm not multiplying or dividing different numbers that always result in 0. I'm adding only as means to change the placeholder. I've been told before I can do that and it has worked in the past...

    I did finally get the zoom toggle to work with using 0 as a placeholder and even used -1 as the other placeholder. Here's the events:

    It's clever to use a sprite tween for zooming. Couldn't had figured this out without you. Thank you!

    If you want to toggle a variable between 0 and 1, there are several easier ways to do this:

    > Set var to (var=0)
    Set var to (var=0?1:0)
    Set var to (var+1)%2
    

    Easy for you, but it seems more complicated to me. Interesting though. Help me think like you. What does var=0?1:0 mean?

  • dop2000 A bit off topic, but how should I credit you in my game (should I ever publish it) for helping me? Your real name or dop2000? Which is better? It's going to amount to absolutely nothing, nobody will probably ever see it, or play the game, except it matters to me giving credit where credit is due. Maybe I should just credit people without ever asking? Same question to robloxguy14 and igortyhon

  • Like this?

    Only Zoom Out works now (CameraZoom=1 event). Zoom In doesn't work. I can probably make it work with 2 separate camera sprites, but I'd like it to work with only one, because I plan to do some dynamic camera movements and it would just be easier with a single sprite.

  • I'm a visual learner and the best way for me to learn is watch others do it first. And I finally want to get serious about using C3. If you have a C3 tutorial channel on YouTube, or know of a great channel teaching how to create in C3, I'd love for you to post the link in a comment. Many thanks in advance!

    Here's some great tutorial channels I've found:

    Game Design with Reilly

    Xanderwood

    FoozleCC

    Tagged:

  • I recently got Blasphemous. I played it on the deck for an hour, and then when I booted it up on my pc, the save file didn't exist, because the linux version and the windows version of the game apparently can't share save files. So my playthrough is stuck on the deck.

    Are you referring to the game Blasphemous by The Game Kitchen? Do they promise cross save between platforms and if so, wouldn't that be a question you ask them?

    Here's their contact info:

    infotsr@thegamekitchen.com

    Why would I bother with making a Linux version for a game targeting the steam deck?

    That's a question only you can answer. If you want your game to be playable on Steam Deck, you make a game targeting the Steam Deck. If not, then don't.

  • dop2000 (or anyone that knows) If I'm not bothering you too much, can you help explain to me why does this work

    But not this?

    It kinda works, but not as intended. I want to toggle zoom in and out. The variable changes the Tween value for the layout to scale to and it does, but without any tweening and at various scaling between 1 and 1.5. What am I doing wrong?