Spotlight

Post your scripting questions / solutions here

Moderator: Moderators

Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

Code: Select all

local.Nlighta = spawn script_object
local.Nlighta model "miscobj/searchlightoff.tik"
local.Nlighta.origin = ( -2015 -3070 0 ) 
local.Nlighta.angles = ( -45 -45 -80 ) 
local.Nlighta notsolid



//The light inside it is done like this 
local.light = spawn script_model 
local.light model "fx/searchlight.tik" 
local.light notsolid 
local.light.origin = local.Nlighta.origin + local.spot.forwardvector * -16 

//The beam is 
local.beam = spawn func_beam origin local.Nlighta.origin 
local.beam alpha .2 
local.beam maxoffset 0 
local.beam numsegments 20 
local.beam scale 50 
local.beam activate 
local.beam life .1 
local.beam color 1 0 0 // set a color r g b values 
local.beam endpoint local.p 

//The flare at the end of the beam is done like this 
local.flare = spawn script_model 
local.flare model "fx/searchlight.tik"
local.flare.origin = local.p 
local.flare notsolid 
local.flare scale 5 
local.flare light 1 0 0 // set a color r g b values 
local.flare lightradius 250 

//ending
local.groundspot_target = spawn script_origin 
local.groundspot_target.origin = local.Nlighta.origin + local.spot.forwardvector * -10240 
local.p = trace local.Nlighta.origin local.groundspot_target.origin 0 
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Umm, Is that the whole script?
If it is your missing a number of things.
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i don't want to give you the whole script because its for my server and i don't give it free. why do you want the whole script, isn't it enough...?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

no he wanted to know if that WAS the whole script. Most (if not all) new coders don't set their code up right, and it wont work. If that was your whole script of course it isnt working. so far it looks fine so it seems the bug is in a different part of your code, unended threads, wrong waittills, main thread messed up, etc.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

no that isn't my whole script, this i only the spotlight i heve set in my map.....
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

local.Nlighta = spawn script_object // local.Nlighta is the name of the spotlight
local.Nlighta model "miscobj/searchlightoff.tik"
local.Nlighta.origin = ( -2015 -3070 0 )
local.Nlighta.angles = ( -45 -45 -80 )
local.Nlighta notsolid



//The light inside it is done like this
local.light = spawn script_model
local.light model "fx/searchlight.tik"
local.light notsolid
local.light.origin = local.Nlighta.origin + local.spot.forwardvector * -16 // local.Nlighta is the name of the spotlight so change local.spot to local.Nlighta

//The beam is
local.beam = spawn func_beam origin local.Nlighta.origin
local.beam alpha .2
local.beam maxoffset 0
local.beam numsegments 20
local.beam scale 50
local.beam activate
local.beam life .1
local.beam color 1 0 0 // set a color r g b values
local.beam endpoint local.p // you can't do this until after you define what local.p is

//The flare at the end of the beam is done like this
local.flare = spawn script_model
local.flare model "fx/searchlight.tik"
local.flare.origin = local.p
local.flare notsolid
local.flare scale 5
local.flare light 1 0 0 // set a color r g b values
local.flare lightradius 250

//ending
local.groundspot_target = spawn script_origin
local.groundspot_target.origin = local.Nlighta.origin + local.spot.forwardvector * -10240 // local.Nlighta is the name of the spotlight so change local.spot to local.Nlighta
local.p = trace local.Nlighta.origin local.groundspot_target.origin 0
local.beam endpoint local.p // this line goes here now that you have defined local.p
local.flare.origin = local.p // you missed this line
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

he is not doing it..... :cry:
Old nickname: Bartjerambo
New nickname: Barttje
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

