Trigger starts a pulsating (red) light ?

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Trigger starts a pulsating (red) light ?

Post by Cigs »

BDBODGER HELPED GETTING THIS TRIGGERED LIGHT TO WORK
(light will only go on when axis touch the trigger; easally be changed to only work when allies trigger it)
ALSO GOT HELPED GETTING AXIS & ALIES DOGS IN THE MAP

lo,

In my map the Allied can enter a bunker climbing a ladder from the basement. Would be nice if a light would start pulsating to tell somebody is entering.

How can I let a red light start pulsating slowly when someone enters an area?

I think I have to use a trigger, but don't know wich. (trigger_use, trigger_multiple ??) wich?
Give the trigger a target/startpulsate
Give the red light a targetname/startpulsate
CORRECT me if I'm wrong :!:

But How can I let it pulsate (go On & Off) ?
AND how can I let it stop pulsating after 15 seconds?
I also like to have a printmessage appear on the center off sreen off either only Axis or Allied.

:?:

Cheers!
Last edited by Cigs on Sat Jun 05, 2004 10:28 am, edited 1 time in total.
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

You need a trigger multiple. And the light should be a script model. Give the script model these key/values: targetname/startpulsate model/fx/dumy.tik and the trigger, targetname/pulsate_trigger.

Put this on the top of your thread (above level waittill spawn):
thread pulsate_prep
Now, in the very bottom of the script, try one of these:

1)
pulsate_prep:
$pulsate_trigger setthread pulsate
$startpulsate light(1 0 0)
$startpulsate lightRadius 77 // CONTROL THE RADIUS OF THE LIGHT
$startpulsate notsolid
$startpulsate lightoff

pulsate:
$pulsate_trigger waittill trigger
local.player=parm.other
if (local.player istouching $pulsate_trigger )
{
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
}
else
{
$startpulsate lightoff
}
wait .5
end
2)
pulsate_prep:
$pulsate_trigger setthread pulsate
$startpulsate light(1 0 0)
$startpulsate lightRadius 77 // CONTROL THE RADIUS OF THE LIGHT
$startpulsate notsolid
$startpulsate lightoff

pulsate:
$pulsate_trigger waittill trigger
local.player=parm.other
if (local.player istouching $pulsate_trigger )
{
$startpulsate lighton
wait 1
$startpulsate lightoff
wait 1
}
while (local.player istouching $pulsate_trigger )
{
wait 15
}

$startpulsate lightoff

wait .5
end
You can try "while" instead of "if" in the 1st option, dunno...And I didn't test this so use w/ caution.

Hope that helps!
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can make a trigger_multiple and use setthread to run a thread and make it pulse . For the pulse you can make a script_model models/fx/corona_red.tik for each of the lights all with the same targetname such as $mycoronas

Code: Select all


thread:

if (level.pulseing == 1) // allows only one thread to run
end

level.pulseing = 1

local.timer = 0

while(local.timer < 15)
{

for(local.c = 1;local.c <= $mycoronas.size;local.c++)
$mycoronas[local.c] hide

wait .5

for(local.c = 1;local.c <= $mycoronas.size;local.c++)
$mycoronas[local.c] show

wait .5

local.timer++
}

level.pulseing = 0

end
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

[i]model/fx/dumy.tik [/i] ?

Post by Cigs »

Aaaight :P
Great guys!

Krane, I'm gonna test your sugestion first.

But I do not understand how to use the model/fx/dumy.tik you described as ...
Give the script model these key/values: targetname/startpulsate model/fx/dumy.tik

Now should I fill in startpulsate model/fx/dumy.tik as value for the script model its targetname?

Or something totally different ?

Looks like nice scripts! ... still gt alot to learn but I'm getting there now :)
But I have trouble understanding bdbodger Code. :roll:
And it would be nice if you guys could help me a bit more getting the script model & trigger_multiple to do there job. :]
Thanks for helping out :)
Peace out!
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Right-click on the 2d window and select script>model...Then, give 'em these key/values
key:targetname
value:startpulsate

