Page 1 of 1

Documetns Objective not working!

Posted: Tue Feb 10, 2004 5:34 pm
by Snipes
Right I go to my documetns and when I try to take them they continus stay flashing and I dont win, before that i can blow up the bomb fine (is there any way to remove the "Great job team" after the bomb has been blown up also.
More importantly I would like to fix the documents!
Here is my scropt I am using...

Code: Select all

// SE Complex Map
// ARCHITECTURE: -={SE}=- Snipes
// SCRIPTING: -={SE}=- Snipes

main:

setcvar "g_obj_alliedtext1" "Destroy the Control room" 
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "Find the documents"

setcvar "g_obj_axistext1" "Defend the Control room"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "Defend the documents"

setcvar "g_scoreboardpic" "none"

	level waittill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr
		
	//***Ambient sounds
	level.script = maps/obj/Complex.scr
	exec global/ambient.scr Complex

	//***Initializes the exploder subsystem
	thread global/exploder.scr::main

	level waittill spawn

	level.defusing_team = "axis"
	level.planting_team = "allies"
	level.targets_to_destroy = 2
	level.bomb_damage = 200
	level.bomb_explosion_radius = 2048

	// set the parameters for round based match
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 8 // round time limit in minutes
	level.clockside = axis // set to axis, allies, kills, or draw

	// level waittill roundstart // Comment out this line using '//' before it to be able to set the bomb when alone on the map ( just for testing )
	
		$panel_bomb thread global/obj_dm.scr::bomb_thinker // "panel_bomb" is the targetname set on the bomb in MOHRadiant
		
		$document_trigger thread document_check
		
		thread allies_win_bomb
		thread axis_win_timer
		
end


allies_win_bomb:

	while(level.targets_destroyed < level.targets_to_destroy)
		waitframe

	teamwin allies
end

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

axis_win_timer:

	level waittill axiswin

end

document_check:
	while(1) { // forever
		// Dont execute past this line
		// until someone triggers the object
		self waittill trigger
		// parm.other is the triggerer
		if(parm.other.dmteam == allies) {
			// Make the document graphix disappear
			self.target hide
			// Tell the win method that an
			// objective has been completed
			level.targets_destroyed ++ // ++ adds 1
			break // out of while loop
		}
		waitframe // protection
	}
end

Posted: Tue Feb 10, 2004 6:23 pm
by Axion
This line looks like the problem-

Code: Select all

$document_trigger thread document_check
Try this instead, and see how that works.

Code: Select all

thread document_check

Posted: Tue Feb 10, 2004 6:33 pm
by Snipes
Doesn't seem to work..

I also dont really know what im doing :P

Posted: Tue Feb 10, 2004 6:38 pm
by Axion
Okay, try changing it to this-

Code: Select all

thread desk_document_check

Code: Select all

desk_document_check:
   while(1) { // forever
      // Dont execute past this line
      // until someone triggers the object
      self waittill trigger
      // parm.other is the triggerer
      if(parm.other.dmteam == allies) {
         // Make the document graphix disappear
         self.target hide
         // Tell the win method that an
         // objective has been completed
         level.targets_destroyed ++ // ++ adds 1
         break // out of while loop
      }
      waitframe // protection
   }
end

Posted: Tue Feb 10, 2004 6:49 pm
by Snipes
Hmm still dont work, :(
Is it possible anything to do with this bit and that i must personalize my documents_trigger to it somehow?

Code: Select all

document_check: 
   while(1) { // forever 
      // Dont execute past this line 
      // until someone triggers the object 
      self waittill trigger 
      // parm.other is the triggerer 
      if(parm.other.dmteam == allies) { 
         // Make the document graphix disappear 
         self.target hide 
         // Tell the win method that an 
         // objective has been completed 
         level.targets_destroyed ++ // ++ adds 1 
         break // out of while loop 
      } 
      waitframe // protection 
   } 
end

Posted: Tue Feb 10, 2004 7:09 pm
by Snipes
Ah!!! I found a post you made earlier with a script that you had tested and that did work! Thanks

Posted: Tue Feb 10, 2004 7:16 pm
by Axion
Well, I'm glad that I helped you out, even if it was indirectly. But I don't see how the code in my script differs from the advice that I already posted, unless there was something that I just failed to see (which is more than likely the case).

Posted: Wed Feb 11, 2004 2:36 am
by nuggets
just thought i'd add all i can see wrong

if there's more than one set of documents, then using $document_trigger won't work as it can't use an array of items (more than one) to enter a thread, so using self would work, if nothing is threading the thread
i.e you don't have
$player thread this
or
local.cleaner thread that
then the trigger will remain as self
...
so...
if there is more than one trigger with the same name, it'll work as self as the name it's taking will be $document_trigger[1] or [2] etc...

otherwise if you have just one set of documents
the only problem could be is that you've spelt the targetname wrong