CALL
- This page covers the CLI command which is typed into the Console window. For the HSL command which handles remote calls between servers or server and client, see RemoteCall2.
CALL <scriptname> <function/method name> [;<input>]
Arguments
-
<scriptname>
- The name of the client-side script which is to be called
-
-
<function/method name>
- The name of the function or method which is to be run
-
-
<input>
- (optional) A string with data that is passed to
<functionname>
as a parameter. The semicolon is required as a separator, but is not actually passed as part of the data.
-
Description
CALL is a CLI command that can be used in the Console Window as a shortcut to run a particular function or method in a client-side script. This command will not work on server-side scripts. To manually call server-side scripts, instead use a command script via the Chat Panel.
For the CALL command to work, the function or method in the called script must have a specific signature, as follows: <function/method name>(arg as String)
. You can then parse the string (within your script) in whatever way you wish to effectively pass multiple arguments to the code.
The keyword SCRIPT can be used as a synonym for CALL.
Examples
This example will access the Check() function in the client-side script MasterCamera, if typed into the Console window.
call mastercamera check
The following example will manually build the HotSpot Menu. Normally you would open the menu by Ctrl-Shift clicking in the upper lefthand corner of the viewport. However, you can also directly call the _getHotSpotGUI method in the _HotSpotClassMethod script, by typing the following into the Console window:
call _HotSpotClassMethods _getHotSpotGUI