John Cutter's Forum Posts

  • Thanks for the reply, Jase00!

    I was trying to follow dop2000's example described here:

    construct.net/en/forum/construct-3/how-do-i-8/punch-hole-sprite-reveal-layer-156127

    I modified it to work on just the sprite being clicked on:

    This works... but those same events don't work in my game. I tried to match the sprite and layer details, but with no luck.

    One difference is the way I had to use containers. My game uses spr_card and fam_cards (with spr_card as the only member), and all card references use fam_cards. Unfortunately, I apparently can't use a family in a container... so I had to add spr_card instead. Not sure if that messed anything up or not.

  • I have roughly 35 sprites on the screen, all on their own layer. When the player clicks on one of these sprites I want to punch a hole in it.

    I found an example from dop2000 and tried to adapt it, but the sprite clicked on either turns black, or it cuts out a sprite shaped hole in everything else in the background.

    Note: My canvas object is on the same layer as my sprites. I also set the "Force own texture" to true for this layer.

    Any suggestions?

  • I'm working on a card game and the logic is getting messy. What is the best practice for tween sequencing?

    1. I use tweens to deal cards, one at a time, to the tableau

    2. When the tween is finished I enable a Group to do the next tween.

    Unfortunately, the event in #2 fires as soon as the first tween finished. (The rest of the cards are still being dealt onto the screen.)

    I tried to add a "Wait 2 seconds" to the start of the next group, but this messed up my instance picking. (It took FOREVER to figure *that* out.)

    My other group is called "Draw Next Card" and I have to use a global variable called "UI_var". I set it to 1 and then, after the first set of tweens, I set it to 0. This way it doesn't call the tweens over and over again while waiting for one of them to finish.

    It's working, but is there a better way to manage all of this?

  • dop2000

    SERIOUSLY??? You define the value of a global string by NOT including quotation marks??? I spent HOURS working on this yesterday. Good grief...

    I've been using Construct 3 for years, how did I not run into this before? I guess I have mostly used global numbers. Argh

    I thought I was taking crazy pills last night. I simplified it down to 3 events:

    Set global string to "Testing"

    1. Confirm global string --> "Testing"

    2. If global string = "Testing" --> FAIL!

    WTH??????

  • Well, it's not an issue with the OR block or "On start of layout". I just tried this:

    When I launch my layout and look at the debugger I see:

    versionType = "Testing"

    str_Test = "Testing"

    So I verify that versionType = "Testing" and then immediately test if versionType = "Testing" and it fails. (If it had succeeded str_test would be "OK")

    If I delete "versionType = 'Testing'" it succeeds. Why can't I check the value of this global string? I'm SO confused.

    UPDATE: I just added a new global variable called verNum and set it to 1. Then I changed my condition to:

    verNum = 1

    This works! Why doesn't the string work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just when I think I'm finally starting to understand this program... <sigh>

    Why doesn't this work:

    In global values I set versionType = "Testing"

    LayoutName = "lay05_coreGame"

    Seems simple, but when I run this code str_test is always an empty string ""

    Possibly relevant:

    - the layout is lay5_coreGame which uses sht5_coreGame.

    - sht5_coreGame includes sht00_globalLogic

    - the code above is in sht00_globalLogic

  • You do not have permission to view this post

  • Thanks, dop2000

    My code has an extra event and it actually makes your first example work. I'm not sure why...

    + System: For each CardFamily order by CardFamily.ZIndex ascending

    ----+ System: For each Card

    --------+ Card: Is overlapping CardFamily

    --------+ System: Card.ZIndex>CardFamily.ZIndex

    ---------> CardFamily: Set animation frame to 1

    Here's my code now and it seems to be working perfectly. Do you see any issues?

  • I wrote a level editor that allows me to load and save .json levels using a FileChooser object.

    Stupidly, I assumed I would be able to load these files (sans FileChooser) in the game, but I forgot that Construct 3 is browser-based and this is not allowed.

    My game will have ~200 levels and during development I will be tweaking/changing them frequently. Should I just keep all the levels in the Files folder in Construct 3, and then re-import them every time I change something?

    What is the best practice for this?

  • Hello dop2000,

    First off, I just want to say that your knowledge of Construct 3 is incredible! I’m always learning from your posts and trying to understand even a fraction of the things you do.

    That said, I’m still a bit confused about the picking suggestion above. I’ve built several fairly complex levels, and my simulation code plays through them 1,000 times (in less than 2 seconds!). I tried implementing your suggestion as well as the approach shown in my screenshot, but I’m getting the same results either way.

    I absolutely trust your expertise (after all, you came up with this approach in the first place! Even the best AI models couldn’t figure it out when I tried asking them), so I'm implementing your suggestion I'm just trying to understand the whole fam_cards vs spr_card stuff.

    Speaking of AI, I asked ChatGPT’s GPT-4o model about this, and here’s what it said:

    In a family with only one object type (in your case, spr_card is the only member of fam_cards), using “Pick spr_card by …” and “Pick fam_cards by …” will behave the same way in practice. That’s because there’s effectively no difference between the single sprite and its family—Construct will end up filtering the same set of instances regardless of which name you use.

    Where it does make a difference is if there were multiple object types in fam_cards. In that case, picking via the family name (fam_cards) would include all objects in the family, whereas picking by a specific member (spr_card) would only apply conditions to that one type. But if the family consists of just a single sprite, they are functionally identical.

    In short: If there’s only one member in the family, both picking methods yield the same result. Using spr_card instead of fam_cards isn’t wrong—it’s just more common to use “Pick fam_cards…” when filtering the entire family.

    Does this align with your understanding? Or is there another nuance I might be missing?

    Thanks again for all your help—I really appreciate your time and expertise!

  • I've been using the code in my original post for several days and it seems to work perfectly with any overlapping cards I've tried.

    Out of curiosity I just tried your suggestion. Is this the correct implementation?

    This seems to do exactly the same thing. It's a few events shorter so I'll stick with it unless I run into an issue.

    Thanks, dop2000!

  • You should try contacting the author of the theme.

    > but got a warning that any file saved with DARCSS will no longer load if I uninstall the theme...

    What??? Is this true? How can an editor theme prevent projects from loading?

    Yeah, I tried reaching out to the author a few weeks ago but he hasn't gotten back to me.

    Regarding the warning, it's actually a more generic warning in the Addon manager. When I tried to uninstall DARCSS I got this prompt:

    "If you uninstall an addon, you will no longer be able to open projects that use it. Are you sure you want to uninstall the addon "DARCSS"?

  • I'm really enjoying the DARCSS theme I purchased from the store, but today I was working on some javascript code and the search feature is basically unusable. The background is dark and the highlighted search results are a dark dark blue... practically invisible.

    I think I found the appropriate color value in the CSS file. Can I change this and then re-install the theme? (I changed c3addon to zip, found the css file and changed the color, then renamed the file.)

    I tried it and got a bunch of errors. So then I considered uninstalling DARCSS so I could re-install it, but got a warning that any file saved with DARCSS will no longer load if I uninstall the theme...

  • dop2000

    I'm testing edge cases, but this code has worked on everything I've tried so far -- including your two examples!

    Whew! I REAAAAALLY didn't want to have to mess with tons of different layers.

  • dop2000

    I just noticed an issue with the code you provided and I'm not sure how to fix it.

    It works perfectly when I have one card being covered by another card, or if one card is covering two cards. Unfortunately, it doesn't work when I have two cards covering one card. Like this:

    In this example, the highlighted card shows that it is being covered by the middle King, but not the one to the right.