.: ? How script_model emit light :. (incomplete script ...help) -1 reply

Please wait...


I use SDK editor only!

50 XP

30th May 2004

0 Uploads

1 Posts

0 Threads

#1 16 years ago

hi, In my Spearhead map the Allied can enter a bunker climbing a ladder from the basement. Would be nice if a light would start pulsating inside the bunker to tell "somebody is entering!". MY question: "How can I let a (red) light start pulsating slowly for 10 seconds when someone enters an area?" I made a Test map with the scriptinghelp from bdboger & Krane. There are 3 script_models, 3 static_lamp_lightbulb_caged_red & one trigger_multipe surronded by detailed iron walls in the map. Grab it here: http://members.websamba.com/Cigs-files/Test.rar (the trigger is located between the iron walls; you'll see.. ) Things I want it to do:

  • emit red light (radius: light/20)
  • make sound when going ON/OFF (*)
  • only either Allied or Axis... gets a printcenterscreen message "- Somebody enters the back off the bunker -"
  • only either Allied or Axis... can trigger the trigger_mulptiple (trigger only 1 off the teams can trigger)

(*) click -> ON , click -> OFF , ... ...same click sound as: - when you push Enter after typing an message to all ingame and you message appears. - when a console message to all appears --- I got helped at another forum! (.MAP) :) This is how it's set up; but not finished! SCRIPTING: bdbodger & Krane script_model: key: targetname value: pulslight key: model value: fx/dummy.tik trigger_multiple: key: targetname value: trigger_pulslight Code: [PHP] // 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 [/PHP] Look at my Test map first! then look at MY summary to see what still needs some work. MY summary: The script works! but it may not work when the map loads. only when trigger is touched. what is does & shouldn't do :( : -When the Test map loads it's like the script is loaded instantly. the dummy.tik's (3 in the map) show and hide again for 10 seconds wich it shouldn't do because it's not triggered yet!! (as if the thread runs 1 time) what it does & should do :) : -trigger_multiple works! (pulslight's pulsates for 10 seconds) -dummy.tik shows & hides again 10 seconds long what it doesn't do & should do : -scrip_model doesn't emit (red) light -there is no sound each time the "light" goes on Can anybody be of any kind of assistance? Thanks in advance. :talker: