Page 1 of 1

Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 4:19 am
by Kzer-Za
You can create Modeldefs for 3D models and assign them sprite names there, but will the lights from GLDEFS be applied to them, or do they apply only to actual sprites?

Re: Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 5:27 am
by Graf Zahl
Yes, they just apply the same.

However, if you create custom content you may save yourself some work and attach the lights to the actual ZSCript or DECORATE definition by adding the 'light(lightnsme)' keyword to the states themselves. Check out the StrifeHumanoid class for an example.

Re: Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 5:31 am
by Kzer-Za
Thanks!

Re: Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 11:14 am
by Kzer-Za
And are these lights applied to HUD weapons? I'm trying to make a weapon emit a light when Altfire is held for some time, but I don't see the light, though the same light, when it's attached to its ammo I do see. Here's the light:

Code: Select all

pointlight GOLDWANDCRYSTAL1
{
    color 0.7 0.5 0.0
    size 26
    offset 0 26 0
}
Here's the hold state:

Code: Select all

	AltHold:
		GWND A 1 Light("GOLDWANDCRYSTAL1")
		GWND A 1 Light("GOLDWANDCRYSTAL1") A_Refire("AltHold")
		GWND A 1 Offset(0, 33) // I haven't made the shot itself yet
		Goto Ready
The idea is that the weapon stays emitting the light while the altfire is held, and the shot is made when it's released. But I don't see the light, though it's noticeable when coming from ammo.

Re: Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 12:30 pm
by Graf Zahl
The HUD sprites are not part of an actor - you cannot attach lights to them - this will just be ignored.

Re: Do lights in GLDEFS apply to 3D models?

Posted: Tue Feb 12, 2019 12:40 pm
by Kzer-Za
Ah, okay. I guess for lighting up a weapon I can use something like

Code: Select all

GWND A 1 bright A_SpawnItemEx("some-object-with-attached-light-living-1-tic")