Click on the banner to return to the Game Guide Menu

Script Writing
by Daniel Leet

Written by Daniel Leet
e-mail: pyro1245@hotmail.com
May 17, 2002

  1. Explanation
  2. Making A Script
  3. Advanced Scripts
  4. Other Commands That Can Be Used In Scripts
  5. Other Stuff

More to come -- a lot more....

1. EXPLANATION

First of all, your probably wondering what a script is, or does. A script is a .cfg file that you can execute from within the game. For example, say you wanted to run seven different commands quickly every time you started the game. Well instead of having to waste all that time and energy, because wasting energy sucks, you can just write a script and then bind it to a key.

Here's an example script:

//start of script

helpusobi 1

give all

setforceall 3

sabercolor red

victory

//end of script

When you run this script, it will give you everything, max out your force powers, turn your light saber red, and make Kyle do his victory dance.

By the way, the two slashes "//" are for adding a comment in your code. The game wont run anything on that line followed by the slashes.

In order for the game to run the script the file has to have the file extension cfg (name of script.cfg), and it to be in the right place. You would have to put the file in: install directory\GameData\base. For me, the full directory was:

C:\Program Files\LucasArts\Star Wars JK II Jedi Outcast\GameData\base

2. MAKING A SCRIPT

Open a new text and copy the sample script in it. After you save it, rename the file to "sample.cfg"

Then move the file into the directory\GameData\base.

Now start the game. Once your in, press Shift + ~ to access the console. Type "exec sample.cfg"

Now you should have everything, your force powers maxed, a red saber, and of course, the victory dance.

There's still more. Go back into the console and type:

"bind h exec sample.cfg"

Now when you hit h, it will execute the script.

3. MORE ADVANCED SCRIPTS

There are two functions you should know about before you start writing advanced scripts, echo, set and vstr.

ECHO

The echo command is pretty simple, it will output white text at the top of the screen.

  • Syntax:

echo <text>

Example:

//echo example

echo FIRE

//end

FIRE would appear at the top of the screen.

SET & VSTR

You can use the alias command to define custom commands.

Syntax:

  • set <variable> <value>
  • The variable would be the new command and the value would be the effect (commands to exec).
  • vstr <variable>
  • The variable would be the command you set with 'set.'

Example:

//Example Alias: Change Saber Color When You Attack

set red "sabercolor red"

bind m "vstr red"

//end

Yeah, yeah, yeah...I know there are easier ways this can be done, but this is just an example of how to use the set and vstr functions.

SABER COLOR MENU

//Saber Color Script

echo Choose Saber Color
echo F1=[RED] F2=[BLUE] F3=[GREEN] F4=[YELLOW] F5=[ORANGE] F6=[PURPLE]

set color1 "sabercolor red; echo Saber Color Changed To Red"
set color2 "sabercolor blue; echo Saber Color Changed To Blue"
set color3 "sabercolor green; echo Saber Color Changed To Green"
set color4 "sabercolor yellow; echo Saber Color Changed To Yellow"
set color5 "sabercolor orange; echo Saber Color Changed To Orange"
set color6 "sabercolor purple; echo Saber Color Changed To Purple"

bind F1 "vstr color1"
bind F2 "vstr color2"
bind F3 "vstr color3"
bind F4 "vstr color4"
bind F5 "vstr color5"
bind F6 "vstr color6"

//end


4. OTHER COMMANDS THAT CAN BE USED IN SCRIPTS

force_throw - use push force power
force_pull - use pull force power
force_speed - use speed force power
force_distract - use distract force power
force_heal - use heal force power
+force_grip - use grip force power
+force_lightning - use lightning force power
+attack - attack
+altattack - alternate attack
+moveup - jump
+moveleft - move left
+moveright - move right
+back - move backwards
+forward - move forwards
toggleconsole - bring console up or down

There are many, many, many, many, many more......

look in jk2config.cfg in /base


5. OTHER STUFF

Version 0.0.1 - First Release

Version 0.0.2
-Fixed some spelling errors
-Added stuff

(c)2002 Daniel Leet. This document may be used and distributed for commercial use only. It may not be in any way edited/ modified. If this document is not shown in its entirety, the information must be correctly cited.

Top

All trademarks herein are acknowledged as the property of their respective owners. Star Wars is a registered trademark of © Lucasfilm Ltd.
Tie Fighter™, X-wing™, X-wing™ vs. Tie Fighter™, Balance of Power™, X-Wing™: Alliance™, Rebel Assault™, Rebel Assault II - The Hidden Empire™, Rogue Squadron™, Dark Forces™, Jedi Knight: Dark Forces II™, Jedi Knight: Mysteries of the Sith™, Jedi Knight™ II: Jedi Outcast™, Jedi Knight™ : Jedi Academy™, Shadows of the Empire™, Rebellion™, Force Commander™, The Phantom Menace™, Episode 1: Racer™, Battle for Naboo™, Galactic Battlegrounds™, Galactic Battlegrounds™: Clone Campaigns™, Starfighter™, Knights of the Old Republic™, Battlefront™, Galaxies ™, Galaxies: Jump to Lightspeed™
Are all registered trademarks of © LucasArts Entertainment Company LEC. © Lucasfilm Ltd. & TM or ® as indicated.
Website Established November 1999
Webpage Design 1999 by Tony Denton.