Difference between revisions of "Character Script External Code"

From Wolfire Games Wiki
Jump to: navigation, search
(Created page with "This is an alphabetical list of all the external code that is available to be used inside a character script - functions, variables, and classes that seem to "magically" exist. ...")
 
m
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is an alphabetical list of all the external code that is available to be used inside a character script - functions, variables, and classes that seem to "magically" exist.
+
[[Category: Modding]]
 +
[[Category:Overgrowth]]
 +
This is a list of the external code that is only available to be used inside a character script - variables, functions, and classes that "magically" exist.
  
This is pulled from the ~/Documents/Wolfire/Overgrowth/aschar_docs.h file, which is automatically generated by the game.
+
To see a list of external code that is available to all scripts, please see this page - [[Common Script External Code]]
  
See this page to find the location for the Wolfire/Overgrowth folder on each OS - http://wiki.wolfire.com/index.php/How_to_clear_the_game's_cache
+
This list is pulled from the <code>~/Documents/Wolfire/Overgrowth/aschar_docs.h</code> file. That file is automatically generated by the game, so will always be up to date. This page is manually updated, so may be slightly out of date from time to time. '''TODO''': Add character script page and link its docs section here, similar to the [[LevelScripts#Documentation]] page section, so people can find OS-specific instructions on how to find this file.
 
 
'''TODO''': These functions can be documented individually, and can be presented in a grouped list as well
 
'''TODO''': De-dupe this with level scripts, hotspot scripts. Move "generic" functions to a shared script functions page
 
  
 
== Global Variables ==
 
== Global Variables ==
  
<pre style="white-space: pre-wrap;">Camera camera;</pre>
+
<pre style="white-space: pre-wrap;">ASCollisions col; // Access collision functions</pre>
<pre style="white-space: pre-wrap;">CharacterScriptGetter character_getter;</pre>
+
<pre style="white-space: pre-wrap;">ScriptParams params;  // Access the script parameters for the current character</pre>
<pre style="white-space: pre-wrap;">ASCollisions col; // Used to access collision functions</pre>
+
<pre style="white-space: pre-wrap;">ReactionScriptGetter reaction_getter;  // Access to the attack reaction animation data file for the character</pre>
<pre style="white-space: pre-wrap;">ASContext context;</pre>
+
<pre style="white-space: pre-wrap;">SphereCollision sphere_col; // Stores results of collision functions</pre>
<pre style="white-space: pre-wrap;">float last_controller_event_time;  // The time the last game controller input event occurred</pre>
+
<pre style="white-space: pre-wrap;">MovementObject this_mo; // The current character's MovementObject instance</pre>
<pre style="white-space: pre-wrap;">float last_keyboard_event_time;  // The time the last keyboard input event occurred</pre>
 
<pre style="white-space: pre-wrap;">float last_mouse_event_time;  // The time the last mouse input event occurred</pre>
 
<pre style="white-space: pre-wrap;">Level level;</pre>
 
<pre style="white-space: pre-wrap;">ScriptParams params;</pre>
 
<pre style="white-space: pre-wrap;">Physics physics;</pre>
 
<pre style="white-space: pre-wrap;">ReactionScriptGetter reaction_getter;</pre>
 
<pre style="white-space: pre-wrap;">SphereCollision sphere_col; // Stores results of collision functions</pre>
 
<pre style="white-space: pre-wrap;">float the_time; // The current time in seconds since engine started (in-game time)</pre>
 
<pre style="white-space: pre-wrap;">MovementObject this_mo;</pre>
 
<pre style="white-space: pre-wrap;">float time_step; // Time in seconds between engine time steps</pre>
 
<pre style="white-space: pre-wrap;">float ui_time; // The current time in seconds since engine started (absolute time)</pre>
 
<pre style="white-space: pre-wrap;">uint UINT32MAX;</pre>
 
  
 
== Constants ==
 
== Constants ==
  
<pre style="white-space: pre-wrap;">enum AnimationFlags : uint8;</pre>
+
Types in this section that specify the base type for the enum aren't actually exposed via enums. They are defined as const instances of the base type.
<pre style="white-space: pre-wrap;">enum AttachmentType;</pre>
+
 
<pre style="white-space: pre-wrap;">enum AttackerDirectionType : int;</pre>
+
Functions that take those parameters will take the base type instead. E.g. _front is actually defined in your script as an "const int _front".
<pre style="white-space: pre-wrap;">enum AttackerHeightType : int;</pre>
+
 
<pre style="white-space: pre-wrap;">enum CameraFlags;</pre>
+
"Flags" enums can be combined using a bit-wise "or" operator, optionally using a temporary variable. E.g. _ANM_FROM_START | _ANM_MIRRORED
<pre style="white-space: pre-wrap;">enum CollisionSides;</pre>
+
 
<pre style="white-space: pre-wrap;">enum DebugDrawLifespanType : int;</pre>
+
<pre style="white-space: pre-wrap;">enum AnimationFlags : uint8 {
<pre style="white-space: pre-wrap;">enum EngineState;</pre>
+
    _ANM_FROM_START,
<pre style="white-space: pre-wrap;">enum EntityType;</pre>
+
    _ANM_MIRRORED,
<pre style="white-space: pre-wrap;">enum ItemType : int;</pre>
+
    _ANM_MOBILE,
<pre style="white-space: pre-wrap;">enum JsonValueType;</pre>
+
    _ANM_SUPER_MOBILE,
<pre style="white-space: pre-wrap;">enum KeyboardInputModeFlag;</pre>
+
    _ANM_SWAP,
<pre style="white-space: pre-wrap;">enum KnockedOutType : int;</pre>
+
};</pre>
<pre style="white-space: pre-wrap;">enum LogType;</pre>
+
<pre style="white-space: pre-wrap;">enum AttackerDirectionType : int {
<pre style="white-space: pre-wrap;">enum MessageType : int;</pre>
+
    _front,
<pre style="white-space: pre-wrap;">enum NavPathFlag;</pre>
+
    _left,
<pre style="white-space: pre-wrap;">enum SDLNumeric;</pre>
+
    _right,
<pre style="white-space: pre-wrap;">enum SamplePolyFlag;</pre>
+
};</pre>
<pre style="white-space: pre-wrap;">enum SoundGroupPriorityType : int;</pre>
+
<pre style="white-space: pre-wrap;">enum AttackerHeightType : int {
<pre style="white-space: pre-wrap;">enum TextAtlasFlags;</pre>
+
    _high,
<pre style="white-space: pre-wrap;">enum UserVote;</pre>
+
    _low,
 +
    _medium,
 +
};</pre>
 +
<pre style="white-space: pre-wrap;">enum CollisionSides {
 +
    DOUBLE_SIDED,
 +
    SINGLE_SIDED,
 +
};</pre>
 +
<pre style="white-space: pre-wrap;">enum NavPathFlag {
 +
    DT_STRAIGHTPATH_START,
 +
    DT_STRAIGHTPATH_END,
 +
    DT_STRAIGHTPATH_OFFMESH_CONNECTION,
 +
};</pre>
 +
<pre style="white-space: pre-wrap;">enum SamplePolyFlag {
 +
    POLYFLAGS_NONE,
 +
    POLYFLAGS_WALK,
 +
    POLYFLAGS_SWIM,
 +
    POLYFLAGS_DOOR,
 +
    POLYFLAGS_JUMP1,
 +
    POLYFLAGS_JUMP2,
 +
    POLYFLAGS_JUMP3,
 +
    POLYFLAGS_JUMP4,
 +
    POLYFLAGS_JUMP5,
 +
    POLYFLAGS_JUMP_ALL,
 +
    POLYFLAGS_DISABLED,
 +
    POLYFLAGS_ALL,
 +
};</pre>
  
 
== Global Functions ==
 
== Global Functions ==
  
<pre style="white-space: pre-wrap;">float abs(float);</pre>
+
<pre style="white-space: pre-wrap;">float GetAnimationEventTime( string &in anim_path, string &in event_label ); // Query the time an animation event occurs in an animation</pre>
<pre style="white-space: pre-wrap;">float acos(float);</pre>
+
<pre style="white-space: pre-wrap;">NavPoint GetNavPoint(vec3 target_pos); // Do a navigation query to the given position</pre>
<pre style="white-space: pre-wrap;">float asin(float);</pre>
+
<pre style="white-space: pre-wrap;">vec3 GetNavPointPos(vec3 target_pos);
<pre style="white-space: pre-wrap;">void assert(bool val);</pre>
+
// Shortcut to GetNavPoint(target_pos).GetPos(), without checking if the resulting query resulted in a valid position - warning, might return the origin!</pre>
<pre style="white-space: pre-wrap;">float atan(float);</pre>
+
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end); // Do a navigation query (including retrieving waypoints) to a given position</pre>
<pre style="white-space: pre-wrap;">float atan2(float, float);</pre>
+
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);
<pre style="white-space: pre-wrap;">float atof(const string &in str);</pre>
+
// Do a navigation query (including retrieving waypoints) to a given position, allowing certain navigation types to be filtered or excluded.
<pre style="white-space: pre-wrap;">int atoi(const string &in str);</pre>
+
// Filtering and exclusion currently just used to filter out jump nodes for non-rabbits</pre>
<pre style="white-space: pre-wrap;">float ceil(float);</pre>
+
<pre style="white-space: pre-wrap;">vec3 LineLineIntersect(vec3 start_a, vec3 end_a, vec3 start_b, vec3 end_b);
<pre style="white-space: pre-wrap;">float cos(float);</pre>
+
// Get closest point between two line segments
<pre style="white-space: pre-wrap;">vec3 cross(const vec3 &in, const vec3 &in);</pre>
+
// Useful for per-poly intersection tests, for example with weapon strikes to create blood lines and detect if metal was hit</pre>
<pre style="white-space: pre-wrap;">float distance(const vec2 &in, const vec2 &in);</pre>
+
<pre style="white-space: pre-wrap;">vec3 NavRaycast(vec3 start, vec3 end); // Used for path prediction - TODO: More detail</pre>
<pre style="white-space: pre-wrap;">float distance(const vec3 &in, const vec3 &in);</pre>
+
<pre style="white-space: pre-wrap;">vec3 NavRaycastSlide(vec3 start, vec3 end, int depth); // Used for path prediction - TODO: More detail,
<pre style="white-space: pre-wrap;">float distance_squared(const vec2 &in, const vec2 &in);</pre>
+
and difference between slide/not slide</pre>
<pre style="white-space: pre-wrap;">float distance_squared(const vec3 &in, const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float dot(const vec2 &in, const vec2 &in);</pre>
 
<pre style="white-space: pre-wrap;">float dot(const vec3 &in, const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float floor(float);</pre>
 
<pre style="white-space: pre-wrap;">double fpFromIEEE(uint64);</pre>
 
<pre style="white-space: pre-wrap;">float fpFromIEEE(uint);</pre>
 
<pre style="white-space: pre-wrap;">uint fpToIEEE(float);</pre>
 
<pre style="white-space: pre-wrap;">uint64 fpToIEEE(double);</pre>
 
<pre style="white-space: pre-wrap;">BoneTransform invert(const BoneTransform &in);</pre>
 
<pre style="white-space: pre-wrap;">mat4 invert(mat4);</pre>
 
<pre style="white-space: pre-wrap;">quaternion invert(quaternion quat);</pre>
 
<pre style="white-space: pre-wrap;">float length(const vec2 &in);</pre>
 
<pre style="white-space: pre-wrap;">float length(const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float length_squared(const vec2 &in);</pre>
 
<pre style="white-space: pre-wrap;">float length_squared(const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float log(float);</pre>
 
<pre style="white-space: pre-wrap;">float log10(float);</pre>
 
<pre style="white-space: pre-wrap;">float max(float, float);</pre>
 
<pre style="white-space: pre-wrap;">int max(int, int);</pre>
 
<pre style="white-space: pre-wrap;">float min(float, float);</pre>
 
<pre style="white-space: pre-wrap;">int min(int, int);</pre>
 
<pre style="white-space: pre-wrap;">float mix(float a, float b, float amount);</pre>
 
<pre style="white-space: pre-wrap;">BoneTransform mix(const BoneTransform &in a, const BoneTransform &in b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">mat4 mix(const mat4 &in a, const mat4 &in b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">quaternion mix(const quaternion &in a, const quaternion &in b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">vec2 mix(vec2 a, vec2 b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">vec3 mix(vec3 a, vec3 b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">vec4 mix(vec4 a, vec4 b, float alpha);</pre>
 
<pre style="white-space: pre-wrap;">vec2 normalize(const vec2 &in);</pre>
 
<pre style="white-space: pre-wrap;">vec3 normalize(const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float pow(float val, float exponent);</pre>
 
<pre style="white-space: pre-wrap;">int rand();</pre>
 
<pre style="white-space: pre-wrap;">vec2 reflect(const vec2 &in vec, const vec2 &in normal);</pre>
 
<pre style="white-space: pre-wrap;">vec3 reflect(const vec3 &in vec, const vec3 &in normal);</pre>
 
<pre style="white-space: pre-wrap;">float sin(float);</pre>
 
<pre style="white-space: pre-wrap;">float sqrt(float);</pre>
 
<pre style="white-space: pre-wrap;">float tan(float);</pre>
 
<pre style="white-space: pre-wrap;">mat4 transpose(mat4);</pre>
 
<pre style="white-space: pre-wrap;">float xz_distance(const vec3 &in, const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">float xz_distance_squared(const vec3 &in, const vec3 &in);</pre>
 
<pre style="white-space: pre-wrap;">void ActivateKeyboardEvents();</pre>
 
<pre style="white-space: pre-wrap;">void AddDebugDrawRibbonPoint(int which, vec3 pos, vec4 color, float width);</pre>
 
<pre style="white-space: pre-wrap;">bool AddMusic(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void Breakpoint(int);</pre>
 
<pre style="white-space: pre-wrap;">bool CheckSaveLevelChanges();</pre>
 
<pre style="white-space: pre-wrap;">void ClearTemporaryDecals();  // Like blood splats and footprints</pre>
 
<pre style="white-space: pre-wrap;">void ClearUndoHistory();</pre>
 
<pre style="white-space: pre-wrap;">void ConnectParticles(uint32 id_a, uint32 id_b);  // Used for ribbon particles, like throat-cut blood</pre>
 
<pre style="white-space: pre-wrap;">void CreateCustomHull(const string &in key, const array<vec3> &vertices);</pre>
 
<pre style="white-space: pre-wrap;">int CreateObject(const string &in path);</pre>
 
<pre style="white-space: pre-wrap;">int CreateObject(const string &in path, bool exclude_from_save);</pre>
 
<pre style="white-space: pre-wrap;">void DeactivateAllMods();</pre>
 
<pre style="white-space: pre-wrap;">void DeactivateKeyboardEvents();</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawBillboard(const string &in path, vec3 center, float scale, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawCircle(mat4 transform, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawLine(vec3 start, vec3 end, vec3 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawLine(vec3 start, vec3 end, vec3 start_color, vec3 end_color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawLine(vec3 start, vec3 end, vec4 start_color, vec4 end_color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawLines(const array<vec3> &vertices, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawPoint(vec3 pos, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">void DebugDrawRemove(int id);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawRibbon(int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawRibbon(vec3 start, vec3 end, vec4 start_color, vec4 end_color, float start_width, float end_width, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawText(vec3 pos, string text, float scale, bool screen_space, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireBox(vec3 pos, vec3 dimensions, vec3 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireCylinder(vec3 pos, float radius, float height, vec3 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireMesh(string path, mat4 transform, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireScaledSphere(vec3 pos, float radius, vec3 scale, vec3 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireScaledSphere(vec3 pos, float radius, vec3 scale, vec4 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">int DebugDrawWireSphere(vec3 pos, float radius, vec3 color, int lifespan);</pre>
 
<pre style="white-space: pre-wrap;">bool DebugKeysEnabled();</pre>
 
<pre style="white-space: pre-wrap;">int DebugSetPosition(int id, vec3 pos);</pre>
 
<pre style="white-space: pre-wrap;">void DebugText(string key, string display_text, float lifetime);</pre>
 
<pre style="white-space: pre-wrap;">void DeleteObjectID(int);</pre>
 
<pre style="white-space: pre-wrap;">void DeselectAll();</pre>
 
<pre style="white-space: pre-wrap;">void DisplayError(const string &in title, const string &in contents);</pre>
 
<pre style="white-space: pre-wrap;">void DisposeTextAtlases();</pre>
 
<pre style="white-space: pre-wrap;">bool DoesItemFitInItem(int item_id, int holster_item_id);</pre>
 
<pre style="white-space: pre-wrap;">void DrawTextAtlas(const string &in path, int pixel_height, int flags, const string &in txt, int x, int y, vec4 color);</pre>
 
<pre style="white-space: pre-wrap;">void DrawTextAtlas2(const string &in path, int pixel_height, int flags, const string &in txt, int x, int y, vec4 color, uint char_limit);</pre>
 
<pre style="white-space: pre-wrap;">int DuplicateObject(Object@ obj);</pre>
 
<pre style="white-space: pre-wrap;">bool EditorEnabled();</pre>
 
<pre style="white-space: pre-wrap;">bool EditorModeActive();</pre>
 
<pre style="white-space: pre-wrap;">void EnterTelemetryZone(const string &in name);</pre>
 
<pre style="white-space: pre-wrap;">bool FileExists(string &in);</pre>
 
<pre style="white-space: pre-wrap;">int FindFirstCharacterInGroup(int id);</pre>
 
<pre style="white-space: pre-wrap;">string FloatString(float val, int digits);</pre>
 
<pre style="white-space: pre-wrap;">array<ModID>@ GetActiveModSids();</pre>
 
<pre style="white-space: pre-wrap;">float GetAnimationEventTime( string &in anim_path, string &in event_label );</pre>
 
<pre style="white-space: pre-wrap;">array<string>@ GetAvailableBindingCategories();</pre>
 
<pre style="white-space: pre-wrap;">array<string>@ GetAvailableBindings(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">vec3 GetBaseSkyTint();</pre>
 
<pre style="white-space: pre-wrap;">string GetBindingValue(string binding_category, string binding);</pre>
 
<pre style="white-space: pre-wrap;">int GetBloodLevel();</pre>
 
<pre style="white-space: pre-wrap;">const vec3 &GetBloodTint();</pre>
 
<pre style="white-space: pre-wrap;">string GetBuildTimestamp( );</pre>
 
<pre style="white-space: pre-wrap;">string GetBuildVersionFull( );</pre>
 
<pre style="white-space: pre-wrap;">string GetBuildVersionShort( );</pre>
 
<pre style="white-space: pre-wrap;">Campaign GetCampaign(string& campaign_id);</pre>
 
<pre style="white-space: pre-wrap;">array<Campaign>@ GetCampaigns();</pre>
 
<pre style="white-space: pre-wrap;">void GetCharacters(array<int>@ id_array);</pre>
 
<pre style="white-space: pre-wrap;">void GetCharactersInHull(string model_path, mat4, array<int>@ id_array);</pre>
 
<pre style="white-space: pre-wrap;">void GetCharactersInSphere(vec3 position, float radius, array<int>@ id_array);</pre>
 
<pre style="white-space: pre-wrap;">int GetCodeForKey(string key_name);</pre>
 
<pre style="white-space: pre-wrap;">uint GetCodepointCount( const string &in );</pre>
 
<pre style="white-space: pre-wrap;">bool GetConfigValueBool(string index);</pre>
 
<pre style="white-space: pre-wrap;">float GetConfigValueFloat(string index);</pre>
 
<pre style="white-space: pre-wrap;">int GetConfigValueInt(string key);</pre>
 
<pre style="white-space: pre-wrap;">array<string>@ GetConfigValueOptions(string index);</pre>
 
<pre style="white-space: pre-wrap;">string GetConfigValueString(string index);</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrCampaignID();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrLevel();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrLevelAbsPath();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrLevelID();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrLevelName();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrLevelRelPath();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrentLevelModsourceID();</pre>
 
<pre style="white-space: pre-wrap;">string GetCurrentMenuModsourceID();</pre>
 
<pre style="white-space: pre-wrap;">int GetFontFaceID(const string &in path, int pixel_height);</pre>
 
<pre style="white-space: pre-wrap;">float GetFriction(const vec3 &in position);</pre>
 
<pre style="white-space: pre-wrap;">float GetHDRBlackPoint(void);</pre>
 
<pre style="white-space: pre-wrap;">float GetHDRBloomMult(void);</pre>
 
<pre style="white-space: pre-wrap;">float GetHDRWhitePoint(void);</pre>
 
<pre style="white-space: pre-wrap;">bool GetInputDown(int controller_id, const string &in input_label);</pre>
 
<pre style="white-space: pre-wrap;">bool GetInputDownFiltered(int controller_id, const string &in input_label, uint filter);</pre>
 
<pre style="white-space: pre-wrap;">uint GetInputMode();</pre>
 
<pre style="white-space: pre-wrap;">bool GetInputPressed(int controller_id, const string &in input_label);</pre>
 
<pre style="white-space: pre-wrap;">bool GetInputPressedFiltered(int controller_id, const string &in input_label, uint filter);</pre>
 
<pre style="white-space: pre-wrap;">string GetInterlevelData(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">float GetLayerGain(const string &in layer);</pre>
 
<pre style="white-space: pre-wrap;">array<string>@ GetLayerNames();</pre>
 
<pre style="white-space: pre-wrap;">uint GetLengthInBytesForNCodepoints( const string &in, uint codepoint_index );</pre>
 
<pre style="white-space: pre-wrap;">string GetLevelName(const string& path);</pre>
 
<pre style="white-space: pre-wrap;">string GetLocaleStringForScancode(int scancode);</pre>
 
<pre style="white-space: pre-wrap;">float GetLookXAxis(int controller_id);</pre>
 
<pre style="white-space: pre-wrap;">float GetLookYAxis(int controller_id);</pre>
 
<pre style="white-space: pre-wrap;">bool GetMenuPaused();  // Is game paused by a menu</pre>
 
<pre style="white-space: pre-wrap;">array<ModID>@ GetModSids();</pre>
 
<pre style="white-space: pre-wrap;">float GetMoveXAxis(int controller_id);</pre>
 
<pre style="white-space: pre-wrap;">float GetMoveYAxis(int controller_id);</pre>
 
<pre style="white-space: pre-wrap;">NavPoint GetNavPoint(vec3);</pre>
 
<pre style="white-space: pre-wrap;">vec3 GetNavPointPos(vec3);</pre>
 
<pre style="white-space: pre-wrap;">int GetNumCharacters();</pre>
 
<pre style="white-space: pre-wrap;">int GetNumHotspots();</pre>
 
<pre style="white-space: pre-wrap;">int GetNumItems();</pre>
 
<pre style="white-space: pre-wrap;">array<int> @GetObjectIDs();</pre>
 
<pre style="white-space: pre-wrap;">array<int> @GetObjectIDsType(int type);</pre>
 
<pre style="white-space: pre-wrap;">void GetObjectsInHull(string model_path, mat4, array<int>@ id_array);</pre>
 
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end);</pre>
 
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);</pre>
 
<pre style="white-space: pre-wrap;">uint64 GetPerformanceCounter();  // Get high precision time info for profiling</pre>
 
<pre style="white-space: pre-wrap;">uint64 GetPerformanceFrequency();  // Used to convert PerformanceCounter into seconds</pre>
 
<pre style="white-space: pre-wrap;">array<vec2>@ GetPossibleResolutions();</pre>
 
<pre style="white-space: pre-wrap;">array<KeyboardPress>@ GetRawKeyboardInputs();</pre>
 
<pre style="white-space: pre-wrap;">void GetRotationBetweenVectors(const vec3 &in start, const vec3 &in end, quaternion &out rotation);</pre>
 
<pre style="white-space: pre-wrap;">int GetScreenHeight();</pre>
 
<pre style="white-space: pre-wrap;">int GetScreenWidth();</pre>
 
<pre style="white-space: pre-wrap;">string GetSegment();</pre>
 
<pre style="white-space: pre-wrap;">vec3 GetSkyTint();</pre>
 
<pre style="white-space: pre-wrap;">string GetSong();</pre>
 
<pre style="white-space: pre-wrap;">bool GetSplitscreen();</pre>
 
<pre style="white-space: pre-wrap;">string GetStringDescriptionForBinding( const string &in, const string &in );</pre>
 
<pre style="white-space: pre-wrap;">float GetSunAmbient();</pre>
 
<pre style="white-space: pre-wrap;">vec3 GetSunColor();</pre>
 
<pre style="white-space: pre-wrap;">vec3 GetSunPosition();</pre>
 
<pre style="white-space: pre-wrap;">TextMetrics GetTextAtlasMetrics(const string &in path, int pixel_height, int flags, const string &in txt );</pre>
 
<pre style="white-space: pre-wrap;">TextMetrics GetTextAtlasMetrics2(const string &in path, int pixel_height, int flags, const string &in txt, uint char_limit );</pre>
 
<pre style="white-space: pre-wrap;">bool IsGroupDerived(int id);</pre>
 
<pre style="white-space: pre-wrap;">bool IsKeyDown(int key_code);</pre>
 
<pre style="white-space: pre-wrap;">bool IsWorkshopAvailable();</pre>
 
<pre style="white-space: pre-wrap;">bool IsWorkshopMod(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool IsWorkshopSubscribed(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">void LeaveTelemetryZone();</pre>
 
<pre style="white-space: pre-wrap;">vec3 LineLineIntersect(vec3 start_a, vec3 end_a, vec3 start_b, vec3 end_b);  // Get closest point between two line segments</pre>
 
<pre style="white-space: pre-wrap;">void LoadEditorLevel();</pre>
 
<pre style="white-space: pre-wrap;">void LoadLevel(string level_path);</pre>
 
<pre style="white-space: pre-wrap;">void LoadLevelID(string id);</pre>
 
<pre style="white-space: pre-wrap;">void Log( LogType level, const string &in str );</pre>
 
<pre style="white-space: pre-wrap;">uint32 MakeParticle(string path, vec3 pos, vec3 vel);</pre>
 
<pre style="white-space: pre-wrap;">uint32 MakeParticle(string path, vec3 pos, vec3 vel, vec3 color);</pre>
 
<pre style="white-space: pre-wrap;">mat3 Mat3FromQuaternion(const quaternion &in);</pre>
 
<pre style="white-space: pre-wrap;">mat4 Mat4FromQuaternion(const quaternion &in);</pre>
 
<pre style="white-space: pre-wrap;">bool MediaMode();</pre>
 
<pre style="white-space: pre-wrap;">bool ModActivation(ModID& sid, bool active);</pre>
 
<pre style="white-space: pre-wrap;">bool ModCanActivate(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetAuthor(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">array<ModLevel>@ ModGetCampaignLevels(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetDescription(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetID(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">array<MenuItem>@ ModGetMenuItems(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetName(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetPath(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">array<ModLevel>@ ModGetSingleLevels(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">int ModGetSource(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetTags(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetThumbnail(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">UserVote ModGetUserVote(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetValidityString(ModID& sid);</pre>
 
<pre style="white-space: pre-wrap;">string ModGetVersion(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool ModIsActive(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool ModIsCore(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool ModIsFavorite(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool ModIsValid(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool ModNeedsRestart(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">bool MovementObjectExists(int id);</pre>
 
<pre style="white-space: pre-wrap;">vec3 Mult(quaternion, vec3);  // Applies a quaternion rotation to a vector</pre>
 
<pre style="white-space: pre-wrap;">vec3 NavRaycast(vec3 start, vec3 end);</pre>
 
<pre style="white-space: pre-wrap;">vec3 NavRaycastSlide(vec3 start, vec3 end, int depth);</pre>
 
<pre style="white-space: pre-wrap;">bool ObjectExists();</pre>
 
<pre style="white-space: pre-wrap;">bool ObjectExists(int id);</pre>
 
<pre style="white-space: pre-wrap;">void OpenModAuthorWorkshopPage(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">void OpenModWorkshopPage(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">void OpenWorkshop();</pre>
 
<pre style="white-space: pre-wrap;">void PlaySegment(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void PlaySong(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySound(string path);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySound(string path, vec3 position);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundGroup(string path);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundGroup(string path, float gain);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundGroup(string path, vec3 position);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundGroup(string path, vec3 position, float gain);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundGroup(string path, vec3 position, int priority);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundLoop(const string &in path, float gain);</pre>
 
<pre style="white-space: pre-wrap;">int PlaySoundLoopAtLocation(const string &in path, vec3 pos, float gain);</pre>
 
<pre style="white-space: pre-wrap;">void PrintCallstack();</pre>
 
<pre style="white-space: pre-wrap;">quaternion QuaternionFromMat4(const mat4 &in);</pre>
 
<pre style="white-space: pre-wrap;">void QueueDeleteObjectID(int);</pre>
 
<pre style="white-space: pre-wrap;">void QueueSegment(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">float RangedRandomFloat(float min, float max);</pre>
 
<pre style="white-space: pre-wrap;">MovementObject@ ReadCharacter(int index);  // e.g. first character in scene</pre>
 
<pre style="white-space: pre-wrap;">MovementObject@ ReadCharacterID(int id);  // e.g. character with object ID 39</pre>
 
<pre style="white-space: pre-wrap;">EnvObject@ ReadEnvObjectID(int id);</pre>
 
<pre style="white-space: pre-wrap;">Hotspot@ ReadHotspot(int index);</pre>
 
<pre style="white-space: pre-wrap;">ItemObject@ ReadItem(int index);</pre>
 
<pre style="white-space: pre-wrap;">ItemObject@ ReadItemID(int id);</pre>
 
<pre style="white-space: pre-wrap;">Object@ ReadObjectFromID(int);</pre>
 
<pre style="white-space: pre-wrap;">void ReloadMods();</pre>
 
<pre style="white-space: pre-wrap;">void ReloadStaticValues();</pre>
 
<pre style="white-space: pre-wrap;">bool RemoveMusic(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void RequestModSetFavorite(ModID& id, bool fav);</pre>
 
<pre style="white-space: pre-wrap;">void RequestModSetUserVote(ModID& id, bool voteup);</pre>
 
<pre style="white-space: pre-wrap;">void RequestWorkshopSubscribe(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">void RequestWorkshopUnSubscribe(ModID& id);</pre>
 
<pre style="white-space: pre-wrap;">void ResetBinding(string binding_category, string binding);</pre>
 
<pre style="white-space: pre-wrap;">void ResetLevel();</pre>
 
<pre style="white-space: pre-wrap;">void RibbonItemFlash(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void RibbonItemSetEnabled(const string &in, bool);</pre>
 
<pre style="white-space: pre-wrap;">void RibbonItemSetToggled(const string &in, bool);</pre>
 
<pre style="white-space: pre-wrap;">string SaveConfig();</pre>
 
<pre style="white-space: pre-wrap;">void SendGlobalMessage(string msg);</pre>
 
<pre style="white-space: pre-wrap;">void SendMessage(int target, int type, vec3 vec_a, vec3 vec_b);</pre>
 
<pre style="white-space: pre-wrap;">void SendMessage(int type, string msg);</pre>
 
<pre style="white-space: pre-wrap;">void SetAirWhoosh(float volume, float pitch);</pre>
 
<pre style="white-space: pre-wrap;">void SetBindingValue(string binding_category, string binding, string value);</pre>
 
<pre style="white-space: pre-wrap;">void SetCampaignID(string id);</pre>
 
<pre style="white-space: pre-wrap;">void SetConfigValueBool(string key, bool value);</pre>
 
<pre style="white-space: pre-wrap;">void SetConfigValueFloat(string key, float value);</pre>
 
<pre style="white-space: pre-wrap;">void SetConfigValueInt(string key, int value);</pre>
 
<pre style="white-space: pre-wrap;">void SetConfigValueString(string key, string value);</pre>
 
<pre style="white-space: pre-wrap;">void SetFlareDiffuse(float);</pre>
 
<pre style="white-space: pre-wrap;">void SetGrabMouse(bool);</pre>
 
<pre style="white-space: pre-wrap;">void SetHDRBlackPoint(float);</pre>
 
<pre style="white-space: pre-wrap;">void SetHDRBloomMult(float);</pre>
 
<pre style="white-space: pre-wrap;">void SetHDRWhitePoint(float);</pre>
 
<pre style="white-space: pre-wrap;">void SetInterlevelData(const string &in, const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void SetKeyboardBindingValue(string binding_category, string binding, uint32 scancode);</pre>
 
<pre style="white-space: pre-wrap;">void SetLayerGain(const string &in layer, float gain);</pre>
 
<pre style="white-space: pre-wrap;">void SetMediaMode(bool);</pre>
 
<pre style="white-space: pre-wrap;">void SetPaused(bool paused);</pre>
 
<pre style="white-space: pre-wrap;">void SetSegment(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void SetSkyTint(vec3);</pre>
 
<pre style="white-space: pre-wrap;">void SetSong(const string &in);</pre>
 
<pre style="white-space: pre-wrap;">void SetSoundGain(int handle, float gain);</pre>
 
<pre style="white-space: pre-wrap;">void SetSoundPitch(int handle, float pitch);</pre>
 
<pre style="white-space: pre-wrap;">void SetSoundPosition(int handle, vec3 pos);</pre>
 
<pre style="white-space: pre-wrap;">void SetSunAmbient(float);</pre>
 
<pre style="white-space: pre-wrap;">void SetSunColor(vec3);</pre>
 
<pre style="white-space: pre-wrap;">void SetSunPosition(vec3);</pre>
 
<pre style="white-space: pre-wrap;">void StartStopwatch();</pre>
 
<pre style="white-space: pre-wrap;">void StartTextInput();</pre>
 
<pre style="white-space: pre-wrap;">uint64 StopAndReportStopwatch();</pre>
 
<pre style="white-space: pre-wrap;">void StopSound(int handle);</pre>
 
<pre style="white-space: pre-wrap;">void StopTextInput();</pre>
 
<pre style="white-space: pre-wrap;">int StorageGetInt32(string index);</pre>
 
<pre style="white-space: pre-wrap;">string StorageGetString(string index);</pre>
 
<pre style="white-space: pre-wrap;">bool StorageHasInt32(string index);</pre>
 
<pre style="white-space: pre-wrap;">bool StorageHasString(string index);</pre>
 
<pre style="white-space: pre-wrap;">void StorageSetInt32(string index, int value);</pre>
 
<pre style="white-space: pre-wrap;">void StorageSetString(string index, string value);</pre>
 
<pre style="white-space: pre-wrap;">void TimedSlowMotion(float target_time_scale, float how_long, float delay);  // Used to trigger brief periods of slow motion</pre>
 
<pre style="white-space: pre-wrap;">void TintParticle(uint32 id, const vec3 &in color);</pre>
 
<pre style="white-space: pre-wrap;">string ToUpper(string &in);</pre>
 
<pre style="white-space: pre-wrap;">void UpdateListener(vec3 pos, vec3 vel, vec3 facing, vec3 up);</pre>
 
<pre style="white-space: pre-wrap;">uint WorkshopDownloadPendingCount();</pre>
 
<pre style="white-space: pre-wrap;">uint WorkshopDownloadingCount();</pre>
 
<pre style="white-space: pre-wrap;">uint WorkshopNeedsUpdateCount();</pre>
 
<pre style="white-space: pre-wrap;">uint WorkshopSubscribedNotInstalledCount();</pre>
 
<pre style="white-space: pre-wrap;">float WorkshopTotalDownloadProgress();</pre>
 
  
 
== Classes ==
 
== Classes ==
 +
=== [[#ASCollisions class|ASCollisions class]] ===
 +
<pre style="white-space: pre-wrap;">class ASCollisions;</pre>
 +
Invoke collision test queries. Results are stored in the global SphereCollision sphere_col object instance.
  
<pre style="white-space: pre-wrap;">class array<T>;</pre>
+
'''Methods'''
<pre style="white-space: pre-wrap;">class mat3;</pre>
+
<pre style="white-space: pre-wrap;">vec3 GetSlidingCapsuleCollision(vec3 start, vec3 end, float radius);
<pre style="white-space: pre-wrap;">class mat4;</pre>
+
void GetSlidingSphereCollision(vec3 pos, float radius);
<pre style="white-space: pre-wrap;">class quaternion;</pre>
+
void GetSlidingSphereCollisionDoubleSided(vec3 pos, float radius);
<pre style="white-space: pre-wrap;">class vec2;</pre>
+
void GetScaledSphereCollision(vec3 pos, float radius, vec3 scale);
<pre style="white-space: pre-wrap;">class vec3;</pre>
+
void GetScaledSpherePlantCollision(vec3 pos, float radius, vec3 scale);
<pre style="white-space: pre-wrap;">class vec4;</pre>
+
void GetSlidingScaledSphereCollision(vec3 pos, float radius, vec3 scale);
<pre style="white-space: pre-wrap;">class ASCollisions;</pre>
+
void GetCylinderCollision(vec3 pos, float radius, float height);
<pre style="white-space: pre-wrap;">class ASContext;</pre>
+
void GetCylinderCollisionDoubleSided(vec3 pos, float radius, float height);
<pre style="white-space: pre-wrap;">class AnimationClient;</pre>
+
void GetSweptSphereCollision(const vec3 &in start, const vec3 &in end, float radius);
 +
void GetSweptSphereCollisionCharacters(vec3 start, vec3 end, float radius);
 +
void GetSweptCylinderCollision(vec3 start, vec3 end, float radius, float height);
 +
void GetSweptCylinderCollisionDoubleSided(vec3 start, vec3 end, float radius, float height);
 +
void GetSweptBoxCollision(vec3 start, vec3 end, vec3 dimensions);
 +
void CheckRayCollisionCharacters(vec3 start, vec3 end);
 +
vec3 GetRayCollision(vec3 start, vec3 end);
 +
void GetObjRayCollision(vec3 start, vec3 end);
 +
void GetPlantRayCollision(vec3 start, vec3 end);
 +
void GetObjectsInSphere(vec3 pos, float radius);</pre>
 +
 
 +
'''Related Global Variables'''
 +
<pre style="white-space: pre-wrap;">ASCollisions col; // The global instance of this class</pre>
 +
<pre style="white-space: pre-wrap;">SphereCollision sphere_col; // Results of the last invoked collision method are stored here</pre>
 +
----
 +
=== [[#AttackScriptGetter class|AttackScriptGetter class]] ===
 
<pre style="white-space: pre-wrap;">class AttackScriptGetter;</pre>
 
<pre style="white-space: pre-wrap;">class AttackScriptGetter;</pre>
<pre style="white-space: pre-wrap;">class BoneTransform;</pre>
+
Used to query information from an attack xml file
<pre style="white-space: pre-wrap;">class Camera;</pre>
+
 
<pre style="white-space: pre-wrap;">class Campaign;</pre>
+
'''Methods'''
<pre style="white-space: pre-wrap;">class CharacterScriptGetter;</pre>
+
<pre style="white-space: pre-wrap;">AttackScriptGetter(); // Default constructor (reference type)
 +
void Load(const string &in path);  // Load an attack xml file into the attack script getter (e.g. "Data/Attacks/knifeslash.xml")
 +
string GetPath(); // Get the current specified path for this attack XML file
 +
string GetSpecial();
 +
string GetUnblockedAnimPath();
 +
string GetBlockedAnimPath();
 +
string GetThrowAnimPath();
 +
string GetThrownAnimPath();
 +
string GetThrownCounterAnimPath();
 +
int IsThrow();
 +
int GetHeight();
 +
vec3 GetCutPlane();
 +
int GetCutPlaneType();
 +
bool HasCutPlane();
 +
vec3 GetStabDir();
 +
int GetStabDirType();
 +
bool HasStabDir();
 +
int GetDirection();
 +
int GetSwapStance();
 +
int GetSwapStanceBlocked();
 +
int GetUnblockable();
 +
int GetFleshUnblockable();
 +
int GetAsLayer();
 +
string GetAlternate();
 +
string GetReactionPath();
 +
string GetMaterialEvent();
 +
vec3 GetImpactDir();
 +
float GetBlockDamage();
 +
float GetSharpDamage();
 +
float GetDamage();
 +
float GetForce();
 +
int GetMirrored();
 +
int GetMobile();</pre>
 +
----
 +
 
 +
=== [[#CollisionPoint class|CollisionPoint class]] ===
 
<pre style="white-space: pre-wrap;">class CollisionPoint;</pre>
 
<pre style="white-space: pre-wrap;">class CollisionPoint;</pre>
<pre style="white-space: pre-wrap;">class EnvObject;</pre>
+
An contact point from a collision query. There may be multiple of these for a given collision.
<pre style="white-space: pre-wrap;">class Hotspot;</pre>
+
 
<pre style="white-space: pre-wrap;">class ItemObject;</pre>
+
'''Properties'''
<pre style="white-space: pre-wrap;">class JSON;</pre>
+
<pre style="white-space: pre-wrap;">vec3 position; // The position where the intersection occurred
<pre style="white-space: pre-wrap;">class JSONValue;</pre>
+
vec3 normal; // The surface normal at the point of intersection
<pre style="white-space: pre-wrap;">class KeyboardPress;</pre>
+
vec3 custom_normal; // TODO: What is this? I assume a secondary normal for certain objects?
<pre style="white-space: pre-wrap;">class Level;</pre>
+
int id; // The collision id - TODO: What is this good for?
<pre style="white-space: pre-wrap;">class LevelDetails;</pre>
+
int tri; // The index of the triangle that was intersected with - TODO: What is this good for?</pre>
<pre style="white-space: pre-wrap;">class MenuItem;</pre>
+
 
<pre style="white-space: pre-wrap;">class ModID;</pre>
+
'''Related Global Variables'''
<pre style="white-space: pre-wrap;">class ModLevel;</pre>
+
<pre style="white-space: pre-wrap;">ASCollisions col; // The global instance of a class you can use to perform these collision queries</pre>
<pre style="white-space: pre-wrap;">class MovementObject;</pre>
+
<pre style="white-space: pre-wrap;">SphereCollision sphere_col; // The global instance of a class where you can get the list of these collision points from the last collision query</pre>
 +
----
 +
=== [[#NavPath class|NavPath class]] ===
 
<pre style="white-space: pre-wrap;">class NavPath;</pre>
 
<pre style="white-space: pre-wrap;">class NavPath;</pre>
 +
The result of a navigation query, stating whether the navigation was successful, and showing the way-points along the determined route.
 +
 +
'''Properties'''
 +
<pre style="white-space: pre-wrap;">bool success;  // Was the navigation query successful?</pre>
 +
 +
'''Methods'''
 +
<pre style="white-space: pre-wrap;">NavPath();  // Default constructor, empty of points, success set to false
 +
NavPath(const NavPath &in other);  // Copy constructor
 +
NavPath& opAssign(const NavPath &in other);  // Assignment operator (nav_path = other_nav_path)
 +
int NumPoints();  // Get the number of points returned from the navigation query
 +
vec3 GetPoint(int index);  // Get a point by index from the navigation path returned by the query
 +
uint8 GetFlag(int index);  // Get a point's flags by index from the navigation path returned by the query</pre>
 +
 +
'''Related Global Functions'''
 +
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end);  // Do a navigation query (including retrieving waypoints) to a given position</pre>
 +
<pre style="white-space: pre-wrap;">NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);
 +
// Do a navigation query (including retrieving waypoints) to a given position, allowing certain navigation types to be filtered or excluded.
 +
// Filtering and exclusion currently just used to filter out jump nodes for non-rabbits</pre>
 +
----
 +
=== [[#NavPoint class|NavPoint class]] ===
 
<pre style="white-space: pre-wrap;">class NavPoint;</pre>
 
<pre style="white-space: pre-wrap;">class NavPoint;</pre>
<pre style="white-space: pre-wrap;">class Object;</pre>
+
The results of a simpler nav mesh reachability query, without way-points.
<pre style="white-space: pre-wrap;">class PathPointObject;</pre>
+
 
<pre style="white-space: pre-wrap;">class Physics;</pre>
+
'''Methods'''
 +
<pre style="white-space: pre-wrap;">void NavPoint();  // Default constructor, point is at origin, success set to false
 +
void NavPoint(const NavPoint &in other); // Copy constructor
 +
NavPoint& opAssign(const NavPoint &in other);  // Assignment operator (nav_point = other_nav_point)
 +
bool IsSuccess(); // Was the navigation query successful?
 +
vec3 GetPoint(); // Get the target point that this navigation query was done for</pre>
 +
 
 +
'''Related Global Functions'''
 +
<pre style="white-space: pre-wrap;">NavPoint GetNavPoint(vec3 target_pos); // Do a navigation query to the given position</pre>
 +
----
 +
=== [[#ReactionScriptGetter class|ReactionScriptGetter class]] ===
 
<pre style="white-space: pre-wrap;">class ReactionScriptGetter;</pre>
 
<pre style="white-space: pre-wrap;">class ReactionScriptGetter;</pre>
<pre style="white-space: pre-wrap;">class RiggedObject;</pre>
+
Can load a reaction xml and provide access to its data
<pre style="white-space: pre-wrap;">class ScriptParams;</pre>
+
 
<pre style="white-space: pre-wrap;">class Skeleton;</pre>
+
'''Methods'''
 +
<pre style="white-space: pre-wrap;">void Load(string path);  // Load a reaction xml file (e.g. "Data/Attacks/reaction_medfront.xml")
 +
string GetAnimPath(float severity);  // Get the specified animation path, based on the severity of reaction warrented
 +
int GetMirrored(); // Get whether the reaction is or is not mirrored. 0 == no, 1 == yes, 2 == maybe</pre>
 +
 
 +
'''Related Global Variables'''
 +
<pre style="white-space: pre-wrap;">ReactionScriptGetter reaction_getter;  // Global instance of this class</pre>
 +
----
 +
 
 +
=== [[#SphereCollision class|SphereCollision class]] ===
 
<pre style="white-space: pre-wrap;">class SphereCollision;</pre>
 
<pre style="white-space: pre-wrap;">class SphereCollision;</pre>
<pre style="white-space: pre-wrap;">class TextCanvasTexture;</pre>
+
Stored results for the last collision test query performed.
<pre style="white-space: pre-wrap;">class TextMetrics;</pre>
+
 
<pre style="white-space: pre-wrap;">class TextStyle;</pre>
+
'''Properties'''
<pre style="white-space: pre-wrap;">class TokenIterator;</pre>
+
<pre style="white-space: pre-wrap;">vec3 position;  // The origin passed when invoking the collision query
 +
vec3 adjusted_position;  // TODO: What is this? Is this if it is adjusted to be out of initial contact?
 +
float radius; // The radius passed when invoking the collision query</pre>
 +
 
 +
'''Methods'''
 +
<pre style="white-space: pre-wrap;">int NumContacts();  // Get the count of contacts from the last collision test
 +
CollisionPoint GetContact(int index); // Get the contact point with a given index from the last collision test</pre>
 +
 
 +
'''Related Global Variables'''
 +
<pre style="white-space: pre-wrap;">ASCollisions col;  // The global instance of a class you can use to perform these collision queries</pre>
 +
<pre style="white-space: pre-wrap;">SphereCollision sphere_col;  // The global instance of this class</pre>

Latest revision as of 12:32, 11 November 2017

This is a list of the external code that is only available to be used inside a character script - variables, functions, and classes that "magically" exist.

To see a list of external code that is available to all scripts, please see this page - Common Script External Code

This list is pulled from the ~/Documents/Wolfire/Overgrowth/aschar_docs.h file. That file is automatically generated by the game, so will always be up to date. This page is manually updated, so may be slightly out of date from time to time. TODO: Add character script page and link its docs section here, similar to the LevelScripts#Documentation page section, so people can find OS-specific instructions on how to find this file.

Global Variables

ASCollisions col;  // Access collision functions
ScriptParams params;  // Access the script parameters for the current character
ReactionScriptGetter reaction_getter;  // Access to the attack reaction animation data file for the character
SphereCollision sphere_col;  // Stores results of collision functions
MovementObject this_mo;  // The current character's MovementObject instance

Constants

Types in this section that specify the base type for the enum aren't actually exposed via enums. They are defined as const instances of the base type.

Functions that take those parameters will take the base type instead. E.g. _front is actually defined in your script as an "const int _front".

"Flags" enums can be combined using a bit-wise "or" operator, optionally using a temporary variable. E.g. _ANM_FROM_START | _ANM_MIRRORED

enum AnimationFlags : uint8 {
    _ANM_FROM_START,
    _ANM_MIRRORED,
    _ANM_MOBILE,
    _ANM_SUPER_MOBILE,
    _ANM_SWAP,
};
enum AttackerDirectionType : int {
    _front,
    _left,
    _right,
};
enum AttackerHeightType : int {
    _high,
    _low,
    _medium,
};
enum CollisionSides {
    DOUBLE_SIDED,
    SINGLE_SIDED,
};
enum NavPathFlag {
    DT_STRAIGHTPATH_START,
    DT_STRAIGHTPATH_END,
    DT_STRAIGHTPATH_OFFMESH_CONNECTION,
};
enum SamplePolyFlag {
    POLYFLAGS_NONE,
    POLYFLAGS_WALK,
    POLYFLAGS_SWIM,
    POLYFLAGS_DOOR,
    POLYFLAGS_JUMP1,
    POLYFLAGS_JUMP2,
    POLYFLAGS_JUMP3,
    POLYFLAGS_JUMP4,
    POLYFLAGS_JUMP5,
    POLYFLAGS_JUMP_ALL,
    POLYFLAGS_DISABLED,
    POLYFLAGS_ALL,
};

Global Functions

float GetAnimationEventTime( string &in anim_path, string &in event_label );  // Query the time an animation event occurs in an animation
NavPoint GetNavPoint(vec3 target_pos);  // Do a navigation query to the given position
vec3 GetNavPointPos(vec3 target_pos);
// Shortcut to GetNavPoint(target_pos).GetPos(), without checking if the resulting query resulted in a valid position - warning, might return the origin!
NavPath GetPath(vec3 start, vec3 end);  // Do a navigation query (including retrieving waypoints) to a given position
NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);
// Do a navigation query (including retrieving waypoints) to a given position, allowing certain navigation types to be filtered or excluded.
// Filtering and exclusion currently just used to filter out jump nodes for non-rabbits
vec3 LineLineIntersect(vec3 start_a, vec3 end_a, vec3 start_b, vec3 end_b);
// Get closest point between two line segments
// Useful for per-poly intersection tests, for example with weapon strikes to create blood lines and detect if metal was hit
vec3 NavRaycast(vec3 start, vec3 end);  // Used for path prediction - TODO: More detail
vec3 NavRaycastSlide(vec3 start, vec3 end, int depth);  // Used for path prediction - TODO: More detail,
 and difference between slide/not slide

Classes

ASCollisions class

class ASCollisions;

Invoke collision test queries. Results are stored in the global SphereCollision sphere_col object instance.

Methods

vec3 GetSlidingCapsuleCollision(vec3 start, vec3 end, float radius);
void GetSlidingSphereCollision(vec3 pos, float radius);
void GetSlidingSphereCollisionDoubleSided(vec3 pos, float radius);
void GetScaledSphereCollision(vec3 pos, float radius, vec3 scale);
void GetScaledSpherePlantCollision(vec3 pos, float radius, vec3 scale);
void GetSlidingScaledSphereCollision(vec3 pos, float radius, vec3 scale);
void GetCylinderCollision(vec3 pos, float radius, float height);
void GetCylinderCollisionDoubleSided(vec3 pos, float radius, float height);
void GetSweptSphereCollision(const vec3 &in start, const vec3 &in end, float radius);
void GetSweptSphereCollisionCharacters(vec3 start, vec3 end, float radius);
void GetSweptCylinderCollision(vec3 start, vec3 end, float radius, float height);
void GetSweptCylinderCollisionDoubleSided(vec3 start, vec3 end, float radius, float height);
void GetSweptBoxCollision(vec3 start, vec3 end, vec3 dimensions);
void CheckRayCollisionCharacters(vec3 start, vec3 end);
vec3 GetRayCollision(vec3 start, vec3 end);
void GetObjRayCollision(vec3 start, vec3 end);
void GetPlantRayCollision(vec3 start, vec3 end);
void GetObjectsInSphere(vec3 pos, float radius);

Related Global Variables

ASCollisions col;  // The global instance of this class
SphereCollision sphere_col;  // Results of the last invoked collision method are stored here

AttackScriptGetter class

class AttackScriptGetter;

Used to query information from an attack xml file

Methods

AttackScriptGetter();  // Default constructor (reference type)
void Load(const string &in path);  // Load an attack xml file into the attack script getter (e.g. "Data/Attacks/knifeslash.xml")
string GetPath();  // Get the current specified path for this attack XML file
string GetSpecial();
string GetUnblockedAnimPath();
string GetBlockedAnimPath();
string GetThrowAnimPath();
string GetThrownAnimPath();
string GetThrownCounterAnimPath();
int IsThrow();
int GetHeight();
vec3 GetCutPlane();
int GetCutPlaneType();
bool HasCutPlane();
vec3 GetStabDir();
int GetStabDirType();
bool HasStabDir();
int GetDirection();
int GetSwapStance();
int GetSwapStanceBlocked();
int GetUnblockable();
int GetFleshUnblockable();
int GetAsLayer();
string GetAlternate();
string GetReactionPath();
string GetMaterialEvent();
vec3 GetImpactDir();
float GetBlockDamage();
float GetSharpDamage();
float GetDamage();
float GetForce();
int GetMirrored();
int GetMobile();

CollisionPoint class

class CollisionPoint;

An contact point from a collision query. There may be multiple of these for a given collision.

Properties

vec3 position;  // The position where the intersection occurred
vec3 normal;  // The surface normal at the point of intersection
vec3 custom_normal;  // TODO: What is this? I assume a secondary normal for certain objects?
int id;  // The collision id - TODO: What is this good for?
int tri;  // The index of the triangle that was intersected with - TODO: What is this good for?

Related Global Variables

ASCollisions col;  // The global instance of a class you can use to perform these collision queries
SphereCollision sphere_col;  // The global instance of a class where you can get the list of these collision points from the last collision query

NavPath class

class NavPath;

The result of a navigation query, stating whether the navigation was successful, and showing the way-points along the determined route.

Properties

bool success;  // Was the navigation query successful?

Methods

NavPath();  // Default constructor, empty of points, success set to false
NavPath(const NavPath &in other);  // Copy constructor
NavPath& opAssign(const NavPath &in other);  // Assignment operator (nav_path = other_nav_path)
int NumPoints();  // Get the number of points returned from the navigation query
vec3 GetPoint(int index);  // Get a point by index from the navigation path returned by the query
uint8 GetFlag(int index);  // Get a point's flags by index from the navigation path returned by the query

Related Global Functions

NavPath GetPath(vec3 start, vec3 end);  // Do a navigation query (including retrieving waypoints) to a given position
NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);
// Do a navigation query (including retrieving waypoints) to a given position, allowing certain navigation types to be filtered or excluded.
// Filtering and exclusion currently just used to filter out jump nodes for non-rabbits

NavPoint class

class NavPoint;

The results of a simpler nav mesh reachability query, without way-points.

Methods

void NavPoint();  // Default constructor, point is at origin, success set to false
void NavPoint(const NavPoint &in other);  // Copy constructor
NavPoint& opAssign(const NavPoint &in other);  // Assignment operator (nav_point = other_nav_point)
bool IsSuccess();  // Was the navigation query successful?
vec3 GetPoint();  // Get the target point that this navigation query was done for

Related Global Functions

NavPoint GetNavPoint(vec3 target_pos);  // Do a navigation query to the given position

ReactionScriptGetter class

class ReactionScriptGetter;

Can load a reaction xml and provide access to its data

Methods

void Load(string path);  // Load a reaction xml file (e.g. "Data/Attacks/reaction_medfront.xml")
string GetAnimPath(float severity);  // Get the specified animation path, based on the severity of reaction warrented
int GetMirrored();  // Get whether the reaction is or is not mirrored. 0 == no, 1 == yes, 2 == maybe

Related Global Variables

ReactionScriptGetter reaction_getter;  // Global instance of this class

SphereCollision class

class SphereCollision;

Stored results for the last collision test query performed.

Properties

vec3 position;  // The origin passed when invoking the collision query
vec3 adjusted_position;  // TODO: What is this? Is this if it is adjusted to be out of initial contact?
float radius;  // The radius passed when invoking the collision query

Methods

int NumContacts();  // Get the count of contacts from the last collision test
CollisionPoint GetContact(int index);  // Get the contact point with a given index from the last collision test

Related Global Variables

ASCollisions col;  // The global instance of a class you can use to perform these collision queries
SphereCollision sphere_col;  // The global instance of this class