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.

Questions About Lights & Thing Enters Sector Activation

Postby NiTROACTiVE » Mon Feb 22, 2021 12:20 am

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.
User avatar
NiTROACTiVE
Radioactive & Explosive
 
Joined: 13 Jan 2019
Location: United States

Re: Questions About Lights & Thing Enters Sector Activation

Postby Jarewill » Mon Feb 22, 2021 5:05 am

For the item lights, check the GLDEFS page on the wiki.
This is how you can add a light to an item:
Code: Select allExpand view
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)
}
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Questions About Lights & Thing Enters Sector Activation

Postby NiTROACTiVE » Mon Feb 22, 2021 7:50 pm

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 allExpand view
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?
User avatar
NiTROACTiVE
Radioactive & Explosive
 
Joined: 13 Jan 2019
Location: United States

Re: Questions About Lights & Thing Enters Sector Activation

Postby Jarewill » Tue Feb 23, 2021 12:48 am

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.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Questions About Lights & Thing Enters Sector Activation

Postby NiTROACTiVE » Tue Feb 23, 2021 7:31 pm

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.
User avatar
NiTROACTiVE
Radioactive & Explosive
 
Joined: 13 Jan 2019
Location: United States


Return to Scripting

Who is online

Users browsing this forum: Mikk- and 1 guest