Fritzbot Fake Brushes

From Bots-United Wiki

Jump to: navigation, search

Contents

[hide]

Intro

ET Pro map script support in FritzBot allows for the creation of fake brushes within a map. Fake brushes can be used block players or bots from exploitable areas or to assist the bots navigation in 'sticky' areas. This page will just provide examples to show the setup. Before attempting to understand or use the examples, reading and understanding the Fritzbot_Map_Scripting page is highly recommended.

Scenario 1

On Oasis, the bots have a hard time getting on top of the Anti Tank guns to defuse dynamite. Pathing for them to reach the dynamite proved to be too inconsistent and human players quickly learned to 'exploit' this. The decision was made to make the area unreachable by any player.

Setup

Add the entity to the map using ET Pro map scripting:

 		create
 		{
 			scriptName "south_dynofix2"
 			classname "func_fakebrush"
 			origin "9660 3928 -92"
 			contents 65536  // CONTENTS_PLAYERCLIP
 			mins "-45 -45 -30"
 			maxs "45 45 30"
 		}

An unique scriptName is needed if you want to cause the removal of the fakebrush later in rhe game. The classname must be as shown. For most scenarios the contents value will use the CONTENTS_PLAYERCLIP flag value of 65536 (more on these flags below). Mins and Maxs define the bounds of the box (x, y, z) while the Origin defines the starting position. It's recommended to start with a small box and test the effect of changing mins and maxs values one step at a time. To aid in the placement and sizing of the fake brushes, the command /mal_showFakeBrush 1 is available.

Using /mal_showFakeBrush 1 for this example shows the player clip on the south gun:

Image:Oasis_clip2.jpg

Scenario 2

On Temple_Final, the bots have a hard time getting out of the well. Adding a series of fake brushes solved the problem by 'funneling' them up the cable and providing a 'step' at the top.

Setup
 	        // Create the clipping boxes in the well  - the bindlestiff
 
 	        create	// South block
  		{
 			scriptName "wellfix1"
 			classname "func_fakebrush"
 			origin "1778 5062 609"
 			contents 65536  // CONTENTS_PLAYERCLIP
 			mins "-28 -23 -566"
 			maxs "28 23 382"
 		}
   
 	        create	// West ledge
 		{
 			scriptName "wellfix2"
 			classname "func_fakebrush"
 			origin "1750 5107 991"
 			contents 65536  // CONTENTS_PLAYERCLIP
 			mins "-13 -22 -2"
 			maxs "10 50 2"
 		}
 
 	        create	// East block
 		{
 			scriptName "wellfix3"
 			classname "func_fakebrush"
 			origin "1858 5095 991"
 			contents 65536  // CONTENTS_PLAYERCLIP
 			mins "-52 -55 -900"
 			maxs "2 80 140"
 		}
 
 		create	// Underwater cable block
 		{
 			scriptName "wellfix4"
 			classname "func_fakebrush"
 			origin "1821 5102 145"
 			contents 65536  // CONTENTS_PLAYERCLIP
 			mins "-15 -178 -102"
 			maxs "37 178 82"  //102
 		}

Mins and Maxs define the bounds of the box (x, y, z) while the Origin defines the starting position. It's recommended to start with a small box and test the effect of changing mins and maxs values one step at a time. To aid in the placement and sizing of the fake brushes, the command /mal_showFakeBrush 1 is available.

Using /mal_showFakeBrush 1 for this example shows the player clips:

Image:Temple_well_01.jpg


Scenario 3

In caha_tavern_b2 a user suggested preventing the roof top generator from being blown early so that human players could not sneak by the bots and win the game in less than 3 minutes. To this end a simulated impassible electric force field was created with a func_fakebrush and func_hurt. (The second func_fakebrush is used to prevent clipping on an uneven wall in a narrow area of the map.)

