nhagan19's Forum Posts

  • 3 posts
  • How might I provide you with a CAPX? And, while I'm replying, how might I set a Global to the UID of a currently selected building, and what do you mean by selected?

    Thanks

  • I meant instance variables. Replace all of the times I referred to local variables with instance variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I’m working on a management game, and there are going to be, on a map, 60 or 70 different purchasable buildings. Each one will have different information. I don’t want to make each one a separate sprite, and am using instance variables. I want to be able to click on each building from the map, and have a bar on the side that shows whether or not it’s been purchased or not, as well as its name and other information about it. Is there a way to link objects to local variables? Each of my buildings has a name, as a local variable, and I want it displayed on the side of the screen when I click on the building. Is there a way I can automatically have it set the text on the side of my screen to match the local variable of each building when I click on it, like I might with a global variable? I know I could have a separate event for every single building set the text as the name of that building when I click on it, but that seems like an unnecessary hassle. I’ve run into another problem. As I said before, I want each building to be individually purchasable, but how do I tell Construct what building is selected. I thought that I would just add a “selected” local variable to the buildings that would be 0 by default, and would be set to 1 if it was clicked on, and to zero again after you clicked on another building (and then that other building would be 1) so it would only let you purchase the building when the value was 1, and then it would know which building to change the “purchased” local variable of. The problem is, I can’t figure out how to trigger an event to set the “selected” variable back to zero. If I click on a couple of buildings, and then the purchase button, it will purchase all of them. How do I keep just one building selected at one?

    Thanks,

    nhagan19

  • 3 posts