How do I set up triggers that use a LoopIndex?

0 favourites
  • 3 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • Here's what I'm trying to do. I'm making a slot selection screen for my game and displaying 3 files. I'm using LocalStorage to check for metadata about each slot, using item names e.g. "Save1", "Save2", "Save3". I want to trigger actions when the item is missing (which is a LocalStorage trigger) for any of these items. The LocalStorage "On item missing" takes the name of the key, for which I want to use something like "Save" & LoopIndex, however LoopIndex isn't defined at that time, so it never fires.

    How can I generalize the event here, i.e. without hardcoding events to check for each slot - what if I wanted 100 slots?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For now I'm using a workaround which it to use "Get all key names" (since I'm only using LocalStorage for these keys) and comparing the keys returned and processing them that way, like so:

  • Hey do you wanna maybe join my discord or add me so we can talk about construct stuff ? You sent the NFT peddler flying which like, awesome, fuck NFTs, so maybe i can help you out ?

    you can contact me on twitter through my forum profile I think ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)