Misc
Written by: Alian713, Kramb
1. xsDumpArrays¶
Returning Type: void
Prototype: void xsDumpArrays()
This function is supposed to blogs out all XS arrays. Currently, it does absolutely nothing.
2. xsGetContextPlayer¶
Returning Type: int
Prototype: int xsGetContextPlayer()
Returns the current context player ID.
3. xsSetContextPlayer¶
Returning Type: void
Prototype: void xsSetContextPlayer(int playerNumber)
Parameters:
int playerNumber: The player to set the context player to
In other functions involving a playerNumber argument, the value of the context player is used if -1 is passed as playerNumber to them. xsEffectAmount will use the value of the context player as its player if -2 is passed to it as the player argument.
4. xsGetFunctionID¶
Returning Type: int
Prototype: int xsGetFunctionID(string functionName)
Parameters:
string functionName: The name of the function to get the hash of
Returns the hash of a given function. This function has no practical application and is probably for internal usage only.
5. xsBreakPoint¶
Returning Type: void
Prototype: void xsBreakPoint()
This function is meant to add a break point to the execution of XS code for debugging. This used to cause a crash in crash earlier versions of DE.
6. xsAddRuntimeEvent¶
Returning Type: bool
Prototype: bool xsAddRuntimeEvent(string runtimeName, string functionName, int functionArgument)
Parameters:
string runtimeName: This is the name of the runtime to create the event in. This should be"Random Map"for RMS and"Scenario Triggers"for scenarios. Find which one to use in a general script by using thexsGetMapName(true)function and checking the extension. To use with an AI, set the runtime name to "Expert" and pass the player number as the argstring functionName: This is the name of a user defined function that takes a single integer argumentint functionArgument: This is an integer argument that is passed to the function given to the argumentfunctionNamewhen this event runs.
A runtime event is called after all the XS code has finished executing but before rules start executing. It calls the function functionName given to it with the functionArgument passed to it as a parameter. For programmers familiar with the terminology, this is basically a way to set a callback. It also returns true if the function name given to it exists, otherwise it returns false. Does not work with built-ins