Questions About Lights & Thing Enters Sector Activation

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States
Contact:

Questions About Lights & Thing Enters Sector Activation

Post by NiTROACTiVE »

I have some new questions about scripting for Doom.

First off, what if I wanted to change the glow color of certain items such as health & armor bonuses? Let's say I wanted to change the glow color of the health bonus from blue to orange, how would I do that?

Secondly, let's say if I wanted a tagged non-monster object to activate a certain action or script when it enters a certain sector, and one result could be that the sector the object enters becomes deadly. I'm aware of the Actor enters sector (9998) action thing, but I'm still thinking about the right way to get a result I want.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Questions About Lights & Thing Enters Sector Activation

Post by Jarewill »

For the item lights, check the GLDEFS page on the wiki.
This is how you can add a light to an item:

Code: Select all

pointlight LIGHT1 //There are many types of lights, this is the most basic one
{
    color 1.0 0.5 0.0 //Color of light
    size 32 //Size of light
}
object HealthBonus
{
    frame BON1 { light LIGHT1 } //Attach LIGHT1 to all frames with BON1 (You can also specify a specific frame, such as BON1A)
}
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States
Contact:

Re: Questions About Lights & Thing Enters Sector Activation

Post by NiTROACTiVE »

Thank you Jarewill, that helps a lot.

I do however have a new problem with the GLDEFS. I want to add a glow effect to a enemy that replaces the sprites of the Imp, which is some glowing pig. Here's what I got for my script so far:

Code: Select all

pointlight TAIWPIG
{
    color 0.0 1.0 0.0
    size 96
    attenuate 1
}

object DoomImp
{
   frame TROOA { light TAIWPIG }
	frame TROOB { light TAIWPIG }
	frame TROOC { light TAIWPIG }
	frame TROOD { light TAIWPIG }
	frame TROOE { light TAIWPIG }
	frame TROOF { light TAIWPIG }
	frame TROOG { light TAIWPIG }
	frame TROOH { light TAIWPIG }
	frame TROOI { light TAIWPIG }
	frame TROOJ { light TAIWPIG }
	frame TROOK { light TAIWPIG }
	frame TROOL { light TAIWPIG }
	frame TROOM { light TAIWPIG }
}
The code doesn't do anything as the pig won't glow. It's new fireballs glow just fine, but not the pig itself. What am I doing wrong?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Questions About Lights & Thing Enters Sector Activation

Post by Jarewill »

Seems to work fine to me.
Are you sure DoomImp isn't replaced? You have to write the name of the replaced class in that case.
I assume the GLDEFS file is loaded correctly, since the fireballs glow fine.
User avatar
NiTROACTiVE
Posts: 48
Joined: Sun Jan 13, 2019 12:02 am
Location: United States
Contact:

Re: Questions About Lights & Thing Enters Sector Activation

Post by NiTROACTiVE »

Jarewill wrote:Seems to work fine to me.
Are you sure DoomImp isn't replaced? You have to write the name of the replaced class in that case.
I assume the GLDEFS file is loaded correctly, since the fireballs glow fine.
Oops... :oops: I can't believe I didn't notice that before. :lol: It's fixed now, thanks for the help.
Post Reply

Return to “Scripting”