Scripting: Nade triggering Light

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Cheetohs
Brigadier General
Posts: 569
Joined: Sun Jan 04, 2004 6:01 am
Location: Minnesota
Contact:

Scripting: Nade triggering Light

Post 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.
.:c|H|EE|TO|H|s|:.
Image
Need a thorough map tester? Shine the Cheetohs signal!
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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:
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
Cheetohs
Brigadier General
Posts: 569
Joined: Sun Jan 04, 2004 6:01 am
Location: Minnesota
Contact:

Post 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.
.:c|H|EE|TO|H|s|:.
Image
Need a thorough map tester? Shine the Cheetohs signal!
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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>
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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"
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

i feel the love in here :shock:






:evil:
Image
User avatar
Cheetohs
Brigadier General
Posts: 569
Joined: Sun Jan 04, 2004 6:01 am
Location: Minnesota
Contact:

Post 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.
.:c|H|EE|TO|H|s|:.
Image
Need a thorough map tester? Shine the Cheetohs signal!
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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 ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Cool down Rookie One. I mean it. :!:
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

yea,i seen the threads were called in the wrong place :wink:
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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: )
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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...
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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'
User avatar
Cheetohs
Brigadier General
Posts: 569
Joined: Sun Jan 04, 2004 6:01 am
Location: Minnesota
Contact:

Post by Cheetohs »

sounds great wacko.. thanks a lot.. ill put it to use as soon as i can.
.:c|H|EE|TO|H|s|:.
Image
Need a thorough map tester? Shine the Cheetohs signal!
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post 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...
Image
Post Reply