stealing documents objective ends automatically

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Q with no A
Lance Corporal
Posts: 11
Joined: Thu Dec 25, 2003 10:48 pm

stealing documents objective ends automatically

Post by Q with no A »

when i go to play my objective map on LAN, i have one player on Allies and one player on Axis but as soon as the round starts, it automatically says Allies Win. Heres my script:

Code: Select all

// L33t
// ARCHITECTURE: "SFD" homeboy
// SCRIPTING: "SFD" homeboy
// EMAIL: guitarmusicz09@nc.rr.com

main:


setcvar "g_obj_alliedtext1" "- Steal the documents" 
setcvar "g_obj_alliedtext2" "From axis base."
setcvar "g_obj_alliedtext3" "- One document is fake..." 
setcvar "g_obj_axistext1" "- Prevent the allies"
setcvar "g_obj_axistext2" "from stealing the"
setcvar "g_obj_axistext3" "documents."
setcvar "g_scoreboardpic" 


level waittill prespawn


exec global/DMprecache.scr
level.script = maps/obj/l33t.scr
exec global/ambient.scr l33t


level waittill spawn


// Set the parameters for round based match


level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw


// level waittill roundstart 


thread desk_document_check // Start the win check thread for allies
level waittill axiswin // If the end of the match is reached, the Axis win


end // end of main

// Document checks

desk_document_check: 

while(1) 
{ // As long as 1 equals 1 ( that would be forever ) $documents_trigger waittill trigger // Dont execute past this line until someone triggers the object
if (parm.other.dmteam == allies) 
{ // parm.other is the triggerer ( testing here to ensure only allies can complete the ojective )
$documents hide // Make the document graphix disappear 
break // break out of the while loop 
} 
waitframe // protection against making this thread use too much CPU 
}
teamwin allies // Make allies win the match
end // end allies victory test
no
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Try this:

Code: Select all

// L33t
// ARCHITECTURE: "SFD" homeboy
// SCRIPTING: "SFD" homeboy
// EMAIL: guitarmusicz09@nc.rr.com

main:
	setcvar "g_obj_alliedtext1" "- Steal the documents"
	setcvar "g_obj_alliedtext2" "From axis base."
	setcvar "g_obj_alliedtext3" "- One document is fake..."
	setcvar "g_obj_axistext1" "- Prevent the allies"
	setcvar "g_obj_axistext2" "from stealing the"
	setcvar "g_obj_axistext3" "documents."
	setcvar "g_scoreboardpic"

	level waittill prespawn

	exec global/DMprecache.scr
	level.script = maps/obj/l33t.scr
	exec global/ambient.scr l33t

	level waittill spawn

	// Set the parameters for round based match
	level.dmrespawning = 0 // 1 or 0 (0=no respawn)
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = axis // set to axis, allies, kills, or draw
	
//	level waittill roundstart

	thread desk_document_check // Start the win check thread for allies
	level waittill axiswin // If the end of the match is reached, the Axis win
end // end of main

// Document checks
desk_document_check:

	while(1)
	{ // As long as 1 equals 1 ( that would be forever )
		$documents_trigger waittill trigger // Dont execute past this line until someone triggers the object
		if (parm.other.dmteam == allies)
		{ // parm.other is the triggerer ( testing here to ensure only allies can complete the ojective )
			$documents hide // Make the document graphix disappear
			break // break out of the while loop
		}
		waitframe // protection against making this thread use too much CPU
	}
	teamwin allies // Make allies win the match

end // end allies victory test
The first line in the while loop had accidentally been placed one line up in the comment (and therefore never executed). This was an error, but I'm not ceirtan it was THE error....
Admin .MAP Forums
Image
Head above heels.
Q with no A
Lance Corporal
Posts: 11
Joined: Thu Dec 25, 2003 10:48 pm

Post by Q with no A »

OMG you fixed it!

THANK YOU! :lol:
no
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

A pleasure :)
Admin .MAP Forums
Image
Head above heels.
Post Reply