Picking UID from Another Layout

  • I'm working on a game prototype where you can view the HP of the Block from another layout ad then move to that layout. After damaging the block and returning to the main layout, you can again view the Block's HP and it will update if it has changed.

    I'm not sure how to get this working using the event language. What I think I need to do in Events 6 - 8 is get the UID of the Blocks from the layouts Block 100, 50 and 25 and get the game to recognize them as they're updated/change. Any help here would be appreciated and then I can focus on the enemies and game settings.

  • You can only access objects on the running layout. Objects on other layouts don't exist so you can't access them.

    Maybe you can make the objects global and just hide them most of the time. Or just storing the health in something global.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can only access objects on the running layout. Objects on other layouts don't exist so you can't access them.

    Maybe you can make the objects global and just hide them most of the time. Or just storing the health in something global.

    Yes, making the Block HPs global would work. I wonder if this would become an issue down the line if I'm making a full game and there are essentially over 100 Block HPs having their own global events. Can I keep a list of globals on its own event sheet and have them work properly?

    Also, could I use multiple layers to accomplish this? I'm guessing I can make certain layers inactive when I'm on another. Guess I'm going to need the full version eventually to get some of this stuff working.

  • Yeah you could probably use anything global to do this: variables, objects or layers.

  • Local storage.

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