Game Development Community

Implementing an About box and a Help Manual - Part 3

by Michael Hall · 06/02/2011 (9:21 am) · 5 comments

Continuing from Part 2 of this Resource series...

The Help Files
The help pages are text files saved with the extension .hfl which stands for "help file". Plain text, if placed into a help file, will be parsed as text without any kind of formatting or style. TorqueML can be used to add formatting.

When creating new help files keep in mind that the pages are indexed by file name, so plan accordingly. Each help file is numbered, starting from 0, to indicate the order in which it should be added to the listing on the Gui. After the number comes the name of the Help page as it will show up in the list.

For example, consider these file names:
  1. "0. About.hfl"
  2. "1. Credits.hfl"
  3. "2. Game Controls.hfl".
The number is for order, the name is for what we see in the list heading. This kind of naming convention makes it easy to organize and keep things readable. At the end of this Resource the Help gui or "Game Manual" will look like this:i167.photobucket.com/albums/u143/heretek/torque/gmanaulss.png
You'll need these images (Right-click, save as) for use in the upcoming help files. Save files to art/gui/help
logogg.png : i167.photobucket.com/albums/u143/heretek/torque/logogg.png
logouser.jpg : i167.photobucket.com/albums/u143/heretek/torque/logouser.jpg
separator.png : i167.photobucket.com/albums/u143/heretek/torque/separator.png

Create a new text file, named and saved to art/gui/help/0. About.hfl -- note the
space in the filename.
<lmargin%:5><rmargin%:95><just:center><font:Arial 
Bold:16>Welcome to the Torque 3D Full Template.

<just:left><font:Arial:16>The Full Template is a simple FPS example for use in starting a game. This kit is not a complete game in itself, but does illustrate basic play mechanics as well as provide example art.
 
<bitmap:art/gui/help/logo_torque><font:Arial Bold:16>About Torque 3D: <font:Arial:16>  The  <a:http://www.garagegames.com/products/torque-3d>Torque 3D</a>  Game Engine is an easy-to-use game creation platform architected from the ground up for maximum flexibility and performance across a wide range of hardware. Torque 3D comes equipped with a full suite of tools and APIs to get your game to the finish line, no matter what your goals. Add publishing paths to PC, Mac, Xbox 360, Wii, and the web, and you have the power to distribute games almost everywhere they are played.

<sbreak><bitmap:art/gui/help/logo_gg><font:Arial Bold:16>About GarageGames:<font:Arial:16>  <a:www.garagegames.com>GarageGames</a>  was founded in 2000 with the goal of disrupting the games industry with quality development tools and upsetting the dominant retail/publisher distribution model. As the makers of the Torque game development technology, they have provided professional level cross-platform technology and tools since. 

<sbreak><bitmap:art/gui/help/logo_user><font:Arial Bold:16>About the GarageGames/Torque Community <font:Arial:16>  The GarageGames community is a vibrant and active group of independent game developers and hobbyists.  Through Forum discussions and Resource submissions this community helps provide the Torque developer with additional tools, knowledge, experienced insight, co-conspirators - whatever is needed to unleash the creative spirit and get great innovative independent games to market.

Create a new text file, named and saved to art/gui/help/1. Credits.hfl -- note the space in the filename.
<just:center><lmargin%:5><rmargin%:95><font:Arial Bold:20>CREDITS

The Game Developers<font:Arial:16>
<bitmap:art/gui/help/separator>
Me
Him
Her
Them
Us

<bitmap:art/gui/help/separator>
<font:Arial Bold:20>Torque Engine Credits<font:Arial:16>
GarageGames Staff
Torque Engine Programmers

<bitmap:art/gui/help/separator>
<font:Arial Bold:20>Special Thanks<font:Arial:16>
GarageGames Associates
Torque Community

Create a new text file, named and saved to art/gui/help/2. Game Controls.hfl -- note the space in the filename.
<lmargin%:15><rmargin%:85><just:center><font:Arial Bold:20>Default Control Setup

