IDE command-line

Even though the SkookumIDE is a GUI program it can be run with command-line arguments. In this way the command prompt/console and other applications such as Microsoft Visual Studio or your favourite editorTM can communicate with the SkookumScript IDE and even send script commands to a running game or world editor – giving them scripting superpowers.

Arguments can be sent to the SkookumScript IDE on its start-up or after it is already running. If it is already running, any call to a second instance of the IDE will just send any command-line arguments along to the already running IDE, shut down and then the already running IDE will run the passed-along arguments.

Single argument: identifier or file/folder path

The IDE can be called with a single identifier or file/path argument – such as dragging and dropping a file onto SkookumIDE.exe in the Windows Explorer:

Argument1 Action
Class
class path
Browse to class in Skookum IDE Browser. See the -b switch described below.
Class@member
Class.member
<Class>.class_member
member file path
Browse to member in Skookum IDE Browser. See the -b switch described below.
other text file Execute file contents as a script on the startup Mind object. See the -xf switch described below.
Single Argument Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
REM Browse to Master class
C:\Skookum>SkookumIDE Master

REM Browse to _startup() coroutine in Master class
C:\Skookum>SkookumIDE Master._startup

REM Browse to _startup() coroutine in Master class using folder
C:\Skookum>SkookumIDE Scripts\Core\Object\Mind\Master

REM Browse to _startup() coroutine in Master class using file
C:\Skookum>SkookumIDE Scripts\Core\Object\Mind\Master\_startup().sk

REM Parse and execute script code in scripts.sk file
C:\Skookum>SkookumIDE scripts.sk

Where C:\Skookum is shorthand for your SkookumIDE plugin folder, such as D:\UnrealEngine\4.8\Engine\Plugins\SkookumScript\SkookumIDE.

Command-line switches/options

Alternatively the IDE can be called with the following switches:

Switch2 Argument1 Action
-c[f]   Recompile all scripts. -c Recompiles only if binaries are stale and -cf forces a recompile whether stale or not.
[Ignored at start-up.]
-cc Class
class path
Recompile specified class.
[Ignored at start-up. Send results to runtime if connected.]
-cs Class
class path
Recompile specified class and any subclasses.
[Ignored at start-up. Send results to runtime if connected.]
-cm Class@member
Class.member
<Class>.class_member
member file path
Recompile specified coroutine or method member.
[Ignored at start-up.]
-b Class@member
Class.member
<Class>.class_member
member file path
Class
class path
Browse to specified member (coroutine or method) or class using its qualified name or file/path.
-x[i] {expression}1+ Execute specified expression(s) separated with whitespace on the startup Mind object. -x runs script on the runtime and -xi runs the script locally on the IDE.
-xf[i] file path Execute specified file contents as a script on the startup Mind object. -xf runs script on the runtime and -xfi runs locally on the IDE.
-f   Bring the SkookumScript IDE to foreground.
[Can be added prior to other switches.]
-?
-h
  Displays command-line help

Command prompt/console

Here are some example commands to run on the command prompt/console. When testing these yourself it is best if you can see the SkookumScript IDE Console Log view to see the results.

Switch Argument Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
REM Reparse Master class and any subclasses
C:\Skookum>SkookumIDE -cs Master

REM Reparse _startup() coroutine in Master class
C:\Skookum>SkookumIDE -cm Master._startup

REM Do some math locally on the IDE
C:\Skookum>SkookumIDE -xi 200.0 + [123.0 / 3.0]

REM Simulate a 6-sided die on the IDE
C:\Skookum>SkookumIDE -xi 1 + @@random.uniform_int(6)


REM ==== Using the Unreal Engine 4 SkookumDemo ====

REM Get the location of the player
C:\Skookum>SkookumIDE -x payer_pawn.actor_location

REM Have all the Enemy robots explode simultaneously
C:\Skookum>SkookumIDE -x Enemy.instances%_boom

REM You can send several expressions at once
REM Reset position of robots then path one after the other to the player
C:\Skookum>SkookumIDE -x robo_reset Enemy.instances._do[item._path_to_actor(player_pawn)]

