Picking UID from Another Layout

Get help using Construct 2

Post » Sun Jan 31, 2016 6:18 am

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.

Image
B
223
S
125
G
8
Posts: 146
Reputation: 22,243

Post » Sun Jan 31, 2016 6:25 am

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.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Sun Jan 31, 2016 10:59 pm

R0J0hound wrote: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.
B
223
S
125
G
8
Posts: 146
Reputation: 22,243

Post » Mon Feb 01, 2016 12:30 am

Yeah you could probably use anything global to do this: variables, objects or layers.
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779

Post » Mon Feb 01, 2016 12:54 am

Local storage.
Image ImageImage
B
171
S
50
G
179
Posts: 8,394
Reputation: 113,482


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests