John Cutter's Forum Posts

  • Here are the events in question, along with a shot of the debugger and game screen.

    EXPECTED RESULT:

    After the pawDown tween finishes I want the circular highlight to move from the first fam_paws sprite to the second fam_paws sprite. (Which is the only sprite that has pawState = current. This is verified.)

    ACTUAL RESULT:

    The pawDown tween finishes, I hear the gallery1 sound effect, and then nothing happens.

    One of the LLMS suggested the Pick all fam_paws to "clear" the picked objects list, but that didn't work. I also tried changing the event to a For each fam_paws condition but that didn't work either.

    There is nothing else in the sheet that does anything with spr_pawHighlight (the ring) except I have another tween that makes the ring pulse up and down. I added tags to these tweens, but that didn't work. Then I just commented out those events. It still didn't work.

    As a test I removed the Picks and just left the condition blank, and I had the moveRing tween move to x = 100 and y = 100. That works just fine.

    I am completely bamboozled by this not working. Any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have been working on this ALL NIGHT and I can't figure it out for the life of me. I've even tried multiple LLMs and they are stumped, too.

    What I'm trying to do is very straightforward:

    Run tween "pawDown"

    On tween "pawDown" finished - play sound (I hear the sound playing so I know this works)

    - Pick all fam_paws

    - Pick fam_paws by evaluating fam_paws.pawState = "current"

    + Do something

    The evaluation fails every time. I have verified, multiple times, that when the code above executes there is only one sprite with pawState = "current". But this condition fails every time.

    Any ideas why this could be happening??? Nothing else in my code is affecting pawState.

  • I lost everything the next day, too!

    I assumed that Scirra, like some other sites, periodically log people out due to piracy issues. I was just frustrated that I had to reinstall my theme, and redo my settings.

    After seeing your posts, and having the same thing happen the next day, I did some digging. I was pretty low on HD space so I got rid of some games I no longer play and I think that cleared up the problem. So far everything is working well!

  • Yesterday, I fired up the desktop version of Construct 3 and I was no longer logged in. Not a huge problem to log back in again, but it defaulted to the default theme, not the one I purchased.

    I tried to select the theme in Settings, but it's not even installed any more! Do I have to re-download and re-install the theme every time Scirra logs me out???

    UPDATE: Ugh. All my settings have been erased, too. I set those up months ago and I don't remember what I changed. Gads, this sucks.

  • WackyToaster

    Haha! Unfortunately, I can't open your example. (It says you are using a newer version and won't let me open the file...) Are you using a beta version?

    Before I "fixed the issue" my code was doing this:

    If card clicked on, set global value cardClickedOn
     If random greater than 50 --> start "flip1" tween
     Else --> start "spin1" tween
    
    If flip1 tween is finished start flip2 tween for cardClickedOn
    If spin1 tween is finished start flip2 tween for cardClickedOn
    
    If flip2 tween is finished start flip3 tween for cardClickedOn
    If spin2 tween is finished start flip3 tween for cardClickedOn
    
    If flip3 tween is finished start flip4 tween for cardClickedOn
    If spin3 tween is finished start flip4 tween for cardClickedOn
    

    But I was clicking on new cards before the tweens were finished, so cardClickedOn was no longer the card I was trying to tween.

    I thought about having an instance variable called "Tweening" for each card and iterating through all of them to continue any tweening that had started, but I would have to constantly iterate through every single card.

    Then I hit on the new idea. (Based on an AI suggestion.) Now I just create a bunch of uniquely named tweens that include the UID so I know which card to update.

  • I'm waiting for one of the experts to tell me, "You are WAY overcomplicating things. All you need to do is..."

    ;-)

  • This forum has been an invaluable resource for me so I am posting this in an attempt to "give back" to the community. (This technique might be used by many of you already but perhaps it will be new to some. It was new to me!)

    The Problem:

    My game has 20 or so instances of a card on the screen. To spin the card I have to sequence multiple tweens together, like this:

    - Get UID of clicked on card

    - Tween xscale from 1 to 0

    - If tween is finished --> change sprite image to back

    - Tween xscale from 0 to 1

    - If tween is finished --> change sprite image to front

    But because there can be multiple tweens happening at the same time the logic was getting confused. For example, before the first tween sequence had completely finished the player might have picked a new card. Now my "On finished" event would reference the wrong instance!

    My Solution:

    When I create a tween I now tag it with the UID of the card that was clicked on. Then I can pick the correct card by parsing the tag.

    The player clicks on a card:

    -> fam_cards: Tween "spin1_" & fam_cards.UID property X Scale to 1...

    Then I can simply check:

    + fam_cards: On Tween "spin1_" & tokenat(fam_cards.Tween.Tags,1,"_") finished

    + System: Pick fam_cards by evaluating fam_cards.UID = int(tokenat(fam_cards.Tween.Tags,1,"_"))

  • Thanks, mOOnpunk! I'll give that a try.

  • Thanks for trying to help everyone! I'm not sure what I'm doing wrong here, but it's still not working.

    Layer 1 is set to force own texture.

    + Mouse: On Left button Clicked on Sprite2

    -> System: Create object canvas on layer 1 at (Sprite2.X, Sprite2.Y), create hierarchy: False, template: ""

    -> canvas: Set size to (Sprite2.Width, Sprite2.Height)

    -> canvas: Paste object Sprite2 with effects

    -> Sprite2: Destroy

    -> canvas: Set drawing blend mode to Destination out

    -> canvas: Fill ellipse at (Mouse.X, Mouse.Y) radius (15, 15) with rgba(0, 0, 0, 100) (Smooth edge)

    When I click on the sprite it just disappears.

    I think I'm going to just do this with art. That should still work well!

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