Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generalized Lighting Types
================================================================================================
Base = 0x2000 (8192 dec)
Max = 0x2F7F (12159 dec)
# Types = 3968 max
Bits
===================================================
D C B A 9 8 7 6 5 4 3 2 1 0
-------------------------------------
1 0 f f f 0 s s s l l l l l (for immediate level functions)
1 0 f f f 1 s s s t t y 0 0 (for target functions)
1 0 1 1 1 0 r s s l l l l l (for relative set and fade)
1 0 1 1 1 1 0 z z z z z z z (special function)
B-9 = Function
8 = Select target type (immediate light level (0) or built-in target type (1))
-------------------------------------------
7-5 = Speed select -OR-
7 = Select Relative Set (0) or Relative Fade (1)
6-5 = Speed select for relative fade
-------------------------------------------
4-0 = Immediate light level -OR-
4-3 = Target type
2 = Synch effect (where supported)
-------------------------------------------
Functions
=========
000 = Set light to level
001 = Fade light to level
010 = Start flicker from sector light to level
011 = Start strobe from sector light to level (if to target, and y = 1, sync to other strobe effects)
100 = Start glow from sector light to level
101 = Start randomized glow from sector light to level
110 = Start fire flicker from sector light to level
111 = Relative set or fade (r bit 0 = set; r bit 1 = fade) - NB: bit 8 cannot be 1 when f = 111
Speed (Except for Relative Fade)
=====
000 = Slowest
001 = Slower
010 = Slow
011 = Normal
100 = Fast
101 = Faster
110 = Fastest
111 = ????
For Relative Fade
=================
00 = Slow
01 = Normal
10 = Fast
11 = ????
Light level
===========
For all immediate level functions, the light level is an unsigned 5-bit value (0 to 31),
with value * 8 (ie, "31" = 248)
For relative set and fade, the light level is a signed 5-bit value (-16 to 15),
with value * 16 (ie, "8" = fade from sector level to sector level + 128)
Target Types
============
00 = Minimum neighboring sector light
01 = Maximum neighboring sector light
10 = Nearest neighboring sector light
11 = 255
Special Functions
=================
0 = Kill any lighting thinkers targeting tagged sector(s)
1 = Place any lighting thinkers targeting tagged sector(s) into stasis
2 = Resume any in-stasis lighting thinkers targeting tagged sector(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment