Rasta87's Recent Forum Activity

  • Change tempButton variable to number at the moment it's a string. You have to make a new variable and replace it in the events then delete tempButton and rename the new one.

    I hope that was the problem. It works for me now.

    And you have to clear the local storage otherwise you will have the wrong dictionary with double entries. You could use clear storage once and delete it then.

    + System: On start of layout

    -> LocalStorage: Clear storage

    I forgot also to save the dictionary in the else under the is noDouble

    + System: Else

    -> LocalStorage: Set item "ButtonBindings" to ButtonBindings.AsJSON

    Thank you very much Asmodean.You were very helpful. It works now. :)

  • I hope that works, it should:

    (Ignore the DefaultButton Dictionary, that was another idea)

    Thank you Asmodean.

    I tried. But unfortunately, as seen in the picture, there is a conflict between the keys. :(

    Am I missing something? It swaps two keys together. But I think it doesn't matter if one of those keys is on the other keys that isn't swapped.

  • This should prevent double values.

    I tested it. It works perfectly. Thank you for your help, Asmodean.

    My last question is about gamepad controls. :)

    How can I adapt my current system to gamepad input? Unlike the keyboard, if a button assigned to one action is already used for another action, I would like to apply a switch logic between the two instead of adding new button mappings.

    Thank you in advance for your help. :)

  • This should prevent double values.

    Thank you very much for your help, Asmodean . It's working.

  • It's hard to tell exactly from a screenshot, but I'd start by running the debugger and seeing what your dictionary looks like in the inspector at every step.

    Thank you Citron2010 . I already checked it there first. I can assign a key that is already bound to another action to all the other actions as well. How can I prevent this or implement a key swap between actions?

  • Hello everyone, I created a key binding section for my game like the one in the picture. The assigned keys work fine in the game. The problem is that I can assign the same key to another action. When that happens, both actions become inactive. By the way, I don’t have much coding knowledge. What’s a simple way to prevent this? I’d really appreciate your help.

    Is there anyone who can help?

  • Hello everyone, I created a key binding section for my game like the one in the picture. The assigned keys work fine in the game. The problem is that I can assign the same key to another action. When that happens, both actions become inactive. By the way, I don’t have much coding knowledge. What’s a simple way to prevent this? I’d really appreciate your help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The issue is resolved now. The template I was working with had a lot of arrays and JSON structures, so it was quite complex and took some time.

    In short, I ended up combining all the sprites into a single animation. Then I adjusted all the variable references across the game so that they matched the corresponding frames in that sprite. It was a major and time-consuming change, but it worked out in the end.

    Thank you very much for your help—your insights were truly valuable. :)

  • I mean it sounds like you have the right idea.

    For example you could use tokenat to map 0-5 to another value, and do it differently per team.

    Compare Team=0
    — Frame = int(tokenat(“0,1,2,3,4,5”, index, “,”))
    Else
    Compare Team=1
    — Frame = int(tokenat(“6,7,8,9,10,11”, index, “,”))

    Or you can reduce that to just:

    Frame =6*team+index

    If that makes sense.

    I'm not very good with code, so please correct me if I'm wrong.

    I couldn't find any variable called index, so I used LoopIndex instead.

    But when SelectTeam is 1, all the images show only frame 6 — it doesn't distribute across (6,7,8,9,10,11).

    What is the correct way to do it?

  • Thank you for your feedback. I tried creating 2 separate sprites and testing with frames 0–5, but it didn’t work. The (6 * SelectTeam + index) approach worked to some extent, but I couldn’t get consistent results :( . I’ll still give the "tokenat" method another try. Thanks again!

  • Hi Everyone,

    I’m working on a Candy-Crush-style game that loads most of its data from JSON. I have two teams, and I’d like to switch which range of sprite-frames is used based on a SelectTeam value:

    If SelectTeam = 0, use frames [0, 1, 2, 3, 4, 5]

    If SelectTeam = 1, use frames [6, 7, 8, 9, 10, 11]

    What I really want is to take the original frame index (say i from 0 to 5) and map it dynamically so that when SelectTeam = 1, it becomes i + 6 (e.g. 0→6, 1→7, 2→8, etc.), and make that the new, persistent frame number at runtime. I’ve tried a few different event setups (arrays, At() expressions, setting animation frame, etc.), but none have given me a permanent mapping.

    How can I best implement this in Construct 3 so that the sprite always shows the correct team’s frames? Any sample events or tips would be much appreciated—thanks in advance!

  • I am trying to make an in-app purchase. When I click the purchase button, nothing happens. The necessary "in-app definition" has been made in the Google Developer Console. The new game file has also been uploaded and the "in-app purchase" appears in the application promotion in the Google Play Store. What do you think is causing the problem? Thank you for your help.

Rasta87's avatar

Rasta87

Member since 13 Jun, 2021

None one is following Rasta87 yet!

Trophy Case

  • 4-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies