Round does not end sometines...

Post your scripting questions / solutions here

Moderator: Moderators

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

Round does not end sometines...

Post by Bjarne BZR »

The round does not end when there are no peopele left on one side! ( Well it does end when they are shot, but not if the last person alive quits the game ).
This sometimes results in a lonely allied/axis player running around the map looking for an enemy while the other palyer wait an sigh loudly and write unfriendly things like: "Check your scoreboard U stooopid b*****d!".

What is wrong here?

Code: Select all

main:
	thread initialize_status_texts
	setcvar "g_scoreboardpic" "vemork_factory_small"

	// Haze
	$world farplane_color "0.3 0.3 0.3"
	level.fogplane = 5500
	$world farplane level.fogplane

	level waittill prespawn
	exec global/DMprecache.scr
	level.script = maps/dm/vemork_factory_small.scr
	exec global/ambient.scr m6l1a
	thread global/exploder.scr::main 
	level waittill spawn
	level.defusing_team = "axis"
	level.planting_team = "allies" 
	level.targets_to_destroy = 3
	level.bomb_damage = 200
	level.bomb_explosion_radius = 2048
	level.dmrespawning = 0
	level.dmroundlimit = 5
	level.clockside = axis
	thread update_status_texts
	level waittill roundstart
		thread pr?nt_message
		$distiller_bomb thread global/obj_dm.scr::bomb_thinker
		$distiller_bomb thread bomb_writer
		thread allies_win_check
		$distiller_bomb thread axis_win_timer 
		$desk_document_trigger thread document_check
		$wall_document_trigger thread document_check
end

allies_win_check:
	while( level.targets_destroyed < level.targets_to_destroy ) {
		waitframe
	}
	teamwin allies
end

axis_win_timer:
	level waittill axiswin // At the end Axis win
end

document_check:
	while(1) {
		self waittill trigger
		if(parm.other.dmteam == allies) { // parm.other is the triggerer
			if( self == $wall_document_trigger) {
				iprintlnbold_noloc "Wall documents stolen has been stolen!"
				level.g_obj_alliedtext2 = "[X]Steal wall documents"
				thread update_status_texts
				println ("Wall documents stolen, " + level.targets_stolen + " documents stolen.")
			} else {
				if (self == $desk_document_trigger) {
					iprintlnbold_noloc "Desk documents has been stolen!"
					level.g_obj_alliedtext3 = "[X]Steal desk documents"
					thread update_status_texts
					println ("Desk documents stolen, " + level.targets_stolen + " documents 

stolen.")
				}
			}
			self playsound steal_heavy_water_document
			self.target hide
			level.targets_destroyed ++
			break
		}
		waitframe
	}
end

bomb_writer:
	while(self.exploded != 1) {
		waitframe
	}
	iprintlnbold_noloc "Destillers have been destoyed!"
	level.g_obj_alliedtext1 = "[X]Smash the distillers"
	thread update_status_texts
end

pr?nt_message:
	iprintlnbold_noloc "Norsk Hydro's heavy water"
	iprintlnbold_noloc "production plant at Vemork"
	iprintlnbold_noloc "in Rjukan, Norway, feb 1943."
end

initialize_status_texts:
	level.g_obj_alliedtext1 = "[  ]Smash the distillers"
	level.g_obj_alliedtext2 = "[  ]Steal wall documents"
	level.g_obj_alliedtext3 = "[  ]Steal desk documents"
	level.g_obj_axistext1 =   "Defend the heavy water"
	level.g_obj_axistext2 =   "production plant from"
	level.g_obj_axistext3 =   "the allied assault."
end

update_status_texts:

	setcvar "g_obj_alliedtext1" level.g_obj_alliedtext1
	setcvar "g_obj_alliedtext2" level.g_obj_alliedtext2
	setcvar "g_obj_alliedtext3" level.g_obj_alliedtext3
	setcvar "g_obj_axistext1"   level.g_obj_axistext1
	setcvar "g_obj_axistext2"   level.g_obj_axistext2
	setcvar "g_obj_axistext3"   level.g_obj_axistext3
end
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

lol why do you write pr?nt :shock: :D

Anyway, doesn't this happen on stock maps also?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well... not as I noticed...
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Your script looks fine to me (ofcourse ;)).
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

jv_map wrote:lol why do you write pr?nt :shock:
If you are talkin about the wierd use of level.g_obj_XXXXXXXXXX

... it is because some server patches owerwrites the objective texts...
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Actually I meant:
pr?nt_message:

instead of
print_message:

:roll:
Image
Post Reply