Page 1 of 4

Past couple scripts havnt been working ~ PLZ HELP!

Posted: Mon Nov 15, 2004 8:38 pm
by HDL_CinC_Dragon
Here are all my targetnames and things like that. They are 100% exactly what I have entered into Radiant right down to the capitalization.

Script > Object
Key: targetname
Value: Fan1

Script > Object
Key: targetname
Value: Fan2

Script > Object
Key: targetname
Value: Fan3

Script > Object
Key: targetname
Value: Lift

Script > Object
Key: targetname
Value: Blast_Door

Trigger > Use
Key: targetname
Value: Fan_Start

Trigger > Use
Key: targetname
Value: Lift_Trigger

Trigger > Use
Key: targetname
Value: Blast_Door_Opener

Worldspawn
Key: ambientlight
Value: 70 70 70
-Key: suncolor
-Value: 70 70 70
--Key: script
--Value: HDL_Testing_Site.scr

Ok, now for my script: (sry if its a bit long but this problem is frustrating)

Main:

Thread Lift_Ops
$Lift time 3

Thread Blast_Door_Ops
$Blast_Door time 3

Thread Fan_Ops
$Fan1 time 5
$Fan2 time 2
$Fan3 time 2

Lift_Ops:
$Lift_Trigger waittill trigger
$Lift_Trigger nottriggerable
$Lift_Switch anim move

wait 3

$Lift loopsound Mec_ElevatorRun_01
$Lift moveup 504
waitmove
$Lift stoploopsound

wait 5

$Lift loopsound Mec_ElevatorRun_01
$Lift movedown 504
waitmove
$Lift stoploopsound
wait 3
$Lift_Trigger triggerable
$Lift_Switch anim move
goto Lift_Ops
end

Blast_Door_Ops:
$Blast_Door_Opener waittill trigger
$Blast_Door_Opener nottriggerable
$Blast_Door loopsound lighthouse_run
$Blast_Door moveup 80
waitmove
$Blast_Door stoploopsound

wait 5

$Blast_Door_Opener triggerable
$Blast_Door_Opener waittill trigger
$Blast_Door_Opener nottriggerable
$Blast_Door loopsound lighthouse_run
$Blast_Door movedown 80
waitmove
$Blast_Door stoploopsound

wait 5

Blast_Door_Opener triggerable
goto Blast_Door_Ops
end

Fan_Ops_Start:
$Fan_Start waittill trigger
$Fan_Start nottriggerable
wait 5
goto Fan_Ops
end

Fan_Ops:
iprintlnbold_noloc "Fans 2 and 3 comming online - please wait"
$Fan2 RotateY 360
$Fan3 RotateY 360
wait 3
$Fan2 RotateY 270
$Fan3 RotateY 270
wait 3
$Fan2 RotateY 180
$Fan3 RotateY 180
wait 3
$Fan2 RotateY 90
$Fan3 RotateY 90
iprintlnbold_noloc "Fans 2 and 3 online"
wait 5
iprintlnbold_noloc "Fan 1 comming online - please wait"
$Fan1 RotateX 360
wait 5
$Fan1 RotateX 315
wait 5
$Fan1 RotateX 270
wait 5
$Fan1 RotateX 225
wait 5
$Fan1 RotateX 180
wait 5
$Fan1 RotateX 135
wait 5
$Fan1 RotateX 90
wait 5
$Fan1 RotateX 45
iprintlnbold_noloc "Fan 1 online"
wait 5

$Fan_Start triggerable
$Fan_Start waittill trigger
wait 3
iprintlnbold_noloc "Fan 1 comming offline - please wait"
$Fan1 RotateX 90
wait 5
$Fan1 RotateX 135
wait 5
$Fan1 RotateX 180
wait 5
$Fan1 RotateX 225
wait 5
$Fan1 RotateX 270
wait 5
$Fan1 RotateX 315
wait 5
$Fan1 RotateX 360
wait 5
$Fan1 RotateX 0
iprintlnbold_noloc "Fan 1 offline"
wait 5
iprintlnbold_noloc "Fans 2 and 3 comming offline - please wait"
$Fan2 RotateY 180
$Fan3 RotateY 180
wait 3
$Fan2 RotateY 270
$Fan3 RotateY 270
wait 3
$Fan2 RotateY 360
$Fan3 RotateY 360
wait3
$Fan2 RotateY 0
$Fan3 RotateY 0
iprintlnbold_noloc "Fans 2 and 3 offline"
wait 5
goto Fan_Ops_Start
end

