Made a cool night-vision mod, but need help with custom overlay.

Requests go in THIS forum!
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
Graaicko
Posts: 534
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Made a cool night-vision mod, but need help with custom overlay.

Post by Graaicko »

I made some Night-Vision Goggles based off of DN3D, but I want it to have a "digitalized" overlay effect when on, theres two overlay sprites that loop when the Night-Vision item is activated, "NGOGA0" and "NGOGB0". The problem with it is that the digital overlay stays on after it turns off, I would like the overlay to be gone when the player deactivates it. I have tried different ways to change or remove the overlay but it doesn't seem to work. As it stands " NightVisionOverlay:" doesn't seem to be working at all at the moment. Any help to resolve this issue would be much obliged.

ACTOR NightVisionGoggles : CustomInventory 484 { //$Category BO3D - Gear +ALWAYSPICKUP +COUNTITEM +NOGRAVITY +INVENTORY.ALWAYSPICKUP +INVENTORY.INVBAR +INVENTORY.KEEPDEPLETED +INVENTORY.HUBPOWER +INVENTORY.FANCYPICKUPSOUND +INVENTORY.UNTOSSABLE Inventory.Amount 200 Inventory.MaxAmount 200 Scale 0.6 Radius 30 Height 32 Inventory.PickupFlash "PickupFlash" Inventory.Icon "GOGGE0" Inventory.PickupSound "NVG" Inventory.PickupMessage "Picked up a pair of night-vision goggles!" States { Spawn: GOGG A 15 GOGG B 3 GOGG C 3 GOGG D 3 GOGG E 3 GOGG D 3 GOGG C 3 GOGG B 3 Loop Use: TNT1 A 0 A_JumpIfInventory("NightVisionOnFlag", 1, "TurnOff") TNT1 A 0 A_GiveInventory("Colorize", 1) TNT1 A 0 A_GiveInventory("PowerNightVision", 1) TNT1 A 0 A_TakeInventory("NightVisionGoggles", 1) TNT1 A 0 A_GiveInventory("NightVisionOnFlag", 1) TNT1 A 0 A_GiveInventory("NightVisionIcon", 1) TNT1 A 0 A_Overlay(5, "NightVisionOn", 1) TNT1 A 0 A_PlaySound("GOGGLES") Stop TurnOff: TNT1 A 0 A_TakeInventory("Colorize", 1) TNT1 A 0 A_TakeInventory("PowerNightVision", 1) TNT1 A 0 A_GiveInventory("NightVisionGoggles", 1) TNT1 A 0 A_TakeInventory("NightVisionOnFlag", 1) TNT1 A 0 A_TakeInventory("NightVisionIcon", 1) TNT1 A 0 A_GiveInventory("NightVisionOverlay", 1) TNT1 A 0 A_PlaySound("GOGGLES") Stop NightVisionOn: //<----------------------------------------------Looping Overlay (Stays on screen when deactivated) NGOG A 3 A_TakeInventory("NightVisionGoggles", 1) NGOG B 3 NGOG A 3 NGOG B 3 NGOG A 3 NGOG B 3 NGOG A 3 NGOG B 3 NGOG A 3 NGOG B 3 NGOG A 3 NGOG B 3 Loop NightVisionOverlay: //<---------------------------------------------Not Working TNT1 A 1 A_Log("Overlay Deactivated") Loop } } ACTOR PowerNightVision : PowerLightAmp { Powerup.Duration -1 // Nightvision depletion speed (adjust if needed) } ACTOR Colorize : Powerup { Powerup.Color GreenMap Powerup.Colormap 0.0, 0.0, 0.0, 0.1, 0.8, 0.0 Powerup.Duration 0x7FFFFFFF } ACTOR NightVisionToggle : Inventory { Inventory.MaxAmount 1 +INVENTORY.UNDROPPABLE +INVENTORY.HUBPOWER States { Use: TNT1 A 0 A_GiveInventory("NightVisionGoggles", 1) // Ensure goggles are in inventory TNT1 A 0 A_TakeInventory("NightVisionGoggles") // Simulate using the goggles item Stop } } ACTOR NightVisionOnFlag : Inventory { Inventory.MaxAmount 1 +INVENTORY.UNDROPPABLE +INVENTORY.HUBPOWER States { Spawn: TNT1 A 1 Stop } } ACTOR NightVisionOverlay : Inventory { +INVENTORY.UNDROPPABLE +INVENTORY.HUBPOWER States { Inventory: TNT1 A 1 Loop } } ACTOR NightVisionIcon : Inventory { +NOINTERACTION +INVENTORY.UNDROPPABLE Inventory.Icon "NVGFA0" Inventory. MaxAmount 1 States { Spawn: TNT1 A 0 } }
User avatar
Graaicko
Posts: 534
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: Made a cool night-vision mod, but need help with custom overlay.

Post by Graaicko »

Here are some images of the current decorate at work and my issue.

When the Item is on (with overlay).


When the item is off (Still with overlay).
Post Reply

Return to “Requests”