Help changing axis spawn points in The Hunt

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Help changing axis spawn points in The Hunt

Post by G3mInI »

I am trying to create a server side mod where the axis spawn points are changed to all being spawned in the church. I have created a script which puts all the origins in the church area but still the axis are spawning in the usual spots. What more do I need to add to this script to make it work. Do I need to block the original spawn points ? Here is what I have now...

Code: Select all

// THE HUNT
// ARCHITECTURE: NED/STEVE
// SCRIPTING: NED and lots of help from ZIED

main:


	setcvar "g_obj_alliedtext1" "- Find and destroy" 
	setcvar "g_obj_alliedtext2" "the Flak 88 cannon"
	setcvar "g_obj_alliedtext3" ""

	setcvar "g_obj_axistext1" "- Defend the Flak 88"
	setcvar "g_obj_axistext2" "cannon"
	setcvar "g_obj_axistext3" " "

	setcvar "g_scoreboardpic" "objdm1"
	
// axis spawn fixes

	
	local.axis = spawn info_player_axis origin "2368 -1128 -336" angle 45
	local.axis = spawn info_player_axis origin "2376 -1136 -336" angle 45
	local.axis = spawn info_player_axis origin "2256 -1288 -336" angle 45
	local.axis = spawn info_player_axis origin "2976 -1640 -360" angle 45
	local.axis = spawn info_player_axis origin "3056 -1288 -336" angle 45
	local.axis = spawn info_player_axis origin "3192 -1440 -352" angle 45
	local.axis = spawn info_player_axis origin "3064 -1296 -352" angle 45
	local.axis = spawn info_player_axis origin "1472 -1112 -312" angle 0
	local.axis = spawn info_player_axis origin "1400 -1200 -312" angle 0
	local.axis = spawn info_player_axis origin "1776 -1192 -304" angle 0
	local.axis = spawn info_player_axis origin "1784 -1200 -304" angle 0
	local.axis = spawn info_player_axis origin "1816 -1016 -304" angle 0
	local.axis = spawn info_player_axis origin "1864 -1360 -304" angle 45
	local.axis = spawn info_player_axis origin "1960 -1496 -304" angle 45
	local.axis = spawn info_player_axis origin "2920 -1168 -352" angle 45
	local.axis = spawn info_player_axis origin "2752 -1144 -352" angle 45
	local.axis = spawn info_player_axis origin "2584 -1096 -336" angle 45
	local.axis = spawn info_player_axis origin "1712 -1328 -296" angle 45
	local.axis = spawn info_player_axis origin "2040 -1000 -304" angle 0
	local.axis = spawn info_player_axis origin "2056 -1096 -304" angle 0
	local.axis = spawn info_player_axis origin "2064 -1104 -320" angle 0
	local.axis = spawn info_player_axis origin "1280 -1096 -312" angle 0
	local.axis = spawn info_player_axis origin "1784 -1496 -296" angle 45
	local.axis = spawn info_player_axis origin "1792 -1504 -296" angle 45
	
// end of axis spawn fixes -- all players should spawn in church area
	
	


	//////////////////////////
	level waittill prespawn
	//////////////////////////

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

	level.script = maps/obj/obj_team1.scr
	exec global/ambient.scr obj_team1

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

	level.defusing_team = "axis"
	level.planting_team = "allies"

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



//***********************************************
// bomb planting setup
//***********************************************

	$flak88_weapon1_trigger thread flak88_random_setup $flak88_weapon1_explosive $flak88_weapon1 $flak88_target1 $flak88_base1 4
	$flak88_weapon1_explosive thread global/obj_dm.scr::bomb_thinker
	
	thread allies_win_thread $flak88_weapon1_explosive
	$flak88_weapon1_explosive thread axis_win_timer

/////////////////////////////////////
///// objectives 

//	waitthread global/objectives.scr::reset_objectives 
//	waitthread global/objectives.scr::blank_objectives

//	waitthread global/objectives.scr::add_objectives 1 2 "Find and destroy the Flak88" //$flak88_weapon1_trigger.origin
//	wait 2
//	waitthread global/objectives.scr::current_objectives 1




end

//*** --------------------------------------------

almost_there1:
	//called by BSP
	 local.player = parm.other
	 if ( (local.player.dmteam != "allies") || (level.perimeter_breached == 1) )
		end
		
	 iprintlnbold "The Allies have breached the perimeter!"
	 level.perimeter_breached = 1 
end


//*** --------------------------------------------

allies_win_thread local.bomb1:
	while (local.bomb1.exploded != 1)
		wait .1
	
	teamwin allies
end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

	level waittill axiswin

end


//*** --------------------------------------------

flak88_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:

	local.location = ((randomint (local.number_of_locations)) + 1)

	local.trigger_offset = self.origin - local.base.origin 
	local.weapon_offset = local.weapon.origin - local.base.origin 
	local.explosive_offset = local.explosive.origin - local.base.origin 
	local.point_at_offset = local.point_at.origin - local.base.origin 

	local.location = $("flak88_location" + local.location)
	local.base.origin = local.location.origin


	self.origin 		= local.trigger_offset 		+ local.base.origin 
	local.weapon.origin 	= local.weapon_offset 		+ local.base.origin 
	local.explosive.origin 	= local.explosive_offset 	+ local.base.origin 
	local.point_at.origin 	= local.point_at_offset 	+ local.base.origin 

	local.weapon setaimtarget local.point_at
