Page 1 of 2

Scripting: Nade triggering Light

Posted: Sat Jan 01, 2005 8:40 pm
by Cheetohs
Here is what i want to do (its a small screw around map that i made for a friend..), i made a soccer net and i want it so that when a nade is thrown into the net, a goal-light will flash.

How might i rig this up? Thanks.

Posted: Sat Jan 01, 2005 8:45 pm
by Rookie One.pl
FFS!!! Read the entity descriptions! Make a trigger_multiple, hit N and read what's there first (hint: a grenade is a projectile) instead of spamming the forum!!! :evil: :evil: :evil:

Posted: Sat Jan 01, 2005 9:15 pm
by Cheetohs
Look, I'm not very good (AT ALL) at scripting. I know nothing more than how to script a rotatingdoor, and even that i screw up on half the time! :P :lol: , I'm sorry if you consider this 'spamming' but what you said did not help me much. But thanks anyway for the impatient, somewhat-rude.. reply.

Posted: Sat Jan 01, 2005 9:27 pm
by Rookie One.pl
Geez... It has very little to do with scripting! Go to the entity properties, set the right spawnflags, in the script put a $grenade_trigger waittill trigger and then the light stuff! As for the light, don't tell me you don't know how to do it and where to look - it has been mentioned a thousand times! See any switchable light tutorial and you're going to know the drill...

And FFS PLEASE - develop a skill of finding a solution on your own...

<EDIT>Sorry for rudeness, but it's really annoying when someone asks a question without even trying to find a solution in all available sources... I think I've picked this up at Linux forums, ;) where you get flamed and RTFM-ed everytime you ask about something which is very obvious to the others. :) I learnt that asking the other people for help and spamming the forums should be the last resort thing. I know I tend to break this rule, too, but I really try to improve on that point. ;)

And remember: Use Google, Luke! 8-) Google is your friend...</EDIT>

Posted: Sat Jan 01, 2005 11:11 pm
by lizardkid
:shock:

it's brning in here...

ok Cheetohs, you have your net, make the light, just use a regular light entity for the light, give it a $targetname of goalLight1. now make a triger_multiple inside it, and hit "N" (for eNtities), now tick the checkbox marked PROJECTILES. now put in the key/value box $targetname - goalTrig

got it so far? yay!

and put this thread in the script.

Code: Select all

goalLight:

level.doTheLight = 1

while(level.doTheLight == 1)
{
$goalLight1 hide
$goalTrig waittil trigger
$goalLight show
wait 5
$goalLight hide
}

end
oh, and in your main: thread. put in the line

Code: Select all

thread goalLight
just before the "end"

Posted: Sun Jan 02, 2005 12:57 am
by Green Beret
i feel the love in here :shock:






:evil:

Posted: Sun Jan 02, 2005 1:08 am
by Cheetohs
<3

Arg, It didn't work.. the light is on to begin with and nothing happens when i throw a nade in the net.

Posted: Sun Jan 02, 2005 1:18 am
by lizardkid
hmmm... you ticked projectiles right? on the trigger...

lets see the script just to make sure you've got threads in the right places ;)

Posted: Sun Jan 02, 2005 11:55 am
by jv_map
Cool down Rookie One. I mean it. :!:

Posted: Sun Jan 02, 2005 2:41 pm
by Green Beret
yea,i seen the threads were called in the wrong place :wink:

Posted: Tue Jan 04, 2005 1:06 am
by Master-Of-Fungus-Foo-D
you cannot trigger a light entity(from my knowledge). The light is COMPILED into the map so therefore you cant do that. I think you have to use an fx/dummy.tik and do some trick with it.... mayb you need to pay it a dollar :P (lame joke)

(im searching for that old topic i asked.. or was it in the mapping forum :cry: )

Posted: Tue Jan 04, 2005 1:22 am
by wacko
Krane and I did an easy way for kind of triggering a light in containerz: we did show/hide brushes with a custom texture:

Code: Select all

textures/mgturret/leucht_blue
{
	qer_editorimage textures/mgturret/leucht_blue.tga
	surfaceparm nomarks
	q3map_surfacelight 10000
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/mgturret/leucht_blue.tga
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
	{
		map textures/mgturret/leucht_blue.tga
		blendfunc GL_ONE GL_ONE
	}
}
this might be fine for u too?! It isn't really 'shining' but looks burning atleast.

too bad, the mapping forum is absent (still thinking positive). there was a thread of mine called flickeing torch or dunno, where we (jv mostly) did a flickering light. This would be exactly what u need! Maybe i'll find something on my hdd...

Posted: Tue Jan 04, 2005 1:34 am
by wacko
eureka! I found jv's demo map!

The light there is flickering and would be easy to switch on and off! bad thing was that this light shines through walls (there's a bright circle on the back of the wall where the light is), because the light doesn't recognize the wall and the compiler doesn't know the light :wink: But this is prob no prob for u, is it?

here u are: jv's light.pk3. It got map, bsp (SP) and script. all u need!

Or:
Here's the script

Code: Select all

main:
	level waittill spawn
	
	// run thread for all lights
	for(local.i = 1; local.i <= $light.size; local.i++)
		$light[local.i] thread flicker
end

flicker:
	self light 1 0.8 1 128
	while(1)
	{
		wait (randomfloat 0.5)
		self lightRadius (randomfloat 128)
		waitframe // don't change the light within one frame
	}
end
The light itself is a script_model with targetname 'light' and a model 'lights/lightbulb_caged.tik'

Posted: Tue Jan 04, 2005 6:47 am
by Cheetohs
sounds great wacko.. thanks a lot.. ill put it to use as soon as i can.

Posted: Tue Jan 04, 2005 8:55 pm
by HDL_CinC_Dragon
wow, can cut the love in here with a butter knife. Rookie one, this is actually a moderate to expert script... if im not mistaking...