Map title: HDL_Testing_Site
Script title: HDL_Testing_Site.scr

.Map folder = main/maps/dm
.SCR folder = main/maps/dm

The Problem= Not one single scripted event happens when I press any of the triggers.


P.S. My clan name is now HDL and has been for quite some time, thougnt I'd just inform you of that irrelevant info... HDL = Home Defense Legion
Population: 3

Posted: Mon Nov 15, 2004 9:31 pm
by jv_map
I voted 'no' because you didn't tell what the problem is :roll: (or I'm going blind :shock: )

Posted: Mon Nov 15, 2004 9:36 pm
by strafer
jv_map wrote:I voted 'no' because you didn't tell what the problem is :roll: (or I'm going blind :shock: )
I think it's both. :P

I read through it and it doesn't look like he stated what the problem is.

Wait a second, you are the almighty JV, you shouldn't have to know what the problem is. You should be able to spot it as soon as you see it! What's wrong with you! :P

Posted: Mon Nov 15, 2004 9:42 pm
by jv_map
Na I was just kidding :P ... one of the errors is that Thread should be written in lowercase, like 'thread'... but there's probably more problems :?

Posted: Mon Nov 15, 2004 9:42 pm
by HDL_CinC_Dragon
Crap, sry guys. The problem is that when i go into the map and press the trigger nothing happens. Not one single scripted event happens.

Posted: Mon Nov 15, 2004 9:45 pm
by jv_map
Ah found another one :D

You shouldn't just type 'waitmove' but prefix the object you want the script to wait for, like '$Lift waitmove'.

Also I think you need an 'end' above Lift_Ops: but I'm still trying to find out where all the gotos refer to :wink:

Posted: Mon Nov 15, 2004 9:47 pm
by jv_map
Yay I'm getting the hang of this :)

Blast_Door_Opener triggerable

should be

$Blast_Door_Opener triggerable

Posted: Mon Nov 15, 2004 10:06 pm
by HDL_CinC_Dragon
jv_map wrote:Ah found another one :D

You shouldn't just type 'waitmove' but prefix the object you want the script to wait for, like '$Lift waitmove'.

Also I think you need an 'end' above Lift_Ops: but I'm still trying to find out where all the gotos refer to :wink:
ok, i put in the targetnames with the waitmoves, added an "end" under the last threading line. Testing---

Posted: Mon Nov 15, 2004 10:12 pm
by HDL_CinC_Dragon
OK, i just now found the $ less targetname, nice eye.

Posted: Mon Nov 15, 2004 10:20 pm
by HDL_CinC_Dragon
:sigh: nothing new, nothing happens





I have a hunch, In progress---

My hunch was that maybe it dosnt like capital letters so I made EVERY SINGLE letter lower case both in the script and in Radiant. Nothing happened yet again.