<font:Arial Bold:16>MOVEMENT<font:Arial:16>
<bitmap:art/gui/help/separator>
<just:left>WASD<just:right>Forward/Back/Left/Right
<just:left>Space<just:right>Jump
<just:left>X<just:right>Crouch

<just:center><font:Arial Bold:16>WEAPONS<font:Arial:16>
<bitmap:art/gui/help/separator>
<just:left>1<just:right>RocketLauncher
<just:left>0<just:right>Unmount weapon
<just:left>Q/Ctrl-Q<just:right>Next/Prev weapon
<just:left>Alt-W<just:right>Throw weapon
<just:left>Alt-A<just:right>Throw ammo
<just:left>Mouse L-Button<just:right>Fire
<just:left>Mouse R-Button<just:right>Alt-fire
<just:left>Mouse Wheel<just:right>Cycle weapons

<just:center><font:Arial Bold:16>VIEW CONTROL<font:Arial:16>
<bitmap:art/gui/help/separator>
<just:left>Z<just:right>Toggle Zoom mode
<just:left>F<just:right>Cycle zoom FOV
<just:left>Tab<just:right>First/Third person camera
<just:left>V<just:right>Vanity view
<just:left>Alt-C<just:right>Toggle between camera/player

<just:center><font:Arial Bold:16>MISC FUNCTIONS<font:Arial:16>
<bitmap:art/gui/help/separator>
<just:left>U<just:right>Send public chat message
<just:left>Ctrl-K<just:right>Die
<just:left>Ctrl-O<just:right>Open Options dialog
<just:left>Ctrl-H<just:right>Toggle Hide HUDs
<just:left>Alt-P<just:right>Hudless Screenshot
<just:left>F10<just:right>Open GUI Editor
<just:left>F11<just:right>Open Level Editor
I'm not going to go into detail about the contents of the help files. They should be
self-explanatory. Remember to check out the TorqueML page on TDN for more infomation regarding Torque's Markup Language tags and usage. Remember to follow the filename format for adding further help/manual pages of your own.

The "More Info" button from the About box will now work and will open the Help manual to the "About" page. Notice the command for the button:
command = "getHelp(\"About\");";
getHelp() is how we control the context aspect of the help system. The string passed as the argument is same as the string used and displayed in the "HelpFileList" GuiTextListCtrl. To access the Help Manual at anytime, remember the previously mentioned keybind 'F1', which until now has been unused in Torque 3D.

One final thing to add. Lets change the keybind for the ControlsHelpDlg hud to display the "Game Controls" page of the Help Manual as another example of accessing a specific page of the Help manual. Inside of default.bind.cs find:
moveMap.bind(keyboard, h, showControlsHelp);
change to
moveMap.bindCmd(keyboard, "h", "getHelp(\"Game Controls\");", "");
Delete the config.cs file (if you have one - it self-generates when the Options gui is put to sleep) and you're ready to go.

#1
06/02/2011 (9:34 am)
Helpful stuff, Mike! :)

Resources on GUI use have historically been a bit thin on the ground.
#2
06/02/2011 (9:53 am)
Yeah that's true... was considering adding to TDN as well.

I just happened to be cleaning out some unused scriptlets in the stock scripts and that keybind caused me to remember the old TGE help manual... figured it would be useful to have working again.

It's surprisingly flexible and easy to use. I've also bastardized it a bit and got an in-game book reader going on :)

Oh, I should be done editing each part now. Damn that word limit making me split things up!! Double-damn that strip-the-backslash-bug-when-editing-code-blocks problem!!!
#3
06/02/2011 (10:08 am)
At least the word limit helps your Resource count on your Profile ;)

And yes, always add to TDN! That damn thing needs more new life breathing into it.
#4
02/04/2012 (2:25 pm)
Thanks, this worked nicely.
#5
02/28/2012 (2:27 am)
Thanks for this! Was just trying to figure out how to do an about page and here it is. Now it's tempting to do what you've done and actually embed the help instead of making a separate manual...