Console

From Dragon Age Toolset Wiki
Revision as of 03:16, 28 October 2009 by Georg Zoeller (Talk | contribs) (Using the console in-game)

Jump to: navigation, search

Up in the View Menu other windows you will see one called "Console".

This is where you would enter console commands that allow the toolset to interact with the game engine. It is mostly (if not always) used when you have an area open in the Area Editor.

The console commands were built to work with the game not the toolset but some of them do work with the toolset alone.

Your toolset will crash when using some of them so make sure you save your work before trying them.

Using the console in-game

The in-game console is normally not accessible. To enable it run the game with a command line parameter "enabledeveloperconsole". Then, when the game is running, press the tilde key (~) to bring up the console. This is a prompt in the upper left corner of the screen. The console was used extensively in development for debugging and testing purposes, but in the finished version of the game there's only one console command available; "runscript".

The runscript command does exactly as it says - it runs a script, given as a name typed after a space. So for example:

>runscript killallhostiles

will cause the script named "killallhostiles" to be run.

You can pass the script additional parameters if you like. These parameters will be stored in the module variable RUNSCRIPT_VAR. RUNSCRIPT_VAR is a simple string, your script will need to parse it itself.

Caution: Using scripts like killallhostiles may break scripted plot situations, so you should avoid using it outside of custom content testing.


For example,

>runscript usespecificobject demo100pl_lever

calls the script "usespecificobject" and puts "demo100pl_lever" into the module RUNSCRIPT_VAR. The script can then call

    string sParam = GetLocalString(GetModule(),"RUNSCRIPT_VAR");

to retrieve it.

If you need more than one parameter, pick a separator (a space is usually most appropriate) and split up the string in RUNSCRIPT_VAR appropriately. For example:

    //parse out first parameter - the object to use.
    nSpaceLoc = FindSubString(sParam," ");
    sTemp = SubString(sParam,0,nSpaceLoc);
    oDestination = GetObjectByTag(sTemp);