Advanced Dynamic Light treatment in ACS

General discussion about DRD & website stuff.
DoomerMrT
Posts: 91
Joined: Thu Aug 09, 2007 19:07

Advanced Dynamic Light treatment in ACS

Post by DoomerMrT »

It is about to be able to define more colors than that RGB stuff at the dynamic light thing.
Since GZdoom has true color support, this could be done in a hexadecimal way via ACS.The command would look like this:

SetDynamicColor(tid, color);

tid = the thing ID of the dynamic light(if it's not a DL,then do nothing)
color = the dynamic light's color, what can be defined in hexadecimal form(F8G477 for example)


The color arg. of the script would override the defined color at the Dynamic thing.


Result: more colorful dynamic lights
User avatar
Enjay
Developer
Developer
Posts: 4723
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

I haven't tried this, but it might work. You can already set a thing's special, including arguments, so you might be able to use that to set the arguments that control light colours.
DoomerMrT
Posts: 91
Joined: Thu Aug 09, 2007 19:07

Post by DoomerMrT »

No way; the dynamic lights are using 3 args for their colors: Red, Green and Blue.Because of that, I don't think definiing a limebrown hexadecimal code to red would work.

EDIT: Yup, it doesn't work :?
Last edited by DoomerMrT on Sun Mar 23, 2008 14:31, edited 1 time in total.
User avatar
Enjay
Developer
Developer
Posts: 4723
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

Yes way :P You could (maybe) set all arguments with this:

http://zdoom.org/wiki/SetThingSpecial

SetThingSpecial (tid, 0, 255, 128, 64, 32, 16)

Or whatever values you needed.
DoomerMrT
Posts: 91
Joined: Thu Aug 09, 2007 19:07

Post by DoomerMrT »

Just tried it and no luck man.Even with quote marks.Try it, choose a weird color, it is not going to work.
User avatar
Enjay
Developer
Developer
Posts: 4723
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

Works for me, with a minor reservation. I can set different colours quite happily. However, changes to the "intensity" parameter do not seem to get applied so I can't change how big the light is.
DoomerMrT
Posts: 91
Joined: Thu Aug 09, 2007 19:07

Post by DoomerMrT »

Cool, now do it with codes including letters too! For example: FF33CC :)
User avatar
Enjay
Developer
Developer
Posts: 4723
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

But there's no need. FF=255, 33=51, CC=204
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Currently the lights don't check the args. I had to copy them to other variables because they were only bytes back then. However, in the mean time I expanded them to full ints.

I just might change it so that they are used directly for the light color again which would make this work.
User avatar
Enjay
Developer
Developer
Posts: 4723
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

The example attached above works - at least it works as I would have expected it to in both 2.2.0 and r69. ie a repeating script cycles the light through a few different colours by changing the RGB arguments. So it must be transferring some of the args somehow. The only thing that doesn't seem to change is the intensity.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Even better, Seems I already reverted the change and forgot about it... :)
Post Reply

Return to “General”