HUD being messed up by lighting system

Get help using Construct 2

Post » Fri Jun 10, 2016 9:17 am

So, I just implemented a lighting system that works like the one in A Link to the Past (dark maps, only a small radius of self-sight, lantern to light torches that brighten the room, etc) but I've noticed it's messing with part of my HUD. I'm using the sort of setup where the player's sight circle is a white circle with destination out, and an additional layer that puts a slightly transparent black cover over anything under the HUD. Everything else works fine, but the spritefont I'm using is ignoring the fact that it's on a HUD layer (parallax = 0), and starts moving instead of staying put. Since the lighting system is on it's own layer, moving it above the HUD layers fixes the issue but borks the HUD in a different way as the HUD is now dark if you move the Shadows layer to be the topmost layer.

I know the solution would be to use a Text object instead, but I care a tiny bit about the text appearance as that's why I opted for using a Spritefont instead. It's not necessary as I don't mind switching to a text object to display Rupee/Bombs/Arrows count, but a solution would be awesome.

Capx link
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
50
S
24
G
30
Posts: 519
Reputation: 19,563

Post » Fri Jun 10, 2016 1:53 pm

@LaDestitute
ok, I took a quick look, and the problem is in the Main event sheet - On Start of Layout. You create the Rupees object on layer 4. But your HUD layers are now 5 and 6. (Since you probably inserted a new layer to be the Shadows layer). Create Rupees on layer 5 or 6 and it works fine.

It is a good idea to always reference layers by name, not their id number. That way you don't have to worry about inserting new layers... So, create Rupees on layer "BottomHUD" instead of 5, and then it will always work regardless of how many layers you add or delete (unless you delete the bottomHUD layer of course, lol) :)

One time while testing and going into one of the houses I ended up out side the house some how... I did look at the code but there is some bug in there somewhere when you enter a house. (it only happened once - although, I didn't try very many times).
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Fri Jun 10, 2016 11:09 pm

Thanks for the advice, that fixed it.

Also, I'll try looking into the house bugs, thanks. I've encountered it before, but I was tired last night.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
50
S
24
G
30
Posts: 519
Reputation: 19,563


Return to How do I....?

Who is online

Users browsing this forum: odiusfly and 28 guests