Difference between revisions of "Client script"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{| style="float:right;"
 +
|-
 +
| {{Resource palette}}
 +
|}
 +
 
Client Scripts are used to automate client behavior and are intended primarily for debugging use.
 
Client Scripts are used to automate client behavior and are intended primarily for debugging use.
 +
 +
The virtual machine that runs client scripts is not included with the ship build of the game, so this resource is likely to be of no practical use.
  
 
== Client Scripting Wait Commands ==
 
== Client Scripting Wait Commands ==
Line 8: Line 15:
 
A script that is paused on a WaitUntil command will timeout after a default of 30 seconds. This time-out can be modified using the void SetWaitTimeout(float fTime) command.
 
A script that is paused on a WaitUntil command will timeout after a default of 30 seconds. This time-out can be modified using the void SetWaitTimeout(float fTime) command.
  
<code>
+
<dascript>
 
void main()
 
void main()
 
{
 
{
Line 21: Line 28:
 
     }
 
     }
 
}
 
}
</code>
+
</dascript>
 +
 
 +
[[Category:Scripts]]

Latest revision as of 20:44, 3 February 2010

Client Scripts are used to automate client behavior and are intended primarily for debugging use.

The virtual machine that runs client scripts is not included with the ship build of the game, so this resource is likely to be of no practical use.

Client Scripting Wait Commands

The client scripting language supports 2 built in commands for pausing a script:

  • void WaitFor(float fTime) - Pauses the script for fTime seconds
  • void WaitUntil(int bCondition) - Pauses the script until bCondition == true

A script that is paused on a WaitUntil command will timeout after a default of 30 seconds. This time-out can be modified using the void SetWaitTimeout(float fTime) command.

void main()
{
    LoadModule( "Sniff Test" );
    PrintToScreen("Loading...");
    WaitUntil( IsModuleLoaded() );
    PerformUseObject( oPlayer, oDoor );
    WaitFor(10.0f);
    if (GetDistanceBetweenObjects(oPlayer, oDoor) < 4.0f)
    {
        PrintToScreen("Player moved to door");
    }
}