Glowing entities


(jaybird) #1

How do you set up an entity, say, a player, to glow similar to the way dynamite gives off a glow? I need this server-side. I see a few functions for dlights, but I haven’t a clue how to use them, especially on a player. I have tried using ent->constantlight (or something similiar, not sitting in front of the code right now) without any luck, though I might have used it incorrectly.

Thanks.


(jaybird) #2

I’m on the right track. If I set ent->s.constantLight = color value, the glow will turn on ONLY after you die. I guess I now need to know how to make it take immediate effect?


(djmels) #3

hmm… cool for making a religious mod :wink: kinda “walk towards the light, go ahead, walk!”


(jaybird) #4

Heh yeah, just another shrub feature I wanted to implement. Still can’t figure out how to make the constantlight take effect…


(Jaquboss) #5

it cant glow similar way like dynamite cos dynamite light is clientside , but how about spawning some dlight entity with these players ?


(jaybird) #6

I don’t know how to use dlights. Could you enlighten me?


(jaybird) #7

Thought I’d revive an old thread.

I am still having issues getting glow to work, but I’m close. In ps2es and ps2esextrapolate, if I manually set s->constantLight to a valid value, players will glow whatever color I gave them. The problem I’m having is getting that to work from the game code. Perhaps it’s my lack of understanding the relationship between game and cgame player states, but I cannot seem to assign a value somewhere in game code and manage to get that value to the entitystate in cgame.

Essentially, I need to get entitystate->contantLight set to a value from game, but cannot figure out what mechanism I need to do so. Any suggestions?


(ensiform) #8

um if u were using your constant light thing like you were, that really cannot work because u need a clientmod for that also, as it uses the dlight trap on the client and they prolly wont see it. you could try the dynamite without the pulsing thing though.


(ensiform) #9

in InitMoverRotate you will find:

	// if the "color" or "light" keys are set, setup constantLight
	lightSet = G_SpawnFloat( "light", "100", &light );
	colorSet = G_SpawnVector( "color", "1 1 1", color );
	if ( lightSet || colorSet ) {
		int		r, g, b, i;

		r = color[0] * 255;
		if ( r > 255 ) {
			r = 255;
		}
		g = color[1] * 255;
		if ( g > 255 ) {
			g = 255;
		}
		b = color[2] * 255;
		if ( b > 255 ) {
			b = 255;
		}
		i = light / 4;
		if ( i > 255 ) {
			i = 255;
		}
		ent->s.constantLight = r | ( g << 8 ) | ( b << 16 ) | ( i << 24 );
	}

(jaybird) #10

I guess I could rig it up in the client, but it is possible without a client mod (though I do have client side stuff). Look at Shrub, for example. As long as I can get the value to ps2es, the constantlights work correctly. But how to get it there is the question.


(Jaquboss) #11

can’t you use some ps thing ( i guess that int holding or something like that ) and then convert it in ps2es ?


(jaybird) #12

I’ve tried with no luck. In clientspawn, I set ent->client->ps.holding = (255 << 8) + (255 << 24), which should give a rather large bright green glow, but it never seems to work, unless I manually assign that value in ps2es. Something’s getting lost on its way to that function.


(IneQuation) #13

Any news on this? I’m trying to do a similar thing, but the glow doesn’t appear at all. :disgust:


(Fusen) #14

I’d suggest once getting this working to get a mapper to create a VERY dark map, for some nice old glow in the dark pwnage \o/


(Jaquboss) #15

Fusen that will not work …


(jaybird) #16

Yeah it will. Glow looks pretty awesome in the dark parts of Gold Rush.


(IneQuation) #17

Alright, but have you got it working? FAKK2’s got a script command that makes any entity shine a dynamic light, I traced it all the way back from it in the source and applied the same method in ET, but it doesn’t seem to work…


(jaybird) #18

Nope, I’m just missing one piece of the puzzle here: how to get an assigned value from game code to es->constantLight in cgame. If someone could enlighten me as such, I would be done.


(Jaquboss) #19

No , it will not work , because ET DL system doesnt lit really dark areas , and goldrush is IMO light…
I said it already that ET dlights are weird , didnt I ?


(ensiform) #20

yes jaq we know that only already lit places can glow with dlights… the only thing u could do maybe but i doubt it is to hack in a actual “light” entity… not even sure if the game would even be able to use it.