Difference between revisions of "Character Script External Code"

From Wolfire Games Wiki
Jump to: navigation, search
(Constants)
m (Constants)
Line 21: Line 21:
 
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.
 
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. _frontis actually defined in your script as an "const int _front".
+
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 AnimationFlags : uint8 {
 
<pre style="white-space: pre-wrap;">enum AnimationFlags : uint8 {

Revision as of 13:04, 4 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, which is automatically generated by the game.

See this page to find the location for the Wolfire/Overgrowth folder on each OS - How to clear the game's cache

TODO: These can be documented individually, possibly on their own pages - or maybe as just subsections?

Global Variables

ASCollisions col; // Used to access collision functions
ScriptParams params;
ReactionScriptGetter reaction_getter;
SphereCollision sphere_col; // Stores results of collision functions
MovementObject this_mo;

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".

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 );
NavPoint GetNavPoint(vec3);
vec3 GetNavPointPos(vec3);
NavPath GetPath(vec3 start, vec3 end);
NavPath GetPath(vec3 start, vec3 end, uint16 include_poly_flags, uint16 exclude_poly_flags);
vec3 LineLineIntersect(vec3 start_a, vec3 end_a, vec3 start_b, vec3 end_b);  // Get closest point between two line segments
vec3 NavRaycast(vec3 start, vec3 end);
vec3 NavRaycastSlide(vec3 start, vec3 end, int depth);

Classes

class ASCollisions;
class AttackScriptGetter;
class CollisionPoint;
class NavPath;
class NavPoint;
class ReactionScriptGetter;
class SphereCollision;