usbtypec's Recent Forum Activity

  • I am making a skins menu for my game, and I'm using an array to store if each skin is unlocked (0 for no, 1 for yes). Each button for the skins is just an instance of a base object to make it easier, and each instance has an ID variable to see which skin it is. I have an event that checks the array slot corresponding to the skin with the ID (So Check X -> if SkinButton.id = 1, do actions). If the slot is 0 (locked) I want the button to be black (I used Set Color rgbEx(0, 0, 0)) but if it's 1, reset the color.

    The issue is that it checks for all instances, meaning if just one is locked, they all set the color to 0, 0, 0. How can I check the array for each individual instance instead of all of them?

    Sorry if I worded it weird.

  • You can't do it because you need the 35 conditions to check if each global variable is set. You can't create the variable name in that way. If you used an array for the data probably you could do it in one or two events.

    Okay, thanks 👍

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a bunch of skins in a game I am making, and each skin has a global variable to check if it is unlocked or not (Example: BallSkin1, BallSkin2, etc. 0 means locked and 1 means unlocked). All the buttons to switch skins are just the same sprite with an ID instance variable so I know what skin it is. I want to check if the skin is unlocked, but can't figure out how to use the same "base" event for all of them instead of making 35 copies of all those events. I need to make a way to merge the string "BallSkin" and the ID variable, then return that without it being a string (so the skin with ID 4 would be "BallSkin" & 4 to make BallSkin4).

    I am trying to use "BallSkin" & SkinButton.id to make this, but it isn't working for some reason.

    Is there a way to return that as a non-string to check for the global variable?

    Sorry for all the reading :)

usbtypec's avatar

usbtypec

Member since 25 Sep, 2022

Twitter
usbtypec has 2 followers

Trophy Case

  • 2-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies