dop2000's Recent Forum Activity

  • How is it that you can load different images into multiple instances of the same TiledBackground object, and they each display their own image? But with a Sprite, loading a new image replaces it in all other instances.

    Does each TiledBackground instance have its own texture?

  • You can use a single array to store all these JSONs.

  • Well, yes, if you have two nested For Each loops, then you can use "System evaluate expression". Because inside of these loops you already have a single instance of Cards and a single instance of CardFamily picked.

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

    It looks good to me!

  • Try adding "For each Cards" condition to that event.

    Also, why are you using UIDs as key names? UID is not a reliable identifier. If cards are created in runtime, their UIDs may be different every time the game or layout is restarted.

    If you are placing cards manually in the layout editor, their UIDs will stay the same until the card is destroyed. Still I suggest using an instance variable as a unique card ID.

  • Exact same way I did it for Cards.GetObjectType only that one didn't need to start with str()

    The code on your screenshot works fine for me.

    Are you using "Set key" or "Add key" action? Use "Add key", because "Set key" only works if the key already exists.

  • Yes, it's better. But you don't need to add turret targets on every tick. You can do it once on start of the layout.

    Also you can replace these two conditions

    with

    Army_Undead_R pick nearest to (Unit_Knight_L.x, Unit_Knight_L.y)
    
  • I tried implementing your suggestion as well as the approach shown in my screenshot, but I’m getting the same results either way.

    Maybe you haven't encountered the situation when your code would fail.

    ChatGPT gave you the right answer, but to the wrong question :)

    I made a demo which should explain my point:

    dropbox.com/scl/fi/9smxavmssevbkoaf9vx41/CardPicking.c3p

    By the way, I tried asking Grok and ChatGPT the same tricky questions about C3 and Grok appears to be smarter.

  • When I killed the enemy, I deactivated the enemy movement group

    This is not a good idea, it will only work if you have a single enemy. With multiple enemies disabling the event group will disable it for all enemies.

  • a very large image offset can start to exhibit rendering glitches

    From what I can see, the offset is not that large. 1 pixel per tick, at 60 fps for 120 seconds = only ~7200 px

  • It's actually a known issue with the TiledBackground:

    github.com/Scirra/Construct-bugs/issues/7763

  • BTW, can I also somehow make inventory contents persist between layouts?

    At the moment your inventory is basically stored in ui_inventory_slot sprites.

    One option is to make this sprite global. It will then migrate to other layouts. Just make sure that other layouts have the same layer and that you are not making duplicates of inventory slots - it's a very common problem. Use the debugger (Shift+F4) to check the number of instances.

    A better solution is to store the inventory in some data object - an array, dictionary, or JSON. Then you can rebuild the inventory at the start of every layout. And also you will be able to store it in Local Storage between sessions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It should be 30 fps because I set max delta-time is 1/30. Maybe I misinterpreted it.

    No, that action doesn't limit the fps. I suggest removing it.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies