• Do not use Works in Progress as a way of avoiding the releases system! Works in Progress can be used for sharing early betas and for getting suggestions for improvement. Releases of finished content are not allowed in this forum! If you would like to submit a finished addon, click here for instructions on how to do so.

Attaching OpenGL lights to Things

Status
Not open for further replies.

Eidolon

Developer
Sonic Team Junior
Kart Krew™️
What SOC input do you have to do to attach a light to a thing?

Also, how do I convert corona colors?
 
To edit a light:

LIGHT x
if(!strcmp(word, "TYPE")) lspr[num].type = (USHORT)value;
else if(!strcmp(word, "OFFSETX")) lspr[num].light_xoffset = fvalue;
else if(!strcmp(word, "OFFSETY")) lspr[num].light_yoffset = fvalue;
else if(!strcmp(word, "CORONACOLOR")) lspr[num].corona_color = value;
else if(!strcmp(word, "CORONARADIUS")) lspr[num].corona_radius = fvalue;
else if(!strcmp(word, "DYNAMICCOLOR")) lspr[num].dynamic_color = value;
else if(!strcmp(word, "DYNAMICRADIUS")) lspr[num].dynamic_radius = fvalue;


------------------------------------------------------------------------------------
To attach a light:

SPRITE x (number of the SPR_ sprite)
LIGHTTYPE = y (light number from above)

I think Blaze has a SOC posted in the archives if you need an example.
 
SSNTails said:
To edit a light:

LIGHT x
if(!strcmp(word, "TYPE")) lspr[num].type = (USHORT)value;
else if(!strcmp(word, "OFFSETX")) lspr[num].light_xoffset = fvalue;
else if(!strcmp(word, "OFFSETY")) lspr[num].light_yoffset = fvalue;
else if(!strcmp(word, "CORONACOLOR")) lspr[num].corona_color = value;
else if(!strcmp(word, "CORONARADIUS")) lspr[num].corona_radius = fvalue;
else if(!strcmp(word, "DYNAMICCOLOR")) lspr[num].dynamic_color = value;
else if(!strcmp(word, "DYNAMICRADIUS")) lspr[num].dynamic_radius = fvalue;

I think you just combined C++ with SOC.
 
Oops, it looks true. However, for some reason the SOC Editor asks for the sources, is there some reason?
 
furyhunter600 said:
I think you just combined C++ with SOC.

I was hoping you'd know what I mean. Those are the properties for a light.


i.e.,


LIGHT 5
DYNAMICRADIUS = 4
OFFSETX = 0
OFFSETY = 8
 
I'm not a person who knows C++ by heart, but surprisingly I understood some of the code after reading it over. HOWEVER, this doesn't mean i'm buying a 700+ page book for learning it ^_^

Anyway, thanks. This'll be useful for the multiplayer construction kit I was building.
 
Better not buy one. And you can't understand C++ without know C. I know by experience. However, I had a Pascal book of about 2000 pages... and I don't know how did I for read it in only one day o_O (it's not a joke) Yeah, looks strange, but I didn't learn much :P Just after it I read it again, but with more patience.
 
Speaking of lights, is it possible to get a different light on individual frames of an object? Specifically, Invincibility stars.
 
On frames, no. On sprites, yes. Super Sonic's golden light is sprite-based, so anyone using PLAY sprites (Or frames that use PLAY sprites if you're not using a skin, at least) will glow yellow while someone else is super. Which is an oddity I really hope there is a way to fix soon, if by inventing the ability to add OGL lights to individual frames.
 
That's not C++...

Anyway, unless every single last one of the codepointers and frame flags in the original DOOM.EXE file have been completely ripped out of the SRB2 source, there's a flag you can set for any frame to make them light up, and if you do some certain specialized codepointer hacks you can make something resembling lights-per-frame; check the frametable in DEHACKED.EXE to see what I'm talking about. It is by no means an OpenGL light, but it's there if you guys want to toy around with it in Software mode.
 
Oh, I see. I think you're talking about the fullbright option for frames. I think they want to make fancy dynamic/corona OGL colored lighting.
 
The Corona colors question wasn't answered...

Anyway, the golden sprite SS glitch is really annoying in coop MR4
 
Corona/Dynamic colors seem to be different from HTML. Can I have a little help on this?
 
Wow, OpenGL is SOOOOO freaked out!

Two things I have learned about OpenGL here:

1. Z axis (up and down) is flipped, meaning when you add 64 to the Z, you go... Up?
2. Corona/Dynamic lighting colors are BGR instead of RGB.
 
furyhunter600 said:
1. Z axis (up and down) is flipped, meaning when you add 64 to the Z, you go... Up?

.. don't things USUALLY go up when you add on to the height? >_>
 
Actually, I wasn't talking about SRB2. I was talking about OpenGL coding itself.
 
The OpenGL coordinate system makes sense from a mathematical standpoint, where higher Y (or Z, but I'm going to say Y just because) goes up and vice versa. If you're used to 2D gaming, though, were higher Y means going down, you can get confused pretty quickly.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top