Command-line output in IDE log, not command console
Since SkookumIDE.exe is a GUI application it cannot print to the standard ouput in the command console so any output from running it with command-line arguments will be in the SkookumScript IDE log rather than in the command console.

So if nothing seems to happen in the command console after running some SkookumIDE.exe command-line, don’t worry—look at the Log View in the SkookumScript IDE.

When the SkookumScript command-line compiler Sk.exe is available, it can be used for the same purpose, including communicating with any running SkookumScript IDE, though it will be able to print out results and status directly to the command console.

Adding ‘scripting superpowers’ to your other applications

The fun part of SkookumScript IDE command-line arguments is hooking up keyboard shortcuts (sometimes called hotkeys) in your other development tools so that they can interact with the scripting system and the running game engine / editor.

Some of the commands that you might want to hook up will help streamline your workflow. For example: since pressing Ctrl + E while editing a file in the SkookumScript IDE loads up the file in the application associated with the file extension (such as .sk) – one keyboard shortcut that is useful is assigning Ctrl + E on the same associated editor to in turn load up the current file being edited back into the SkookumScript IDE. This makes it easy to toggle back and forth.

Some examples of game script commands that you could run from a different tool:

  • simple or even fairly sophisticated math: turn any text editor into a powerful calculator
  • toggle game settings: make it night/day, disable damage, make all the bad guys have low health, toggle mission achievement/completion flags, enable or disable trigger regions
  • change the game progression: restart the level, jump to the end of a level
  • have the camera orient to or focus on an object of interest
  • teleport the player to location of interest
  • teleport an object/character in front of the player
  • create objects: spawn a vehicle, ammo, powerup, etc. in front of the player
  • change stats: give the player limitless health, special abilities
  • get another character to path to some other object such as the player
  • commands that loop, take time, or display periodic statistics, basically anything you can think of!

Many of these commands could be in the comments above code that you are working on in the game for quick reference or in a handy scratch pad text file of script snippets. Just select it and run it with a key shortcut.

Some of the keyboard shortcuts/assignments that we suggest might already be mapped to other commands – in which case feel free to use another keyboard shortcut or if you think you rarely use it – replace the current mapping. Regardless we suggest adopting a keyboard shortcut standard for your team so that if team members are helping each other through problems or occasionally swapping desks to troubleshoot in person then everyone will have the handy shortcuts that they expect.

Visual Studio

Here are some interesting SkookumScript IDE commands that you can hook into Microsoft Visual Studio and their suggested keyboard shortcuts.

While in Visual Studio go to Tools->External Tools..., press the Add button and enter the info as specified in the table below to add some handy script commands. The Command field should be: <your Skookum IDE dir>\SkookumIDE.exe. You can find all the arguments/variables for External Tools here here or you can also press the triangle to the right of Arguments. Initial directory can be left empty. Prmopt for arguments should be left unchecked. When done, press Apply. You can then move the command up and down as you like – the External Tool order is important when you reference it to give it a keyboard shortcut.

Hotkey Title Argument1
Ctrl+E Skookum Browse File $(ItemPath)
Ctrl+Alt+E Skookum Browse Selected -b $(CurText)
Ctrl+~ Skookum IDE -f
Alt+~ Skookum Run Selected -f -x $(CurText)
Ctrl+Alt+~ Skookum Run IDE Selected -f -xi $(CurText)

Any new External Tool commands added in this way will automatically be added to the Tools pop-up in the Main Menu of Visual Studio. To run them, have the file open or text selected as needed for the command you want to run, open Tools and select the command.

Here are instructions on how to associate keyboard shortcuts. To find the external tool commands that you’ve added, type ExternalCommand in the “Show commands containing:” field. Note that each external command corresponds with its position in the list of external commands as described above.

Other applications

If you have some favorite keyboard shortcuts for an application not yet listed and you think that others would like to know about it – please let us know and we will add them here.

  1. Arguments may optionally be enclosed in double quotes: "arg". The quotes will be kept or removed automatically as needed. 2 3

  2. Switches may use the forward slash / rather than the dash - if desired. So SkookumIDE -? is the same as SkookumIDE /?. Note that a dash - must have some whitespace before it is used such as SkookumIDE -? whereas a forward slash / does not SkookumIDE/?.