John Cutter's Recent Forum Activity

  • Not sure what I'm doing wrong but I just can't get this to work.

    Here's basically what I'm trying to do. If anyone sees an issue with any of these steps, please let me know.

    - Player clicks on sprite

    - Make sprite invisible

    - Create instance of sprite on "Effects" layer (texture draw = true)

    - Make new instance invisible

    - Copy new instance to canvas (also on "Effects" layer)

    - Wait for events (give time for draw to happen)

    - Set canvas blend mode to Destination Out

    - Paste hole sprite to canvas

    When I do this my sprite image turns black. Any ideas?

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

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

  • Try Construct 3

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

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