John Cutter's Forum Posts

  • Sorry for being unclear. I was working on a game for Steam but for a variety of reasons that's no longer an option for me.

    So I took the current game and instead of exporting with NWJS I exported for Web and put it on my website. The game runs, but sometimes tweens don't finish and the music just suddenly (and seemingly randomly) stops mid-play and never starts again.

    Could be memory maybe? My screens are 1920x1080 but each background is significantly larger to handle different resolutions and aspect ratios.

  • For a variety of reasons it looks like I will have to abandon the game I was building for Steam. Out of curiosity I decided to see if it would run as a web app. The framerate dropped in half but the game worked... mostly.

    I ran into two issues:

    1. One of my tweens sometimes didn't finish "tweening". (This never happened with the PC version.)

    2. Some of my music would suddenly stop playing and never start again.

    Any idea why these things were happening?

  • I can usually get enough AI help that I don't need to rely on this forum all the time, but here's another issue that I can't get working, and the AIs are no help at all:

    Quickly, here is the intended behavior:

    1. The player clicks on a key card (fam_cards.cardType = "key")

    2. The key flies to the jail card (fam_cards.cardtype = "jail")

    3. Animate the jail card to look like the cell is opening

    4. When the animation is finished (frame tag = "done") start a tween (animateCard) to fade the jail card

    5. After the jail card fades out, run some JS code and enable a group

    What keeps happening:

    I can click on the key card and it will correctly fly to the jail card and start the jail card animation. When the animation finishes, nothing happens.

    I had similar events before turning to AI. Here is its suggestion:

    // 1) Key lands → open the jail (what you already have)
    spr_key: On Tween "moveKey" finished
     → spr_key: Destroy
     → System: Pick fam_cards where fam_cards.cardType = "jail"
     → fam_cards: Set animation speed to 8
     → fam_cards: Start animation from current frame
    
    // 2) As soon as that jail hits the “done” tag, fire the fade **once**
    fam_cards: On animation frame tag "done"
     System: Trigger once
     → fam_cards: Tween "animateCard" property Opacity to 0 in 3 seconds
     (In Out Sinusoidal, destroy: Yes, loop: No, ping pong: No, repeat count: 1)
    
    // 3) When the fade really does finish, run your JS + re-activate group
    fam_cards: On Tween "animateCard" finished
     → Run JavaScript: removeCardIDs(runtime)
     → System: Set group "Face Up or Down" Activated
    
  • Well, dop2000, you have once again proven your genius! Thank you!!!

    I was pretty sure I had tried this already, but this time it worked. But... WHY did combining the sub-events work?

    Super glad it's working now, but still confused about the *why*...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • pick all fam_paws appears to be redundant. I guess you've tried without that?

    Yeah, one of the LLMs suggested that. It didn't make a difference, but I left it in anyway.

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

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