[Solved]Document theft in multiplayer

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply

Are you tired of blowing up Flak88's yet?

Poll ended at Thu Feb 27, 2003 12:12 pm

I am... soooo very tired man!
4
44%
NO! Bring em' on! Just one more... and then one more!
5
56%
 
Total votes: 9

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

[Solved]Document theft in multiplayer

Post 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?
Last edited by Bjarne BZR on Fri Feb 21, 2003 11:45 pm, edited 1 time in total.
Admin .MAP Forums
Image
Head above heels.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

How about a hostage rescue mission?
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Post 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
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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?
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 »

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
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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?
Admin .MAP Forums
Image
Head above heels.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

How about assination? Where one player is the VIP. Like CS.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I'd LOVE that! Can you keep track of a special player that way?
Admin .MAP Forums
Image
Head above heels.
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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]
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post 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]
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

I think it will work, but how about the assassination?
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You have a problem when the 'vip' player leaves the game :?.
Image
User avatar
Butch
Lieutenant Colonel
Posts: 398
Joined: Fri Jan 24, 2003 11:30 am

Post by Butch »

yeah its more of an LAN minigame than internet
PFC.Butch
B Company, 2nd Ranger Battalion
US Army
Post Reply