Difference between revisions of "Console"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(It was unclear that you needed a dash)
(a bug and a fix for the bug.)
Line 46: Line 46:
 
     oDestination = GetObjectByTag(sTemp);
 
     oDestination = GetObjectByTag(sTemp);
 
</dascript>
 
</dascript>
 +
 +
== Console text is invisible in some game installs ==
 +
 +
This problem is caused in some systems by the DVD's installer failing to install the fonts.erf file. Fonts.erf is included on the game disk, so you should be able to redo this part of the installation and properly install fonts.erf by running datasetup.exe manually (which is on the game disk in the "data" directory). This should not be an issue for Steam users since a different installer is involved in Steam installations.

Revision as of 00:52, 19 February 2010

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);

Console text is invisible in some game installs

This problem is caused in some systems by the DVD's installer failing to install the fonts.erf file. Fonts.erf is included on the game disk, so you should be able to redo this part of the installation and properly install fonts.erf by running datasetup.exe manually (which is on the game disk in the "data" directory). This should not be an issue for Steam users since a different installer is involved in Steam installations.