Wiki Revision Page "Quick Reference" Revision 9:
---+ Menu Making
---++ Syntax
[code]
widget
	x coord
	y coord
	halign
	valign
	type
	
[/code]

---+++ Coordinates
yrel xrel- relative X and Y coordinates to the widget above the current
yabs xabs- the absolute coordinates
ycent xcent- coordinates relative to the center of the screen
halign- horizontal alignment (left, right, center)
valign- vertical alignment (top, bottom, center)

---+++ Widget Types
text- plain text
  command- commands that are executed when the text is clicked on
field- a single-line field for user input
  text- plain text that is aligned for you on either side depending on 'halign'
  width- width of the field in number of characters
  cvar- the cvar that the field affects
  cvar_default- the default value of the cvar that the field affects
select- a list box with selectable contents
	width- width of the field in number of characters
	height- the height of the field in number of lines of text
	size- same as "height"
	cvar- the cvar in which the select box affects
	cvar_default- the default value of the cvar in wich the select box affects
	click- simmilar to command, only click on a selection to execute commands
	doubleclick- similar to click, only double click
	filedir- lists files in the listed directory, starting in "\paintball2"
	strip- used to strip file names of paths and extentions (ex: strip "*.bsp", strip "pball/maps"
	begin pairs- a list of pairs of words and numbers. Cvar value comes first, displayed text comes second. End the list with "end".
	begin list- similar to "beigin pairs" but the word/number for display is the same word/number as the cvar. End the list with "end".
checkbox- a simple check box that controls one cvar (a boolean cvar. ie, ones with values "0" or "1")
	text- plain text that is aligned for you on either side depending on 'halign'
	cvar- the cvar in which the check box affects
	cvar_default- the default value of the cvar in which the check box affects
pic- a picture from a file
	pic- the path and file name of the picture, starting in "\paintball2\pball\pics"
	picwidth- width of the picture in pixels
	picheight- height of the picture in pixels
	hoverpic- the picture displaied in place of the origional when the mouse cursor is hovering over the pic
	selectpic- the picture displaied in place of the origional when the user clicks on the pic
	
---+++ Menu-Only Commands
"menu pop"- takes the user to the previously viewed menu. (ex: the "back" button)
"menu samelevel "- goes to the listed menu on the same 'level'. "menu pop" ignores these menus.
	

---+ Map Making
---+++ Numbers
Map Boundaries- (4096,4096,4096) to (-4096,-4096,-4096)

Player Dimensions- 30x30x56 units. (8 units roughly equal 1 foot [30.5 cm]. So the player is 7 feet tall [2.13 meters])
Player Crouch Height- 32
Step Heights- normal steps are 8 units. the max value is 18 units (just keep steps 16 units or lower). 
Normal Jumps- 32 units
Water Jump Heights (or "Everyone, out of the pool!")- 18 units. This is the height difference between the water surface and the adjacent floor that the bot is jumping onto. If the water jump height is made higher, human players will have a hard time getting out of the water.

---+++ Math for Map Makers
Here's some math to calculate some other values of interest:

Gravity = 800;
Jump velocity = 270;
Max run velocity = 320;
Max step height = 18;

Max jump height = 0.5 * gravity * (jumpvelocity/gravity)*(jumpvelocity/gravity);
Max normal jump height = 45 units NOTE: even though this is the mathematical maximum jump height always keep the the 32 units maximum barrier height for bots in mind when building maps.

Maximum horizontal jump distance over a gap from one spot to another when both are at the same height:

t = sqrt((maxjumpheight + maxstep) / (0.5 * gravity));
t = 0.3986 seconds;
dist = maxrunvelocity * (t + jumpvelocity / gravity);
dist = 235 units;

Because players use a bounding box we can jump a full bounding box width further in the ideal case. (15 units at the jump starting position and 15 at the landing place).

235 + 15 + 15 = 265 units.

Again, remember that this is the mathematical maximum which players can only reach under ideal circumstances.


---++ -Game --Modes
 pong- "gamemode" "64"
siege- "gamemode" "8"
deathmatch- "gamemode" "1"
CTF- "gamemode" "4"
1-Flag CTF- "gamemode" "2"

note: to combine game modes, simply add the numbers together

---+ Scripting

---++ Syntax
scriptname
{
	subdivide 
	vertexwarp   
	width 
	height 
	safe
	{
		map 
		scroll    
		scale    
		blendfunc  
		alphashift   
		anim     ... end
		envmap
		alphamask
	}
}

---+++ Example: (from the menu script, "mouse cursor")
pics/cursor
{
	safe
	{
		map pics/cursor.tga
		blendfunc blend
	}
	{
		map pics/cursor_glow.tga
		blendfunc blend
		alphashift 5 0 1
	}
}