Page 1 of 1

[Solved]Document theft in multiplayer

Posted: Thu Feb 20, 2003 12:12 pm
by Bjarne BZR
Can I use a "steal documents" objective in a multiplayer?
I guess this will turn into a scripting topic if it can be done...

Or maby I should ask more generally: Can you use other objective types than "blowing stuff sky high". I would like a steal documents objective ( maby with an added bring the documents back to area X? )... can it be done?

Posted: Thu Feb 20, 2003 12:33 pm
by mohaa_rox
How about a hostage rescue mission?

Posted: Thu Feb 20, 2003 12:59 pm
by TheShiznaeSpe
kill the hostages would be fun too

one team kills, other protects

script would be sorta like this

Code: Select all

allies_win:
$hostage waittill death
teamwin allies
end

axis_win:
level waittill axiswin
end

Posted: Thu Feb 20, 2003 6:44 pm
by jv_map
Ok here's how to do it. Is more related to scripting though. I assume the allied team has to steal the docs.
  1. Create a script_model with the documents. Targetname it 'documents'.
  2. Create a trigger_use over the documents with targetname 'documents_trigger'.
  3. Use this (basic) script:

    Code: Select all

    main:
      level waittill spawn
      level.clockside = axis // axis win when timelimit is hit
      level waittill roundstart
      while(1)
      {
        $documents_trigger waittill trigger
        if(parm.other.dmteam == allies) // parm.other is the triggerer
          break // out of while loop
        waitframe // protection
      }
      $documents hide
      teamwin allies
    end
    
  4. Uh you're done already 8).
This is very basic, it doesn't include a bring back objective, which would make it much more complex.

Posted: Thu Feb 20, 2003 7:01 pm
by Shifty
I got the Stealing Documents Objective in my "War in a Hall" Map which is soon to be released

Next I will have a go at hostage rescue - I hope to make a Mental Asylum Run by the axis and theyve got some1 locked in there - the allies need to rescue this person - Im thinking of making a Trigger so when u get in the cell the hostage follows u around the map if you get killed he should try and find cover - Scripting is gonna be hard though as its not my strong point

Posted: Thu Feb 20, 2003 8:28 pm
by Bjarne BZR
Hey jv, that looks really simple!

The thing is: I'm going to combine it with a bomb objective, scripted like this ( working fine ) :

Code: Select all

// Custom objective test map
// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik

main:

setcvar "g_obj_alliedtext1" "Destroy the Control" 
setcvar "g_obj_alliedtext2" "panel"
setcvar "g_obj_alliedtext3" ""

setcvar "g_obj_axistext1" "Defend the Control"
setcvar "g_obj_axistext2" "panel"
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "none"

	level waittill prespawn

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

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

	level waittill spawn

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

	// set the parameters for 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 // 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
		
		thread allies_win_bomb
		$panel_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
How will I incorporate you'r scripting in this code? Will it not require the starting of a new thread to avoid blocking of other objective threads?

Would this work:

Code: Select all

document_objective_check:
	while(1)
 	{
 		$documents_trigger waittill trigger
 		if(parm.other.dmteam == allies) // parm.other is the triggerer
			level.targets_to_destroy += 1
			break // out of while loop
		waitframe // protection
	}
end
...and changing level.targets_to_destroy from 1 to 2 and adding something like thread document_objective_check to main?

Posted: Thu Feb 20, 2003 8:33 pm
by jv_map
Yes that looks ok.

Only you need a { and a } after the if.

Code: Select all

document_objective_check:
   while(1)
   {
      $documents_trigger waittill trigger
      if(parm.other.dmteam == allies) // parm.other is the triggerer
      {
         level.targets_to_destroy += 1
         break // out of while loop
      }
      waitframe // protection
   }
end

Posted: Thu Feb 20, 2003 11:16 pm
by Bjarne BZR
Whoopie!

Thanx jv_map and the rest of you! It works like a charm! I made a tutorial on the subject here.

Wicked!

/Bjarne

PS: Maby I should do a tutorial on combining multiple objective types next?

Posted: Fri Feb 21, 2003 6:28 am
by mohaa_rox
How about assination? Where one player is the VIP. Like CS.

Posted: Fri Feb 21, 2003 10:22 am
by Bjarne BZR
I'd LOVE that! Can you keep track of a special player that way?

Posted: Fri Feb 21, 2003 11:17 am
by mohaa_rox
I'm not sure, but you'll need to randomize who'll be the VIP, but it will be so so so so so hard.......hostage rescue's much easier........[/code]

Posted: Fri Feb 21, 2003 9:42 pm
by TheShiznaeSpe
well i'm not sure if this would work, but you could make the vip be the first person to enter trigger, sorta like this

Code: Select all

makeallievip:
$viptrigger waittill trigger
		while(1)
	{
		self waittill trigger
		local.triggerer = parm.other
		if(local.triggerer.dmteam == "allies")
			break
		wait 0.1
	}	
local.player = parm.other
local.player waittill death
teamwin axis
end
would that work? should i change local.player to local.player2? or would that not work?[/code]

Posted: Sat Feb 22, 2003 4:26 am
by mohaa_rox
I think it will work, but how about the assassination?

Posted: Sat Feb 22, 2003 7:29 am
by jv_map
You have a problem when the 'vip' player leaves the game :?.

Posted: Sat Feb 22, 2003 8:22 am
by Butch
yeah its more of an LAN minigame than internet