Setup
game_manager
{
	spawn
	{
// Added fakebrush and trigger hurt to simulate electric fence or force field 
// so bots will have better focus and balance :TomTom
		create //this feels fake
		{
			scriptName "Gen_A_Fence"
			classname "func_fakebrush"
			origin "700 1825 1530"
			contents 65536 // CONTENTS_PLAYERCLIP
			mins "-150 -145 -100"
			maxs "165 160 400"
		}
		create //electric fence should hurt a bit
		{
			scriptName "Gen_A_fence2"
			classname "trigger_hurt"
			dmg "5"
			sound "sound/player/hurt_shocked.wav" //taken from airship map
			origin "700 1825 1530"
			spawnflags "16"
			mins "-155 -146 -100"
			maxs "170 165 400"
		}

		create  //this fakebrush works to stop bots clipping on inside wall edges
		{
			scriptName "temple_box"
			classname "func_fakebrush"
			origin "700 1306 1700"
			contents 65536  // CONTENTS_PLAYERCLIP
			mins "-180 -1 -75"
			maxs "28 1 60"
		}

(Note that the func_hurt is just a little larger with a low 5 health point damage and suitable sound effect.)

Now in this case it is necessary that the func_fakebrush and func_hurt must be removed later in the map. So supporting scripts are added to the bottom of the script file.

Gen_A_fence
{
	spawn
	{

	}
	death
	{
		remove
	}
	trigger remove
	{
		remove
		trigger Gen_a_fence2 remove
	}
}
Gen_A_fence2
{
	spawn
	{

	}
	death
	{
		remove
	}
	trigger remove
	{
		remove
	}
}

And then calls to remove them are added to the 4th floor flag timer function;

   	trigger timer_complete	// Axis owned the flag for 30 seconds
   	{ 
		...
		wm_announce	"Axis now own the ^14th. ^7Floor spawn!"
     		trigger Gen_A_fence remove
		...
  	}

Scenario 4

In darji2 the elevators use script movers. Waypointer enigma1 needed to prevent bots from going under the elevator platform when the elevator was already engaged. But the fake brushes needed to be gone when the elevator was back in its bottom position.

Setup

The creates define the fake brushes, but note that the origin value is not in the create block. However note that each func_fakebrush has an unique scriptname.

//-MS- Axis fake brushes for the elevators
   create
	{
		scriptName "axis_brush1"
		classname "func_fakebrush"
		contents 65536  // CONTENTS_PLAYERCLIP
	}

   create
	{
		scriptName "axis_brush2"
		classname "func_fakebrush"
		contents 65536  // CONTENTS_PLAYERCLIP
	}

   create
	{
		scriptName "axis_brush3"
		classname "func_fakebrush"
		contents 65536  // CONTENTS_PLAYERCLIP
	}

And events in these script blocks are called in the script_mover's script block.

axis_flaghiss // This is the script_mover (the lift).
{
	spawn
	{
		wait 500
	}

	trigger raise
	{
       trigger axis_brush1 block //-MS-
		gotomarker axis_flaghiss_top 200 // script that makes the mover go up...
		wait 3000
		togglespeaker axisflaghiss_downsound
		gotomarker axis_flaghiss_bottom 200 // ...and go down.
		wait 1500 //-MS-
       trigger axis_brush1 through //-MS-
	}
}
// The axis elevator close to axis base, but not the one closest to the base.
target_script_trigger_axishiss1 // This is the script for the trigger zone.
{
	spawn
	{
		wait 200
	}

	trigger trigger_the_axis_hiss1  // Whenever a player enters the lift's trigger zone, this part of the script will be run.
	{
		trigger axis_hiss1 raise
 	}
}

Then the fake brushes get moved in and out of the way by set blocks in different trigger events.

//-MS- Axis Side
axis_brush1
{
	spawn
	{
		set
		{
		    origin "-7581 700 64"
			mins "-75 -2 -50"
			maxs "75 2 50"
		}
	}

	trigger block
	{
		set
		{
			origin "-7581 483 64"
		}
	}

	trigger through
	{
		set
		{
		    origin "-7581 700 64"
		}
	}
}

and similarly for the other brushes.

More Scenarios

Other maps where fake brushes have been used include;

  • Northpole and Eagles_2way_b3 to trap bots inside moving mono-rail and sky-lift cars so they don't fall out (glider is another map where the bots can be trapped inside the glider over most of the flown distance).
  • Supplydepot scriptfix to prevent an exploit that allows the crane controls to be blown up from inside the hallway.

Flag Values for Fakebrush Contents

The line contents 65536 tells the map script system to allow weapons fire to pass through the fakebrush but not bots and players. The ET Pro func_fakebrush supports some of the 24 or so flag defines that ET uses for contents fields. Here are those we have tested and found useful;

1         //SOLID  acts like an invisible solid box stops every thing
128       //MISSILECLIP surface stops panzers, grenades, dynamite throws etc, but not players, bots nor bullets
65536     //PLAYERCLIP surface stops bots and players only.  
	   //If using to prevent dynamite plants box needs to be big enough to allow for the reach of the engineer's pliers.
33554432  //BODY acts like solid
67108864  //CORPSE surface stops bullets, panzers, grenades etc, but not players, bots nor splash damage. 
	   //Used in Glider waypoints to partially bullet proof the glider cockpit
2147483648 //CONTENTS_NODROP similar to solid, can be used to prevent dynamite throws.
           //Used in Glider waypoints to prevent dynamite plants on the generator fuel tank

Fake Brush Troubleshooting

Problem: I can't see my fake brush.

A few things to check;

  • Did you open the console and type /mal_showfakeBrush 1, then hit enter and then do a /vid_restart ? Were there any error messages in the console when you did these commands? Did you open the map with /devmap <mapname> as you should when waypointing?
  • Are you in spectator mode? You can't see fakebrushes when spectating, and they don't affect spectators.
  • Are you further away than your draw distance from the vertices (corners)? Move closer to a vertex or increase the FritzBot draw distance.
  • Double check your position with /viewpos and check it against the origin, min and max values of your create block. Be certain all the signs are correct on these values. Would the edges of the fake brush be inside solid objects like walls? Then try /noclip to check inside the solid objects.

Problem: Why is my fake brush not stopping players etc.

  • Double check the contents field in your create block. Is the value correct? Inside double quotes " ?
  • Double check the min and max values. Is an origin+max value less than an origin+min value? A fake brush with a min-max value swapped along any axis is turned inside out and may not act properly as per its contents type.

Limitations

ETPro and FritzBot ET can only script func_fakebrushes that are 6 sided cubes and other hexahedrons. Furthermore all the sides of the hexahedron are always aligned parallel to the maps 3 grid planes (xy, xz and yz). Finally not all the games brush entity types are supported.#1


#1Defined in src/game/surfaceflags.h in the WET coding source files


Permanent link to this page
Retrieved from "Fritzbot_Fake_Brushes"