nothing you do seems to work :( I gave you how to do it now you have to find out what you did wrong .
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

ok, i give my whole script (some thread are hide.....!)
// Modified by: Bartjerambo

main:


// set scoreboard messages
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" "Modified by:"
setcvar "g_obj_axistext3" " Bartjerambo"

setcvar "g_scoreboardpic" "none"
setcvar "g_gametypestring" "* Crazy *"

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread



// Sounds
local.master = spawn scriptmaster
local.master aliascache siren sound/mechanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 300 15000 item streamed maps "m6l3a obj dm"
local.master aliascache radios sound/mechanics/Mec_RadioLoop_04.wav soundparms 1.0 0.0 1.0 0.0 200 1200 auto loaded maps "m dm moh obj "
local.master aliascache radio1a sound/dialogue/M3L3/A/dfr_m3l3_349o.wav soundparms 1.2 0.0 1.0 0.0 300 12000 dialog streamed subtitle "Already enroute to a target, Over." maps "m3l3 dm obj"
local.master aliascache turnSW sound/mechanics/hit_notify.wav soundparms 1.2 0.0 1.0 0.0 300 15000 item streamed maps "m6l3a obj dm"
// Threads
thread CRswitch



level waittill prespawn

$player giveall //this isn't doing it...?

//Crazy room
local.fire = spawn script_model
local.fire model "static/fire.tik"
local.fire.origin = ( -990 -3010 -57 )
local.fire.angles = ( 0 0 0 )
local.fire.scale = 1.0
local.fire notsolid
local.smoke = spawn script_model
local.smoke model "emitters/linger_smoke.tik"
local.smoke.origin = ( -990 -3010 15 )
local.smoke.angles = ( 0 0 0 )
local.post = spawn script_object
local.post model "static/signpost_caen.tik"
local.post.origin = ( -990 -3010 -57 )
local.post.angles = ( 0 0 0 )
local.post notsolid

local.fire2 = spawn script_model
local.fire2 model "static/fire.tik"
local.fire2.origin = ( -2541 1097 -53 )
local.fire2.angles = ( 0 0 0 )
local.fire2.scale = 1.0
local.fire2 notsolid
local.smoke2 = spawn script_model
local.smoke2 model "emitters/linger_smoke.tik"
local.smoke2.origin = ( -2541 1097 19 )
local.smoke2.angles = ( 0 0 0 )
local.post2 = spawn script_object
local.post2 model "static/signpost_caen.tik"
local.post2.origin = ( -2541 1097 -53 )
local.post2.angles = ( 0 0 0 )
local.post2 notsolid

/*
local.splighta = spawn script_object
local.splighta model "miscobj/searchlight.tik"
local.splighta.origin = ( -2015 -3070 0 )
local.splighta.angles = ( -45 -45 -80 )
local.splighta light 1 1 1 100
local.splighta notsolid
local.splighta targetname splight
local.splightb = spawn script_object
local.splightb model "miscobj/searchlight.tik"
local.splightb.origin = ( -2220 -3070 0 )
local.splightb.angles = ( 225 45 10 )
local.splightb light 1 1 1 100
local.splightb notsolid
local.splightb targetname splight
local.splightc = spawn script_object
local.splightc model "miscobj/searchlight.tik"
local.splightc.origin = ( -2220 -2890 0 )
local.splightc.angles = ( -45 135 20 )
local.splightc light 1 1 1 100
local.splightc notsolid
local.splightc targetname splight
local.splightd = spawn script_object
local.splightd model "miscobj/searchlight.tik"
local.splightd.origin = ( -2015 -2890 0 )
local.splightd.angles = ( 225 225 -90 )
local.splightd light 1 1 1 100
local.splightd notsolid
local.splightd targetname splight
*/

local.Nlighta = spawn script_object
local.Nlighta model "miscobj/searchlightoff.tik"
local.Nlighta.origin = ( -2015 -3070 0 )
local.Nlighta.angles = ( -45 -45 -80 )
local.Nlighta notsolid

local.Nlightb = spawn script_object
local.Nlightb model "miscobj/searchlightoff.tik"
local.Nlightb.origin = ( -2220 -3070 0 )
local.Nlightb.angles = ( 225 45 10 )
local.Nlightb notsolid
local.Nlightc = spawn script_object
local.Nlightc model "miscobj/searchlightoff.tik"
local.Nlightc.origin = ( -2220 -2890 0 )
local.Nlightc.angles = ( -45 135 20 )
local.Nlightc notsolid
local.Nlightd = spawn script_object
local.Nlightd model "miscobj/searchlightoff.tik"
local.Nlightd.origin = ( -2015 -2890 0 )
local.Nlightd.angles = ( 225 225 -90 )
local.Nlightd notsolid



//The light inside it is done like this
local.light = spawn script_model
local.light model "fx/searchlight.tik"
local.light notsolid
local.light.origin = local.Nlighta.origin + local.spot.forwardvector * -16 // local.Nlighta is the name of the spotlight so change local.spot to local.Nlighta

//The beam is
local.beam = spawn func_beam origin local.Nlighta.origin
local.beam alpha .2
local.beam maxoffset 0
local.beam numsegments 20
local.beam scale 50
local.beam activate
local.beam life .1
local.beam color 1 0 0 // set a color r g b values
local.beam endpoint local.p // you can't do this until after you define what local.p is

//The flare at the end of the beam is done like this
local.flare = spawn script_model
local.flare model "fx/searchlight.tik"
local.flare notsolid
local.flare scale 5
local.flare light 1 0 0 // set a color r g b values
local.flare lightradius 250

//ending
local.groundspot_target = spawn script_origin
local.groundspot_target.origin = local.Nlighta.origin + local.spot.forwardvector * -10240 // local.Nlighta is the name of the spotlight so change local.spot to local.Nlighta
local.p = trace local.Nlighta.origin local.groundspot_target.origin 0
local.beam endpoint local.p // this line goes here now that you have defined local.p
local.flare.origin = local.p // you missed this line



local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid



//Normale Objects

local.obj1 = spawn script_object
local.obj1 model "static/static_radiostation1.tik"
local.obj1.origin = ( -830 -900 35 )
local.obj1.angles = ( 0 0 0 )
local.obj1 solid



//Allied call
local.table = spawn script_object
local.table model "static/worktable.tik"
local.table.origin = ( -1605 -3065 -20 )
local.table.angles = ( 0 180 0 )
local.table solid

local.radio = spawn script_model
local.radio model "miscobj/radio_military.tik"
local.radio.origin = ( -1610 -3050 29 )
local.radio.angles = ( 0 235 0 )
local.radio solid
local.radio targetname radio
local.microphone = spawn models/static/microphone.tik origin ( -1625 -3065 29 ) angles ( 0 235 0 ) "targetname" "radio"


local.Pradio = spawn script_model
local.Pradio model "animate/pulse_military_radio.tik"
local.Pradio.origin = ( -1610 -3050 29 )
local.Pradio.angles = ( 0 235 0 )
local.Pradio solid
local.Pradio targetname Pradio

//local.planeA = spawn script_object
//local.planeA model "vehicles/p47fly.tik"
//local.planeA.origin = ( -25.66 -4604.91 864 )
//local.planeA.angles = ( 0 107.08 0 )
//local.planeA solid
//local.planeA hide
//local.planeA targetname PlaneA



//Triggers
local.trigCR = spawn trigger_multiple
local.trigCR.origin = ( -990 -3010 -57 )
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR setthread Peace_room
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR wait 0
local.trigCR delay 0
local.trigCR2 = spawn trigger_multiple
local.trigCR2.origin = ( -2541 1097 -53 )
local.trigCR2 setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR2 setthread Peace_room
local.trigCR2 message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR2 wait 0
local.trigCR2 delay 0

local.trigAC = spawn trigger_use
local.trigAC.origin = ( -1630 -3050 33 )
local.trigAC setsize ( -5 -5 -5 ) ( 0 0 0 )
local.trigAC setthread Allied_call
local.trigAC wait 120
local.trigAC delay 0


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

exec global/door_locked.scr::lock

level waittill spawn

thread loophere


end

//ive had problems looping sounds and stuff out of waittill spawn
loophere:
wait 1
$radio loopsound radios
end



//Trigger places
Peace_room:
local.player = parm.other
if (local.player.isTrigger1==1)
end

local.player.isTrigger1 = 1
local.player tele ( -2120 -3005 -120 )
local.player stopwatch 30
local.player takeall
local.player light 1 0 1 250
wait 5
local.player stufftext "say Oh no, i'm getting crazy..!"
wait 25
local.player lightoff
local.player respawn
local.player.isTrigger1 = 0

end


Allied_call:
$trigAC waittill trigger
if(parm.other.dmteam == allies)
{
iprintlnbold_noloc "The Americans are trying to call an airstrike!!!"
$Pradio hide
wait 1
$radio playsound radio1
wait 7
$radio playsound siren
Wait 2
thread planeA
wait 110
$Pradio show
}
else
{
iprintlnbold_noloc "The Germans are trying to call an airstrike!!!"
$Pradio hide
wait 5
local.player stufftext "say Oh no, i can't get contact with our base!"
$Pradio show
}
end





CRswitch:

local.lite = spawn script_model model "fx/dummy.tik" "targetname" "Slight"
local.lite.origin = ( -2117 -2950 -140 )
local.lite light 1 1 1 300

local.ltsw1 = spawn trigger_use
local.ltsw1.origin = ( -2020 -3000 -55 )
local.ltsw1 setsize ( -1 -1 -2 ) ( 1 1 2 )
local.ltsw1 targetname litsw

local.static1 = spawn script_model
local.static1 model "animate/electrical_switch_nopulse.tik"
local.static1.origin = ( -2020 -3000 -55 )
local.static1.angles = ( 0 0 0 )
local.static1 solid
local.static1 scale 5
local.static1 targetname lightswitch

thread CRlight
end

CRlight:
level.litsw = 1

while(1)
{
$litsw waittill trigger
if(level.litsw == 1)
{
$lightswitch playsound alarm_switch
$lightswitch anim turn
$Slight hide
$splight hide
$splight light 0 0 0 0
level.litsw = 0
}
else
{
$lightswitch playsound alarm_switch
$lightswitch anim off
$Slight show
$splight show
$splight light 9 9 9 100
level.litsw = 1
}
}
end


planeA:
//$PlaneA show
local.org1 = spawn info_splinepath "targetname" "strafe_path"
local.org1 model "vehicles/p47fly.tik"
local.org1.origin = ( -25.66 -4604.91 864 )
local.org1.angles = ( 0 107.08 0 )
local.org1.set = 1
local.org1.planescale = .4
local.org1.strafe_path.speed = .9
local.org1.guns = 0

local.org2 = spawn info_splinepath "targetname" "node2"
local.org2.origin = ( -1482 -2358 1171)
local.org2.angles = (45 118 10)
local.org2.set = 1
local.org2.planescale = .4
local.org2.strafe_path.speed = .9
local.org2.guns = 0
local.org3 = spawn info_splinepath "targetname" "node3"
local.org3.origin = ( -2093 -1184 872)
local.org3.angles = (25 96 55)
local.org3.set = 1
local.org3.bomb = 1
local.org3.planescale = .4
local.org3.strafe_path.speed = .9
local.org3.guns = 1
local.org4 = spawn info_splinepath "targetname" "node4"
local.org4.origin = ( -2095 -422 872)
local.org4.angles = (25 96 55)
local.org4.set = 1
local.org4.planescale = .4
local.org4.strafe_path.speed = .9
local.org4.guns = 1
local.org5 = spawn info_splinepath "targetname" "node5"
local.org5.origin = ( -1659 4 872)
local.org5.angles = (0 18 55)
local.org5.set = 1
local.org5.bomb = 1
local.org5.planescale = .4
local.org5.strafe_path.speed = .9
local.org5.guns = 1
local.org6 = spawn info_splinepath "targetname" "node6"
local.org6.origin = ( -915 6 872)
local.org6.angles = (0 26 0)
local.org6.set = 1
local.org6.planescale = .4
local.org6.strafe_path.speed = .9
local.org6.guns = 0
local.org7 = spawn info_splinepath "targetname" "node7"
local.org7.origin = ( -339 161 872)
local.org7.angles = (0 57 -65)
local.org7.set = 1
local.org7.planescale = .4
local.org7.strafe_path.speed = .9
local.org7.guns = 1
local.org8 = spawn info_splinepath "targetname" "node8"
local.org8.origin = ( -110 988 872)
local.org8.angles = (0 90 0)
local.org8.set = 1
local.org8.planescale = .4
local.org8.strafe_path.speed = .9
local.org8.guns = 0
local.org9 = spawn info_splinepath "targetname" "node9"
local.org9.origin = ( -248 1576 872)
local.org9.angles = (0 85 45)
local.org9.set = 1
local.org9.planescale = .4
local.org9.strafe_path.speed = .9
local.org9.guns = 1
local.org10 = spawn info_splinepath "targetname" "node10"
local.org10.origin = ( -64 2142 872)
local.org10.angles = (0 30 70)
local.org10.bomb = 1
local.org10.set = 1
local.org10.planescale = .4
local.org10.strafe_path.speed = .9
local.org10.guns = 1
local.org11 = spawn info_splinepath "targetname" "node11"
local.org11.origin = (855 2250 872)
local.org11.angles = (0 0 45)
local.org11.bomb = 1
local.org11.set = 1
local.org11.planescale = .4
local.org11.strafe_path.speed = .9
local.org11.guns = 0
local.org12 = spawn info_splinepath "targetname" "node12"
local.org12.origin = (1725 2336 882)
local.org12.angles = ( -25 0 0)
local.org12.set = 1
local.org12.planescale = .4
local.org12.strafe_path.speed = .9
local.org12.guns = 0
local.org13 = spawn info_splinepath "targetname" "node13"
local.org13.origin = (4106 2703 1395)
local.org13.angles = ( -45 0 0)
local.org13.set = 1
local.org13.planescale = .4
local.org13.strafe_path.speed = .9
local.org13.guns = 0
local.org1.target = local.org2
local.org2.target = local.org3
local.org3.target = local.org4
local.org4.target = local.org5
local.org5.target = local.org6
local.org6.target = local.org7
local.org7.target = local.org8
local.org8.target = local.org9
local.org9.target = local.org10
local.org10.target = local.org11
local.org11.target = local.org12
local.org12.target = local.org13
end



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

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn



// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end
[/b]
Last edited by Barttje on Mon Sep 19, 2005 3:23 pm, edited 1 time in total.
Old nickname: Bartjerambo
New nickname: Barttje
GiffE1118
Warrant Officer
Posts: 137
Joined: Fri Aug 05, 2005 12:14 am
Contact:

Post by GiffE1118 »

you didnt listen to what he had said.

think of it this way

You cant tell something that the endpoint is something that hasnt been found yet

local.p does not exist untill after u spawn the beam and the beam is suppose to end at local.p and that doesnt exist!!

Don't just copy and paste the code. he added comments to help you understand what wrong. so read it and fix what he has said to fix
www.95thDivision.com
Image

BOTTOM 125th Poster! lol
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i'm doing that, if it work ill remove the help.
Old nickname: Bartjerambo
New nickname: Barttje
GiffE1118
Warrant Officer
Posts: 137
Joined: Fri Aug 05, 2005 12:14 am
Contact:

Post by GiffE1118 »

try moving local.p and its stuff about it above the spawning of the beam
www.95thDivision.com
Image

BOTTOM 125th Poster! lol
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Ok, I went and made the changes that BD suggested.And the lights work.But i did notice that you have a switch to shut them off.It is hudge and was hard to turn on and off.Plus the local.flare stayed on the ground after the lights were shut off.Maybe you should ditch the switch.

Code: Select all

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Destroyed Village"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" "Modified by:"
setcvar "g_obj_axistext3" " Bartjerambo"

setcvar "g_scoreboardpic" "none"
setcvar "g_gametypestring" "* Crazy *"

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread



// Sounds
local.master = spawn scriptmaster
local.master aliascache siren sound/mehanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 300 15000 item streamed maps "m6l3a obj dm"
local.master aliascache radios sound/mechanics/Mec_RadioLoop_04.wav soundparms 1.0 0.0 1.0 0.0 200 1200 auto loaded maps "m dm moh obj "
local.master aliascache radio1a sound/dialogue/M3L3/A/dfr_m3l3_349o.wav soundparms 1.2 0.0 1.0 0.0 300 12000 dialog streamed subtitle "Already enroute to a target, Over." maps "m3l3 dm obj"
local.master aliascache turnSW sound/mechanics/hit_notify.wav soundparms 1.2 0.0 1.0 0.0 300 15000 item streamed maps "m6l3a obj dm"

level waittill prespawn

//Crazy room
local.fire = spawn script_model
local.fire model "static/fire.tik"
local.fire.origin = ( -990 -3010 -57 )
local.fire.angles = ( 0 0 0 )
local.fire.scale = 1.0
local.fire notsolid
local.smoke = spawn script_model
local.smoke model "emitters/linger_smoke.tik"
local.smoke.origin = ( -990 -3010 15 )
local.smoke.angles = ( 0 0 0 )
local.post = spawn script_object
local.post model "static/signpost_caen.tik"
local.post.origin = ( -990 -3010 -57 )
local.post.angles = ( 0 0 0 )
local.post notsolid

local.fire2 = spawn script_model
local.fire2 model "static/fire.tik"
local.fire2.origin = ( -2541 1097 -53 )
local.fire2.angles = ( 0 0 0 )
local.fire2.scale = 1.0
local.fire2 notsolid
local.smoke2 = spawn script_model
local.smoke2 model "emitters/linger_smoke.tik"
local.smoke2.origin = ( -2541 1097 19 )
local.smoke2.angles = ( 0 0 0 )
local.post2 = spawn script_object
local.post2 model "static/signpost_caen.tik"
local.post2.origin = ( -2541 1097 -53 )
local.post2.angles = ( 0 0 0 )
local.post2 notsolid

local.splighta = spawn script_object
local.splighta model "miscobj/searchlight.tik"
local.splighta.origin = ( -2015 -3070 0 )
local.splighta.angles = ( -45 -45 -80 )
local.splighta light 1 1 1 100
local.splighta notsolid
local.splighta targetname splight
local.splightb = spawn script_object
local.splightb model "miscobj/searchlight.tik"
local.splightb.origin = ( -2220 -3070 0 )
local.splightb.angles = ( 225 45 10 )
local.splightb light 1 1 1 100
local.splightb notsolid
local.splightb targetname splight
local.splightc = spawn script_object
local.splightc model "miscobj/searchlight.tik"
local.splightc.origin = ( -2220 -2890 0 )
local.splightc.angles = ( -45 135 20 )
local.splightc light 1 1 1 100
local.splightc notsolid
local.splightc targetname splight
local.splightd = spawn script_object
local.splightd model "miscobj/searchlight.tik"
local.splightd.origin = ( -2015 -2890 0 )
local.splightd.angles = ( 225 225 -90 )
local.splightd light 1 1 1 100
local.splightd notsolid
local.splightd targetname splight

local.Nlighta = spawn script_object
local.Nlighta model "miscobj/searchlightoff.tik"
local.Nlighta.origin = ( -2015 -3070 0 )
local.Nlighta.angles = ( -45 -45 -80 )
local.Nlighta notsolid
local.Nlightb = spawn script_object
local.Nlightb model "miscobj/searchlightoff.tik"
local.Nlightb.origin = ( -2220 -3070 0 )
local.Nlightb.angles = ( 225 45 10 )
local.Nlightb notsolid
local.Nlightc = spawn script_object
local.Nlightc model "miscobj/searchlightoff.tik"
local.Nlightc.origin = ( -2220 -2890 0 )
local.Nlightc.angles = ( -45 135 20 )
local.Nlightc notsolid
local.Nlightd = spawn script_object
local.Nlightd model "miscobj/searchlightoff.tik"
local.Nlightd.origin = ( -2015 -2890 0 )
local.Nlightd.angles = ( 225 225 -90 )
local.Nlightd notsolid

//The light inside it is done like this
local.light = spawn script_model
local.light model "fx/searchlight.tik"
local.light notsolid
local.light.origin = local.Nlighta.origin + local.Nlighta.forwardvector * -16 

//The beam is
local.beam = spawn func_beam origin local.Nlighta.origin
local.beam alpha .2
local.beam maxoffset 0
local.beam numsegments 20
local.beam scale 50
local.beam activate
local.beam life .1
local.beam color 1 0 0 // set a color r g b values
local.beam notsolid

//The flare at the end of the beam is done like this
local.flare = spawn script_model targetname flare
local.flare model "fx/searchlight.tik"
local.flare notsolid
local.flare scale 5
local.flare light 1 0 0 // set a color r g b values
local.flare lightradius 250

//ending
local.groundspot_target = spawn script_origin
local.groundspot_target.origin = local.Nlighta.origin + local.Nlighta.forwardvector * -10240
local.p = trace local.Nlighta.origin local.groundspot_target.origin 0
local.beam endpoint local.p 
local.flare.origin = local.p 

//Normale Objects
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -100 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2125 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid
local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2050 -2890 -45 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid

local.obj1 = spawn script_object
local.obj1 model "static/static_radiostation1.tik"
local.obj1.origin = ( -830 -900 35 )
local.obj1.angles = ( 0 0 0 )
local.obj1 solid

//Allied call
local.table = spawn script_object
local.table model "static/worktable.tik"
local.table.origin = ( -1605 -3065 -20 )
local.table.angles = ( 0 180 0 )
local.table solid

local.radio = spawn script_model
local.radio model "miscobj/radio_military.tik"
local.radio.origin = ( -1610 -3050 29 )
local.radio.angles = ( 0 235 0 )
local.radio solid
local.radio targetname radio
local.microphone = spawn models/static/microphone.tik origin ( -1625 -3065 29 ) angles ( 0 235 0 ) "targetname" "radio"


local.Pradio = spawn script_model
local.Pradio model "animate/pulse_military_radio.tik"
local.Pradio.origin = ( -1610 -3050 29 )
local.Pradio.angles = ( 0 235 0 )
local.Pradio solid
local.Pradio targetname Pradio

local.planeA = spawn script_object
local.planeA model "vehicles/p47fly.tik"
local.planeA.origin = ( -25.66 -4604.91 864 )
local.planeA.angles = ( 0 107.08 0 )
local.planeA solid
local.planeA hide
local.planeA targetname PlaneA

//Triggers
local.trigCR = spawn trigger_multiple
local.trigCR.origin = ( -990 -3010 -57 )
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR setthread Peace_room
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR wait 0
local.trigCR delay 0
local.trigCR2 = spawn trigger_multiple
local.trigCR2.origin = ( -2541 1097 -53 )
local.trigCR2 setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR2 setthread Peace_room
local.trigCR2 message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR2 wait 0
local.trigCR2 delay 0

local.trigAC = spawn trigger_use
local.trigAC.origin = ( -1630 -3050 33 )
local.trigAC setsize ( -5 -5 -5 ) ( 0 0 0 )
local.trigAC setthread Allied_call
local.trigAC wait 120
local.trigAC delay 0


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

exec global/door_locked.scr::lock

level waittill spawn

thread loophere
thread CRswitch

end

//ive had problems looping sounds and stuff out of waittill spawn
loophere:
wait 1
$radio loopsound radios
end

//Trigger places
Peace_room:
local.player = parm.other
if (local.player.isTrigger1==1)
end

local.player.isTrigger1 = 1
local.player tele ( -2120 -3005 -120 )
local.player stopwatch 30
local.player takeall
local.player light 1 0 1 250
wait 5
local.player stufftext "say Oh no, i'm getting crazy..!"
wait 25
local.player lightoff
local.player respawn
local.player.isTrigger1 = 0

end


Allied_call:
$trigAC waittill trigger
if(parm.other.dmteam == allies)
{
iprintlnbold_noloc "The Americans are trying to call an airstrike!!!"
$Pradio hide
wait 1
$radio playsound radio1
wait 7
$radio playsound siren
Wait 2
thread planeA
wait 110
$Pradio show
}
else
{
iprintlnbold_noloc "The Germans are trying to call an airstrike!!!"
$Pradio hide
wait 5
local.player stufftext "say Oh no, i can't get contact with our base!"
$Pradio show
}
end

CRswitch:

local.lite = spawn script_model model "fx/dummy.tik" "targetname" "Slight"
local.lite.origin = ( -2117 -2950 -140 )
local.lite light 1 1 1 300

local.ltsw1 = spawn trigger_use
local.ltsw1.origin = ( -2020 -3000 -65 )
local.ltsw1 setsize ( -1 -1 -2 ) ( 1 1 2 )
local.ltsw1 targetname litsw

local.static1 = spawn script_model
local.static1 model "animate/electrical_switch_nopulse.tik"
local.static1.origin = ( -2020 -3000 -55 )
local.static1.angles = ( 0 0 0 )
local.static1 solid
local.static1 scale 5
local.static1 targetname lightswitch

thread CRlight
end

CRlight:
level.litsw = 1

while(1)
{
$litsw waittill trigger
if(level.litsw == 1)
{
$lightswitch playsound alarm_switch
$lightswitch anim turn
$Slight hide
$splight hide
$splight light 0 0 0 0
level.litsw = 0
}
else
{
$lightswitch playsound alarm_switch
$lightswitch anim off
$Slight show
$splight show
$splight light 9 9 9 100
level.litsw = 1
}
}
end

planeA:
//$PlaneA show
local.org1 = spawn info_splinepath "targetname" "strafe_path"
local.org1 model "vehicles/p47fly.tik"
local.org1.origin = ( -25.66 -4604.91 864 )
local.org1.angles = ( 0 107.08 0 )
local.org1.set = 1
local.org1.planescale = .4
local.org1.strafe_path.speed = .9
local.org1.guns = 0

local.org2 = spawn info_splinepath "targetname" "node2"
local.org2.origin = ( -1482 -2358 1171)
local.org2.angles = (45 118 10)
local.org2.set = 1
local.org2.planescale = .4
local.org2.strafe_path.speed = .9
local.org2.guns = 0
local.org3 = spawn info_splinepath "targetname" "node3"
local.org3.origin = ( -2093 -1184 872)
local.org3.angles = (25 96 55)
local.org3.set = 1
local.org3.bomb = 1
local.org3.planescale = .4
local.org3.strafe_path.speed = .9
local.org3.guns = 1
local.org4 = spawn info_splinepath "targetname" "node4"
local.org4.origin = ( -2095 -422 872)
local.org4.angles = (25 96 55)
local.org4.set = 1
local.org4.planescale = .4
local.org4.strafe_path.speed = .9
local.org4.guns = 1
local.org5 = spawn info_splinepath "targetname" "node5"
local.org5.origin = ( -1659 4 872)
local.org5.angles = (0 18 55)
local.org5.set = 1
local.org5.bomb = 1
local.org5.planescale = .4
local.org5.strafe_path.speed = .9
local.org5.guns = 1
local.org6 = spawn info_splinepath "targetname" "node6"
local.org6.origin = ( -915 6 872)
local.org6.angles = (0 26 0)
local.org6.set = 1
local.org6.planescale = .4
local.org6.strafe_path.speed = .9
local.org6.guns = 0
local.org7 = spawn info_splinepath "targetname" "node7"
local.org7.origin = ( -339 161 872)
local.org7.angles = (0 57 -65)
local.org7.set = 1
local.org7.planescale = .4
local.org7.strafe_path.speed = .9
local.org7.guns = 1
local.org8 = spawn info_splinepath "targetname" "node8"
local.org8.origin = ( -110 988 872)
local.org8.angles = (0 90 0)
local.org8.set = 1
local.org8.planescale = .4
local.org8.strafe_path.speed = .9
local.org8.guns = 0
local.org9 = spawn info_splinepath "targetname" "node9"
local.org9.origin = ( -248 1576 872)
local.org9.angles = (0 85 45)
local.org9.set = 1
local.org9.planescale = .4
local.org9.strafe_path.speed = .9
local.org9.guns = 1
local.org10 = spawn info_splinepath "targetname" "node10"
local.org10.origin = ( -64 2142 872)
local.org10.angles = (0 30 70)
local.org10.bomb = 1
local.org10.set = 1
local.org10.planescale = .4
local.org10.strafe_path.speed = .9
local.org10.guns = 1
local.org11 = spawn info_splinepath "targetname" "node11"
local.org11.origin = (855 2250 872)
local.org11.angles = (0 0 45)
local.org11.bomb = 1
local.org11.set = 1
local.org11.planescale = .4
local.org11.strafe_path.speed = .9
local.org11.guns = 0
local.org12 = spawn info_splinepath "targetname" "node12"
local.org12.origin = (1725 2336 882)
local.org12.angles = ( -25 0 0)
local.org12.set = 1
local.org12.planescale = .4
local.org12.strafe_path.speed = .9
local.org12.guns = 0
local.org13 = spawn info_splinepath "targetname" "node13"
local.org13.origin = (4106 2703 1395)
local.org13.angles = ( -45 0 0)
local.org13.set = 1
local.org13.planescale = .4
local.org13.strafe_path.speed = .9
local.org13.guns = 0
local.org1.target = local.org2
local.org2.target = local.org3
local.org3.target = local.org4
local.org4.target = local.org5
local.org5.target = local.org6
local.org6.target = local.org7
local.org7.target = local.org8
local.org8.target = local.org9
local.org9.target = local.org10
local.org10.target = local.org11
local.org11.target = local.org12
local.org12.target = local.org13
end



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

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn



// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

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

Post by bdbodger »

Once apon a time someone used local.org1.strafe_path.speed = .9 for the global/strafe2.scr and the error keeps repeating and repeating over and over again every time some one copies and pastes it . I say this one more time

When useing info_splinepath nodes the key you use is speed not strafe_path.speed . That is not just for the strafe2.scr but any time you use info_splinepath nodes and the followpath command .

local.org1.speed = .9 //!!!!!
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

ok, BDbodger ill do that (but that not where the forum is going about....)
Old nickname: Bartjerambo
New nickname: Barttje
Post Reply