Page 1 of 1

Obj document.

Posted: Thu Nov 25, 2004 3:01 pm
by agentmad007
Hi all ,

I cant make work this script below.

Some precisions before:

$sg_document is a script_object
$axis_view_map_trigger is a trigger_use wich setthread axis_view_map.
AxisHQ is a big trigger_multiple

i would like the player to momorise the map en run back to his spawn point to achieve the objective.Here is what i tried but nothing work .

Code: Select all

axis_view_map local.player:



	while (local.player.dmteam != axis)
	
	{      


	if ( (Isalive local.player) && (local.player.useheld == 1) && (local.player cansee $sg_document 60 80) )

	if ( local.player.seenmap == 1 )

			{
			iprintln "You have memorised the document" local.player.dmteam

			}
	end

	}

thread come_back_home

end

come_back_home:

	self.seenMap = 1


	while ( self != NULL )
	{
 		if ( ! (Isalive self) )
		{
			iprintln "You've been mupped!"
			self.seenMap = 0
			end
		}

		if ( self.dmteam != "axis" )
		{
			iprintln "objective failed"
			self.seenMap = 0
			end
		}

		for (local.i = 1; local.i <= $AxisHQ.size; local.i++) {
			if ( self isinside $AxisHQ[local.i] )
			{
				iprintln "Good job!!!!"
				
				thread stargate_document_in_possession				

				end
			}
		}

		wait 0.1
	}

end

stargate_document_in_possession:

level.axis_obj++

thread check_endmatch

end



check_endmatch: 

if (level.axis_obj == level.numobjectives) 
teamwin axis

end

thx for help

parm.other

Posted: Thu Nov 25, 2004 7:19 pm
by tltrude
You need to put this line at the start of the first thread.

Local.player = parm.other

That line assigns the values of the player (the one that hit the trigger use) to the "local.player" variable in that thread.

You also need to assign the new parammeter/value to that player.

local.player.seenmap = 1

Hope that helps!

Posted: Thu Nov 25, 2004 8:43 pm
by agentmad007

Code: Select all


axis_view_map local.player:


local.player = parm.other



	while (local.player.dmteam != axis)
	
	{      


	if ( (Isalive local.player) && (local.player.useheld == 1) && (local.player cansee $sg_document 60 80) )

	if ( local.player.seenmap == 1 )

			{
			iprintln "You have memorised the document" local.player.dmteam

			}
	end

	}

thread come_back_home

end

come_back_home:

	local.player.seenMap = 1


	while ( self != NULL )
	{
 		if ( ! (Isalive self) )
		{
			iprintln "You've been mupped!"
			local.player.seenMap = 0
			end
		}

		if ( self.dmteam != "axis" )
		{
			iprintln "objective failed"
			local.player.seenMap = 0
			end
		}

		for (local.i = 1; local.i <= $AxisHQ.size; local.i++) {
			if ( self isinside $AxisHQ[local.i] )
			{
				iprintln "Good job!!!!"
				
				thread stargate_document_in_possession				

				end
			}
		}

		wait 0.1
	}

end

stargate_document_in_possession:

level.axis_obj++

thread check_endmatch

end



check_endmatch: 

if (level.axis_obj == level.numobjectives) 
teamwin axis

end

still doesn't want to work .

seenMap

Posted: Thu Nov 25, 2004 8:58 pm
by tltrude
seenMap ???

should be

seenmap

Use some debug lines like these.

iprintln "the trigger has been used!"
iprintln "local.player.seenmap = " (local.player.seenmap)


By the way, "mupped" has no meaning in english, and "memorised" is spelled "memorized".

Posted: Thu Nov 25, 2004 9:14 pm
by agentmad007
I cant use the debug , coze the whole script doesn't work , as if i got a syntax error.But only this part of script is bugged.when I try my whole script with these lines below , nothing wotk anymore .....however when i take out these lines the rest of the objectives work.

Code: Select all

axis_view_map local.player: 


local.player = parm.other 



   while (local.player.dmteam != axis) 
    
   {      


   if ( (Isalive local.player) && (local.player.useheld == 1) && (local.player cansee $sg_document 60 80) ) 

   if ( local.player.seenmap == 1 ) 

         { 
         iprintln "You have memorised the document" local.player.dmteam 

         } 
   end 

   } 

thread come_back_home 

end 

come_back_home: 

   local.player.seenmap = 1 


   while ( self != NULL ) 
   { 
       if ( ! (Isalive self) ) 
      { 
         iprintln "You've been mupped!" 
         local.player.seenmap = 0 
         end 
      } 

      if ( self.dmteam != "axis" ) 
      { 
         iprintln "objective failed" 
         local.player.seenmap = 0 
         end 
      } 

      for (local.i = 1; local.i <= $AxisHQ.size; local.i++) { 
         if ( self isinside $AxisHQ[local.i] ) 
         { 
            iprintln "Good job!!!!" 
             
            thread stargate_document_in_possession             

            end 
         } 
}==> i deleted this array also just before waitframe

Code: Select all

      waitframe 
it was wait .01 before , i ve changed it

Code: Select all

   } 

end


local

Posted: Thu Nov 25, 2004 9:34 pm
by tltrude
Local.player will lose it's value when it sees "end"---, local only works in the "local" thread.


thread come_back_home

end

come_back_home:

local.player.seenmap = 1


----------------------------------

try this----

thread come_back_home local.player

end

come_back_home local.player:

local.player.seenmap = 1

Posted: Thu Nov 25, 2004 9:39 pm
by agentmad007
same :( none objectives work .....

Posted: Thu Nov 25, 2004 9:45 pm
by agentmad007
also tried

Code: Select all

local.player thread come_back_home

end 

come_back_home:
..............
..........
.....

Posted: Thu Nov 25, 2004 11:24 pm
by agentmad007
Now it work ;)

changed the structure.

Thx anyway Tom