Parachute model and air raid sound

Post your scripting questions / solutions here

Moderator: Moderators

Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Tom Trude made a map where you call an airstrike, its on his tuts page

http://smallsumo.leveledit.com/tltrude/index.html
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

My script isn't working for this...I am about to pull my hair out. Here's my code:

Code: Select all

// SNOWY PARK
// ARCHITECTURE: NED
// SCRIPTING: NED

main:

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

setcvar "g_scoreboardpic" "mohdm5"

	// 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

	level.script = maps/dm/mohdm5.scr
	exec global/ambient.scr mohdm5

	level waittill spawn

	thread allied


spawn script_model "targetname" "rad1"
$rad1 model models/animate/alarmswitch.tik
$rad1.origin = ( 4692 -4015 172 )
$rad1.angle = 90
$rad1 triggerable
$rad1 solid


snow:
	wait 1

	level.rain_speed = "32"
	level.rain_speed_vary = "16"
	level.rain_length = "2"
	level.rain_width = "1"
	level.rain_density = ".2"
	level.rain_slant = "250"
	level.rain_min_dist = "1800"
	//level.rain_min_dist = "512"
	level.rain_numshaders = 12
	level.rain_shader = "textures/snow0"


end

allied:

$rad1 waittill trigger


	if (local.player.dmteam != allies)
		{
			if (local.player.useheld == 1)
			{
			local.player = parm.other
			
			local.rad1 anim move
			local.rad1 playsound lighthouse_lever
			iprintln "it works!"
			}
			
		}
	else
		{
		iprintln "You are not on the Allies Side!"
		}

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

Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

G'day, you had a few things in the wrong places so I re wrote it all :)

Code: Select all

allied: 

$rad1 waittill trigger 
local.player = parm.other  // <- this needs to be right after waittill trigger

if (local.player.useheld == 1)
{
 if !(local.player.dmteam == allies) 
  { 
    iprintln "You are not on the Allies Side!" 
  }
 else  
  {           
    local.rad1 anim move   // <-- is this an anim model ?
    local.rad1 playsound lighthouse_lever 
    iprintln "it works!" 
  }
}
goto allied  // <---- I assumed you wanted the thread to loop ?
end 
The object local.rad1 , if this is the pulsing radio then the anim move wont work, but you can target it to play a sound, also give it a targetname before this thread , for eg: local.radio targetname "radio" and use the targetname in the above thread as $radio playsound some_good_sound.
Grassy
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Oh silly me, I should read what I am replying to more carefully :oops:

You are spawning an object but not a trigger over it...
This is why nothing happens, there is no trigger.

try adding this to your script;

Code: Select all

  local.trig = spawn trigger_use 
  local.trig.origin = $rad1.origin
  local.trig setsize ( -20 -20 -20 ) ( 20 20 20 )
  local.trig targetname "allies_trigger"

thread allied

allied: 

$allies_trigger waittill trigger 
local.player = parm.other 

if (local.player.useheld == 1) 
{ 
 if !(local.player.dmteam == allies) 
  { 
    iprintln "You are not on the Allies Side!" 
  } 
 else  
  {            
    $rad1 anim move
    $rad1 playsound lighthouse_lever 
    iprintln "it works!" 
  } 
} 
goto allied
end
Grassy
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Thanks for your help. I only have time to look at the replies. I will test this out later and keep you updated if I have any problems. :)
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

There's an error in the console:

Code: Select all

$allied_trigger waittill trigger 
command 'waittill' is applied to NULL listener.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Can anyone help me please? :cry:
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

strafer wrote:There's an error in the console:

Code: Select all

$allied_trigger waittill trigger 
command 'waittill' is applied to NULL listener.
This indicates that there is nothing with the targetname allied_trigger... are you sure you got one? Are you sure it is spelled right?
Admin .MAP Forums
Image
Head above heels.
Post Reply