Frankenstein Script

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Frankenstein Script

Post by Krane »

My script is working but, sometimes, I try to end a thread and other threads stops too. I've try different order and things stops...Everything is working (I guess) as it is right now :wink: but I know it needs some trim. Can Anybody helps?

Code: Select all

//The Two Mansions (mansions.scr) - Multiplayer Map
//Geometry: Krane
//Scripting: You and Me

main:

//set scoreboard messages
setcvar "g_obj_alliedtext1" "AXIS:"
setcvar "g_obj_alliedtext2" "Kill the Allies!"
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "ALLIES:"
setcvar "g_obj_axistext2" "Kill the Axis!"
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "none"


//exec global/exploder.scr
exec global/bomber.scr


	level waittill prespawn


//airplane stuff
level.flyplane = 1


//Fog
$world farplane_color "0.2 0.2 0.2"
level.fogplane = 5512 
$world farplane level.fogplane

//Global
exec global/DMprecache.scr
level.script = maps/dm/mansions.scr
//exec global/minefield.scr
exec global/spotlight.scr
exec global/ambient.scr mansions
exec global/jv_bots/jv_mp_ai.scr//[color=green]wait thread is not working[/color]

//Ubersound

local.master = spawn ScriptMaster 

local.master aliascache m_slowgate sound/mechanics/slow_gate.wav soundparms 1.0 0.0 1.0 0.0 800 3000 auto loaded maps "dm obj mansions" 
local.master aliascache m_gate sound/mechanics/gate.wav soundparms 1.0 0.0 2.0 0.0 800 3000 auto loaded maps "dm obj mansions" 

local.master remove 


//Axis Gate Sound [color=green](still using TIK)[/color]
$axisdoor sound_open_start m2l1_gate_open
$axisdoor sound_close_start m2l1_gate_open
$axisdoor sound_open_end door_metal_close_stop4


//Plane Sound
planesound:
$planesound_trigger waittill trigger
wait 2.5
$planespeaker playsound airplane5
$planesound_trigger remove



//radios
axis_radio:
$axisradio_trigger waittill trigger
$axisradio playsound click
$axisradio playsound m2l1_radio3
end



	level waittill spawn


//airplane stuff
level.flyplane = 1
exec maps/dm/mansions_precache.scr

//light off
$mylight light(1 1 1)
$mylight lightRadius 150
$mylight notsolid 
level.lightswitch1=0 
$mylight lightoff
end


//light thread
switchthread:
$myswitch anim turn 
$myswitch anim waittill animdone 
$myswitch anim on
$myswitch playsound click 
$myswitch anim waittill animdone
if (level.lightswitch1==0 ) 
{ 
$mylight lighton 
level.lightswitch1=1
} 
else 
{ 
$mylight lightoff 
level.lightswitch1=0
} 
wait .5 
$myswitch anim off
end


//Axis Alarm
axisalarm:
$axisalarmswitch anim turnon
$axisalarmswitch playsound alarm_switch
wait 1
$axisspeaker playsound alarme
$axisalarmswitch anim turnoff
end

//axis plans thread
axis_plan:
$axisplan_trigger waittill trigger
local.player = parm.other
if(local.player.dmteam == allies) 
local.player iprint "GERMAN PLANS: Passages to your HQ."
$axisplan_trigger playsound snd_papers 
if(local.player.dmteam == axis) 
local.player iprint "The Allies are located west on the map. There are 3 entrances to their hideout."
$axisplan_trigger playsound snd_papers 
 
end



	level waittill roundstart



end             

Thanks.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: Frankenstein Script

Post by jv_map »

Krane wrote:My script is working but, sometimes, I try to end a thread and other threads stops too.
Could you be a little bit more specific? :?
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

you cant just put code in your script, like in teh end, you just threw in a waittill roundstart. if that had a label, you could call the thread... your best bet would be to make your own variables, and have it so that if variable a = 0, then end this thread...
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

More specific?

Well, do you see anything wrong in this script? The threads are in the right location?

You know when you go to forums and they say: "add this line to your script etc..."....Well, after 2 months of "adding lines" my frank (map) is working fine but I'm feeling I'll have problems in the future.

Alcoholic I'm not a scripter (as Dr. Frankenstein was not a father) so I'm dumb in variables. Maybe you're trying to tell me to NOT use level waittill roundstart....Is that it?

Thanks dudes.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

im telling you it doenst have a thread name. as in "mythread:"
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

all of those threads should be after level waittill roundstart and level waittill roundstart shuodl be part of main

also u need some way to call the threads, are u using setthread?
Post Reply