end


//***********************************************
// first thread... controls allies using the trigger
//***********************************************

flak88_set_explosive_thinker local.bomb local.weapon:

	local.bomb model items/pulse_explosive.tik

while (1)
{
println "waittill trigger " self
self waittill trigger

	local.player = parm.other
	//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
        if (local.player.dmteam !="allies") 
	{
		goto flak88_set_explosive_thinker local.bomb local.weapon
	println "failed dmteam check" local.player.dmteam
		
	}
	local.counter = 0

	//add check for allies vs nazi
	while ( (Isalive local.player) && (local.player cansee local.bomb level.bombusefov level.bomb_use_distance) && (local.player.useheld == 1) )
	{
		local.counter++
if ((local.counter % 5) == 0)
{
level.subtitleX = 100
level.subtitleY = 50
locprint level.subtitleX level.subtitleY("set "+ local.counter)
}
		wait .1
		if (local.counter >= level.bomb_set_time)
		{
			thread wait_for_axis local.bomb local.weapon
			thread waittill_explode local.bomb local.weapon
			local.bomb.live = 1
			end
		}
	}
	println "usetrigger but failed check" 
	if ! (local.bomb cansee local.player level.bombusefov  level.bomb_use_distance) 
		println "failed cansee check"	
	if ! (local.player.useheld == 1)
		println "failed useheld check" local.player.useheld
		
}
end


//***********************************************
// second thread... controls axis using the trigger
//***********************************************
wait_for_axis local.bomb local.weapon:
while (1)
{
self waittill trigger

	local.player = parm.other
	//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
	//add check for nazi 
       if (local.player.dmteam !="axis") 

	{      println "failed dmteam check" local.player.dmteam
		goto wait_for_axis local.bomb local.weapon
			
	}
	local.counter = 0


	while ( (Isalive local.player) && (local.player cansee local.bomb level.bombusefov  level.bomb_use_distance) && (local.player.useheld == 1) )
	{
		local.counter++
if ((local.counter % 5) == 0)
{
level.subtitleX = 100
level.subtitleY = 70
locprint level.subtitleX level.subtitleY ("defuse "+local.counter)
}
		wait .1
		if (local.counter >= level.bomb_defuse_time)
		{
			thread flak88_set_explosive_thinker local.bomb local.weapon //start first thread again
			local.bomb.live = 0
			end
		}
	}
}
end


//***********************************************
// third thread... times the bomb and makes it explode at the right time
//***********************************************
waittill_explode local.bomb local.weapon:

	local.bomb model items/explosive.tik
	local.bomb playsound plantbomb


	self loopsound bombtick
	
	local.start_time = level.time
	while (level.time < (local.start_time + level.bomb_tick_time))
	{
		wait .1
		if (local.bomb.live != 1)
		{
			self stoploopsound
			end
		}
 	}
 	self stoploopsound
	thread explode local.bomb local.weapon
	self remove
end


//***********************************************
// fourth thread... controls the explosion 
//***********************************************
explode local.bomb local.weapon:

 
///// shake the players view
thread jitter_large 0
 local.temp = spawn script_model
 local.temp.origin = self.origin
 local.temp model "fx/fx_flak88_explosion.tik"
 local.temp anim start
 local.temp playsound explode_aagun
 
 local.weapon model models/statweapons/flak88_d.tik
 //origin   damage   radius    constant damage or not
 radiusdamage local.bomb.origin  level.bomb_damage level.bomb_explosion_radius
    local.bomb hide

	teamwin allies
end




//******************************
// jitter large effect
// jitter_large [delay]
//******************************
jitter_large local.time:

if (local.time)
	wait local.time

waitexec global/earthquake.scr .35 10 0 0

waitexec global/earthquake.scr .23 6 0 0

waitexec global/earthquake.scr 1 1 0 0

waitexec global/earthquake.scr 1.25 .3 0 1

end




It just does not seem to be working and I am not sure why.

Thanks,
G3mInI
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well, you arent moving them, you are just spawning new spawns, thus getting a bigger chance of the axis spawning in the church...

But fear not, I've already made a sever side mod that moves the player spawns in The Hunt ( /forum/viewtopic.php?t=7208 ). It does not put them in the church, but it combines moving the front 4 axis spawns into the graveyard, and all Allied spawns a bit further up the road ( this creates about the same effect as you are after I guess ). Just modify my code if you want to put them in the church ( but I think that is a bit to radical, and may just hand the unfair advantage over to the allies, making the map unbalanced again ).
Admin .MAP Forums
Image
Head above heels.
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Thank you very much!

And yes all I was trying to do was equal out the map... as we all know axis has way too much of an advantage as is. And yes the 4 front spawns moved will do just fine...once again thanks!

G3mInI
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Try removing the original ones ($spawn_axis1 disablespawn) and creating your spawn points as entities. Then enable your spawn points after you create the origins. ($spawn_axis1 enablespawn)
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

strafer wrote:Try removing the original ones ($spawn_axis1 disablespawn) and creating your spawn points as entities. Then enable your spawn points after you create the origins. ($spawn_axis1 enablespawn)
Well, I dont think you can, because the spawns are dont have any targetname "spawn_axis1", so $spawn_axis1 will return a NULL entity :cry:
Admin .MAP Forums
Image
Head above heels.
Post Reply