GUI Parms are a special type of gui variable used in many reuseable world GUIs. GUI parms are referenced within the GUI just like any other GUI variable. The difference is that GUI parms are defined in entities within a level. An example of a GUI that uses GUI parms are the numerous elevator and lift GUIs in a Quake 4 level. The floors that the lift moves between are defined in the level with GUI parms. Those parms are then used by the GUI to determine which animations to run or which information to show.
GUI Examples From Quake 4
The best way to learn GUI scripting is by example, and there are many GUIs in Quake 4 that can be opened up in the GUI editor or in any text editor and used as references. The following is a list of sample GUIs found in the q4base/GUIs folder and what they demonstrate.
q4base/GUIs/movers/strogg/activate_lift.gui -- This gui is used in many places in Quake 4 as a lift or elevator GUI. It's a great example of the use of GUI parms to make a single GUI useable in many areas of the game.
q4base/GUIs/mphud.gui -- This is the basic multiplayer HUD (which overlays on top of hud.gui). This demonstrates the use of GUI variables that are sent to the GUI from code.
q4base/GUIs/mainmenu.gui -- Probably the most complex GUI in the game, the main menu. For mod authors interested in creating a custom menu for your mod, you'll want to look at this one closely and probably use it as a template for your own menu.
q4base/GUIs/maps/hangar/fire_engine.gui -- This GUI is used in the hangar level as a puzzle element. It's a good example of a simple GUI that performs a simple action but has some animation. Look at the windowDef button and its script to see the use of a GUI Parm as a script name to run in the onAction. This script name is set in the entity/key value pairs within the LevelEditor.
q4base/GUIs/maps/process2/rotate8.gui -- Another puzzle GUI, but more complex. This GUI illustrates the use of GUI parms, the rotate property in transitions, and running scripts.
q4base/GUIs/scoreboard.gui -- A complex menu GUI that demonstrates using math to dynamically position GUI elements.