crossroads

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
JoeyC
Lance Corporal
Posts: 18
Joined: Sat Apr 30, 2005 11:03 am

crossroads

Post by JoeyC »

Hi All

I am trying to make crossroads and obj map for allies. The script is not working. When an allie goes to plant the bomb console keeps saying usetrigger but failed check failed cansee check
waittill trigger trigger1. Here is my script. I would greatly appriecate the help.

Code: Select all

// THE BRIDGE
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER



main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "The Crossroads"
setcvar "g_obj_alliedtext2" "Find and Destroy "
setcvar "g_obj_alliedtext3" "The Supply Truck"
setcvar "g_obj_axistext1" "Defend The "
setcvar "g_obj_axistext2" "Supply Truck"
setcvar "g_obj_axistext3" ""
 setcvar "g_gametype" "4"
 setcvar "g_gametypestring" "Objective-Match"
setcvar "g_scoreboardpic" "mohdm4"

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


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

	exec global/door_locked.scr::lock
	level.script = maps/dm/mohdm4.scr
	exec global/ambient.scr mohdm4
	
	thread global/minefield.scr::minefield_setup





//////////////////////
level waittill spawn
////////////////////


level.targets_to_destroy = 1 
level.bomb_damage = 200
level.bomb_explosion_radius = 1054
level.defusing_team = "axis"
level.planting_team = "allies"
level.dmrespawning = 0
level.dmroundlimit = 5
level.clockside = axis

//level waittill roundstart

$bomb1 thread global/obj_dm.scr::bomb_thinker
thread allied_win_bomb $bomb1
thread axis_win_timer $bomb1
end

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

allied_win_bomb local.bomb:

while(local.bomb.exploded != 1)
waitframe

iprintlnbold "Allies have destroyed the Supply Truck!"

teamwin allies
end



axis_win_timer:
level waittill axiswin



end

objective:

spawn trigger_use "targetname" "trigger1"
$trigger1.origin = ( 1130.81 1940.96 184.13 ) 
$trigger1 setsize ( -30 -30 -30 ) ( 30 30 30 ) 

spawn script_model "model" animate/vehicle_german_opeltruckgreen_canopy.tik "targetname" "truck"
$truck.origin = ( 1245.83 1982.09 184.13 )
$truck.angles = (0 171.75 0)
$truck.scale = 1.0
$truck notsolid
$truck nodamage

spawn script_model "model" animate/pulse_explosive.tik "targetname" "bomb1" 
$bomb1.origin = ( 1130.81 1940.96 184.13 )// same as trigger
$bomb1.angles = ( 0 171.24 0.00 )
$bomb1.trigger_name = trigger1 
$bomb1.target = $truck 
$bomb1.explosion_fx = spawn models/fx/fx_flak88_explosion.tik "classname2" "animate"  
$bomb1.explosion_sound = explode_tank
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 = axis // set to axis, allies, kills, or draw

 level waittill roundstart

end
Last edited by JoeyC on Sat Jul 22, 2006 10:15 pm, edited 1 time in total.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

trigger

Post by tltrude »

It probably is caused by these line in the obj_dm.scr script.

if ! (self cansee local.player level.bombusefov level.bomb_use_distance)
println "failed cansee check"


Those two variables are also set in the obj_dm script. But, you can add them to your script as well.

level.bomb_use_distance = 128 // in units
level.bombusefov = 30 // degrees


What it does is to check that the trigger user is looking at the bomb, and is within 128 units of it -- or the bomb planting is aborted.
Tom Trude,

Image
Ophisâ„¢
Colonel
Posts: 461
Joined: Sun Mar 12, 2006 2:30 pm
Location: England, Manchester
Contact:

Post by Ophisâ„¢ »

"I am trying to make crossroads and obj map for allies."

What? Your trying to make Crossroads an obj map? isnt that just Bridge? Oh wait, you mean switch the roles so that allies attack bridge?
Image[ Formerly Known As Snakeâ„¢ ]
JoeyC
Lance Corporal
Posts: 18
Joined: Sat Apr 30, 2005 11:03 am

Post by JoeyC »

I tried adding this to the script it did'nt work.

level.bomb_use_distance = 128 // in units
level.bombusefov = 30 // degrees
level.bombsleft = 1
level.targets_destroyed = 0
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

It is probably the bounding box of the truck that is stopping it try to move the coords a little farther away from it and see if it works then .
Image
JoeyC
Lance Corporal
Posts: 18
Joined: Sat Apr 30, 2005 11:03 am

Post by JoeyC »

Thanks Bodger that worked. :wink:
Post Reply