Posted: Mon Nov 15, 2004 11:44 pm
by Green Beret
i had a problem like that once.i started tossing stuff left and right to see what was wrong.once i deleted my LOD terrain,and used normal flat land.my scripts started workin...and i dont know why?
my guess was LOD terrain but i couldnt tell ya why. :(

Posted: Tue Nov 16, 2004 12:12 am
by HDL_CinC_Dragon
that is very odd. I dont know why that would happene either. But in this particular map of mine I have no LOD terrain... I dont like LOD too much... dont know why. Unfortunatly i have to use it in one of the maps im making that based on a town from an online RPG called "Runescape" (http://www.runescape.com) but yeah. Thats pretty strange.

Posted: Tue Nov 16, 2004 1:50 am
by HDL_CinC_Dragon
Can anyone else help?... Tltrude, i know you have something to say about this.

Script

Posted: Tue Nov 16, 2004 3:47 am
by tltrude
Never use caps in scripting, it only cause problems with syntax. OK, if this script does not work, it is because you have different targetnames in the map, or the bsp and scr do not have the same name. The lift sound wont work because you have no workaround for that (singleplayer only) sound alias. Is the map MOHAA?

Code: Select all

// HDL_Testing_Site
// ARCHITECTURE: [HDL]-{Gen} Dragon
// SCRIPTING: [HDL]-{Gen} Dragon

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "HDL Testing Site"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" ""

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

	level waittill prespawn

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

	//exec global/door_locked.scr::lock  //not used
	level.script = maps/dm/HDL_Testing_Site.scr
	exec global/ambient.scr mohdm7 // background sound (just wind)

	$lift time 3
	$blast_door time 3 
	$fan1 time 5 //this line is redundant
	$fan2 time 2 //this line is redundant
	$fan3 time 2 //this line is redundant
	
	level waittill spawn

	thread lift_ops 
	thread blast_door_ops 
	thread fan_ops_start

end

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

roundbasedthread:

	// Can specify different scoreboard messages for round based 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  //remove slash marks for final script

end

lift_ops:
 
	$lift_trigger waittill trigger 
	$lift_trigger nottriggerable 
	$lift_switch playsound click
	$lift_switch anim move 

	wait 3 

	$lift loopsound Mec_ElevatorRun_01 //this sound will not work in multiplayer without a workaround
	$lift moveUp 504 
	$lift waitmove 
	$lift stoploopsound 

	wait 5 

	$lift loopsound Mec_ElevatorRun_01 //this sound will not work in multiplayer without a workaround
	$lift moveDown 504 
	$lift waitmove 
	$lift stoploopsound
 
	wait 3
 
	$lift_Trigger triggerable
	$lift_switch playsound click
	$lift_switch anim idle 
	goto lift_ops
 
end 

blast_door_ops:
 
	$blast_door_opener waittill trigger 
	$blast_door_opener nottriggerable 
	$blast_door loopsound lighthouse_run 
	$blast_door moveup 80 
	$blast_door waitmove 
	$blast_door stoploopsound 

	wait 5 

	$blast_door_opener triggerable 
	$blast_door_opener waittill trigger 
	$blast_door_opener nottriggerable 
	$blast_door loopsound lighthouse_run 
	$blast_door movedown 80 
	$blast_door waitmove 
	$blast_door stoploopsound 

	wait 5 

	$blast_door_opener triggerable 
	goto blast_door_ops 

end 

fan_ops_start:
 
	$fan_start waittill trigger  //<--script waits here for trigger event
	wait 5 
 
	iprintlnbold_noloc "Fans 2 and 3 comming online - please wait!" 
	$fan2 rotateY 360 
	$fan3 rotateY 360 
	wait 3 
	$fan2 rotateY 270 
	$fan3 rotateY 270 
	wait 3 
	$fan2 rotateY 180 
	$fan3 rotateY 180 
	wait 3 
	$fan2 rotateY 90 
	$fan3 rotateY 90 
	iprintlnbold_noloc "Fans 2 and 3 online!"
 
	wait 5
 
	iprintlnbold_noloc "Fan 1 comming online - please wait" 
	$fan1 rotateX 360 
	wait 5 
	$fan1 rotateX 315 
	wait 5 
	$fan1 rotateX 270 
	wait 5 
	$fan1 rotateX 225 
	wait 5 
	$fan1 rotateX 180 
	wait 5 
	$fan1 rotateX 135 
	wait 5 
	$fan1 rotateX 90 
	wait 5 
	$fan1 rotateX 45 
	iprintlnbold_noloc "Fan 1 online!"
 
	wait 5 

	$fan_start waittill trigger //<--script waits here for trigger event
	wait 3 
	iprintlnbold_noloc "Fan 1 going offline - please wait!" 
	$fan1 rotateX 90 
	wait 5 
	$fan1 rotateX 135 
	wait 5 
	$fan1 rotateX 180 
	wait 5 
	$fan1 rotateX 225 
	wait 5 
	$fan1 rotateX 270 
	wait 5 
	$fan1 rotateX 315 
	wait 5 
	$fan1 rotateX 360 
	wait 5 
	$fan1 rotateX 0 
	iprintlnbold_noloc "Fan 1 offline."
 
	wait 5

	iprintlnbold_noloc "Fans 2 and 3 going offline - please wait!" 
	$fan2 rotateY 180 
	$fan3 rotateY 180 
	wait 3 
	$fan2 rotateY 270 
	$fan3 rotateY 270 
	wait 3 
	$fan2 rotateY 360 
	$fan3 rotateY 360 
	wait3 
	$fan2 rotateY 0 
	$fan3 rotateY 0 
	iprintlnbold_noloc "Fans 2 and 3 offline."
 
	goto fan_ops_start

end
Worldspawn

Key: ambientlight
Value: 18 18 18

Key: suncolor
Value: 70 70 70

Key: script <------remove this key and value



Good luck!

Posted: Tue Nov 16, 2004 1:51 pm
by Splaetos
Caps are for literature, not code =)

The best way to debug scripts that are compiling, but not functioning is to take it slowly step by step. Just take one instance of a technique you are trying to implement and see what it does... see if the trigger is pressed using message outputs... etc... eventualy you can then feel much more certain of where problems are, and ask more specific questions about how to resolve them. =)