press enter...and

key:model
value:fx/dummy.tik

press enter

This script model will be the light, place it anywhere you want the light to appear...And place the trigger somewhere in the stairs/ladder, so the player can activate.

:wink:

ps: waht bdbodger meant was similar...Place a script model and give these key/values

key:targetname
value:mycorona

key:model
value:fx/corona_red.tik

Then, in your trigger, put this key/value

key:setthread
value:thread

and, in the bottom of the script, paste his thread...

bdb is a better scripter, I'll give his method a chance :wink:
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

bdbodger script worked in combination with your fx/dummy.tik

Post by Cigs »

bdbodger script worked in combination with the fx/dummy.tik

Though it pulsated for 15 seconds when I spawned. (before I triggered it) :?

But the trigger worked fine! Each time I touched the trigger ... the fx/dummy.tik "pulsated" (showed itself - didn't show itself)
But the fx/dummy.tik didn't seem to emit any (red) light. :?

Image

The second part off the picture I tried to reach bdbodger method (like he said)
something strange went on in the editor:


When I apply model/fx/corona_red.tik the script_model disappears.
Though my filters were all unvinked. It just "stops showing itself".

And when the corona_red.tik did show up, it dissapears as soon as I press ESC, to deselect and create another one.


Don't know what's wrong!?

Here's my Test map: ftp://Cigs-files:Dc5335@ftp03.websamba. ... s/Test.rar



Krane, there is a little mistakes in you post. adjust them for other vieuwers
key:targetname
value:mycorona
should be:

key:targetname
value:mycoronas

k

thx alot ! :D
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Don't use 'thread' as a value. That's a command and can cause problems...
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Your link does not work but I was able to guess the right link

http://members.websamba.com/Cigs-files/Test.rar
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well I tested my script useing the models/fx/corona_red.tik it seems that when you try to make it a script_model or script_object the origin all of a sudden goes to 9999 9999 9999 , strange . So I did it without makeing it a script_model and it works just fine . If you want them to start off then put

for(local.c = 1;local.c <= $mycoronas.size;local.c++)
$mycoronas[local.c] hide

at the top of your script and in the thread you can reverse it so it shows first and then hides last . Also when you make maps for spearhead you should say that is what you are mapping for people will assume you are mapping for mohaa .
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Could you send me the map back? (msn or mIRC)

Post by Cigs »

Tried it with adding static_corona_reg (changed it to model/fx/corona_red.tik), but didn't work

---

Tried with fx/dummy.tik: it works, but it doesn't emit (red) light:

:arrow: script_model:

key:targetname
value:pulslight

key:model
value:fx/dummy.tik

(you said models/value)(isn't it model/value)


:arrow: trigger_multiple:

key:targetname
value:trigger_pulslight

Code: Select all

// MAPNAME: Test 
// ARCHITECTURE: Cigs 
// SCRIPTING: bdbodger & Krane 

main: 

// set scoreboard messages 
setcvar "g_obj_alliedtext1" "Test" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 
setcvar "g_obj_axistext1" "Test" 
setcvar "g_obj_axistext2" "" 
setcvar "g_obj_axistext3" "" 

setcvar "g_scoreboardpic" "" 


level waitTill prespawn 


//*** Precache Dm Stuff 
exec global/DMprecache.scr 


level.script = maps/dm/Test.scr 


// prep 

thread pulsate_prep


level waittill spawn 


pulsate_prep: 
$trigger_pulslight setthread startpulsate 
$pulslight light(1 0 0) 
$pulslight lightRadius 20 // CONTROL THE RADIUS OF THE LIGHT 
$pulslight notsolid 
$pulslight lightoff 

for(local.c = 1;local.c <= $pulslight.size;local.c++) 
$pulslight[local.c] hide 


startpulsate: 

if (level.pulseing == 1) // allows only one thread to run 
end 

level.pulseing = 1 

local.timer = 0 

while(local.timer < 10) 
{ 

for(local.c = 1;local.c <= $pulslight.size;local.c++) 
$pulslight[local.c] show 

wait .5 

for(local.c = 1;local.c <= $pulslight.size;local.c++) 
$pulslight[local.c] hide 

wait .5 

local.timer++ 
} 

level.pulseing = 0 

end 

:!: I changed (local.timer < 10)!
:!: trigger works!
:!: it pulsates when triggered!
:?: :? it also still pulsates after the map loaded (as if the thread runs 1 time)
:?: :? it doesn't emit light

How did you make it work fine :D
Can you send me the Test map back?
:arrow: Maybe thrue MSN or mIRC...
Last edited by Cigs on Sun May 30, 2004 6:32 pm, edited 7 times in total.
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

actually I also wanted the following:

- emit red light (radius: light/20)
- make sound when going ON/OFF (*)
- only either Allied or Axis... gets a printcenterscreen message "Intruder Allert"
- only either Allied or Axis... can trigger the trigger_mulptiple

(*) click -> ON , click -> OFF , ...
same click sound as... when you push Enter after typing an message to all ingame and you message appears.
same click sound as... a console message to all

possible?
:roll:
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well you can use both I think the red corona looks cool . When you make a light with the fx/dummy.tik they way you are doing it don't use hide and show just use lighton and lightoff .
Image
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

I got some where, but...

Post by Cigs »

fantastic! :D
What would I do without you...
...yes, I'dd be searching for a long time...

hehe, thanks alot !

that almost did the trick :] ...


? the dummy emits light! ...but only on my weaponmodel :s not on walls :(

? it still go's on & off for 10 sec when map loads (without triggering)

? i added a message/somebody is entering the bunker to the trigger_pulslight. the message keeps flickering on screen aslong as I stay in the trigger. it doesn't print once.


Image


? the trigger works. sets off the thread. but the light go's on & off faster now :? (as fast as the message flickers) (it does: start thread, start thread, start thread, start thread,... as long as I touch the trigger_pulsate)
It is like the trigger executes the thread repetative. (maybe nottriggerable could be of use... in any way?)

can you help?

almost... :)
Last edited by Cigs on Mon May 31, 2004 11:29 am, edited 7 times in total.
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

pulslight.map pulslight.scr

Post by Cigs »

:arrow: script_model:

key:targetname
value:pulslight

key:model
value:fx/dummy.tik


:arrow: trigger_multiple:

key:targetname
value:trigger_pulslight



Code: Select all

level waitTill prespawn 


//*** Precache Dm Stuff 
exec global/DMprecache.scr 


level.script = maps/dm/pulslight.scr 


// prep
 
$pulslight light(1 0 0) 
$pulslight lightRadius 20 // CONTROL THE RADIUS OF THE LIGHT 
$pulslight notsolid 
$pulslight lightoff 

level waittill spawn 


end

//--------------------------------------------------------------

trigger_pulslight: 

if (level.pulseing == 1) // allows only one thread to run 

level.pulseing = 1 

local.timer = 0 

while(local.timer < 10) 
{ 

for(local.c = 1;local.c <= $pulslight.size;local.c++) 
$pulslight[local.c] lighton 

wait .5 

for(local.c = 1;local.c <= $pulslight.size;local.c++) 
$pulslight[local.c] lightoff 

wait .5 

local.timer++ 
} 

level.pulseing = 0 

end 
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

try this and maybe move the light around a bit to get the best effect and try different radiuses for the light

Code: Select all

trigger_pulslight:

if !(level.pulseing == 1) // allows only one thread to run
{
	level.pulseing = 1

	local.timer = 0

	while(local.timer < 10)
	{

	for(local.c = 1;local.c <= $pulslight.size;local.c++)
	$pulslight[local.c] lighton

	wait .5

	for(local.c = 1;local.c <= $pulslight.size;local.c++)
	$pulslight[local.c] lightoff

	wait .5

	local.timer++
	}
level.pulseing = 0
}

end
Image
Post Reply