AddAttachedPropToProp - zPosition parameter is used for zRotation
AddAttachedPropToProp - Attaching a breakable entity and then breaking this entity (setPropHealth) will cause the game to crash if the base body is moved
Breaking a prop sometimes fails to create the broken entity (Typically only happens after a large quantity of props have been attached & removed using AddAttachedPropToProp). This seems to be really random and I dont have any way to reproduce this consistently short of attaching a bunch of props over time and breaking the base the entity while it is moving.
AddAttachedPropToProp crashes when attaching props with joints (e.g. doors, cupboards)
float[] GetEntityPosition(string entity) - Return x,y,z as float[] for position in world coords. Could also have a separate function for x/y/z.
float[] GetEntityRotation(...) - Get the x,y,z rotation of the entity (or could return rotation matrix / quaternion if this makes more sense).
float[] GetEntityScale(...)
SetBodyPosition, rotation & scale
In the case of multiple bodies use primary body or make functions operate on the body level rather than entity level.
Getters, setters & adders, for velocity & acceleration
GetEntityMass(...) so we can properly use the force commands
float[] GetBoundingBox(...) - return AABB of entity as float[] {x1,y1,z1,x2,y2,z2}.
Bodies
Methods to list the bodies of an entity
Methods to find the type of an entity (e.g. enemy, static_prop)
Adjust some body properties (e.g. mass, canAttachCharacter)
GetBodyDensitity() / GetBodyVolume() - return volume/density of body using the shapes.
Misc
Toggle if the mesh should be drawn or not without de-activating the whole entity
RemoveEntity(string entity)
Utility
string GetNearestEntityToPoint/Area(x,y,z)
bool EntityCollidesAt(entity1,entity2,x,y,z) - Returns true if the entity 1, when moved to position x,y,z would collide with entity 2.
string[] GetCollidingEntities(entity) - Return a list of all entities colliding with the given entity
float[][] GetContactPoints(entityA,entityB) - return a list of contact/intersection points in either world or local coords between two colliding entities. Return empty list if the entities do not collide.
Area functions
Spoiler below!
CreateScriptAreaAtPosition(x,y,z,xrot,yrot,zrot,xscale,yscale,zscale) - Allow us to create script areas at a position
CreateStickyArea, PlayerStartArea etc
string GetAreaType(string area) - Return type of area. E.g. "script", "start", "sticky" etc
Allow us to adjust parameters of sticky areas & rope areas
string[] getLangCategories() - Array of all lang categories
string[] getLangEntries(string category) - Array of all entries in a category
string getLangEntryText(category,entry) - Get entry specified, return empty string if no match found
createLangTempEntry(string category, string entry, string text) - Create a temp lang entry in given category with given name. This entry can be cleared on save.
Player
Spoiler below!
Getters and Setters for position of the player body
Get/set the camera rotation without needing to use lookat
Enable/Disable the night vision effect through script rather than full conversion
Input
Spoiler below!
GetKeyState() for a given key code, or something similar
Similar deal for mouse buttons
Map
Spoiler below!
string[] GetEntities() - Return an array of all entities in the map
string[] GetMatchingEntities(string entityFilter) - Return array of all entities in map matching given filter (e.g. "barrel*" can be used in the collision functions, but it would be nice to get an array of all the matches which that function makes).
Misc
Spoiler below!
unt8[] toByteArray(x) & fromByteArray(uint8[]) for primitive types
OnSave and OnLoad events so that we can save & restore global-scoped classes manually (Either through callback (e.g. lantern) or like OnEnter)
Perform light pre-processing of scripts (#include, #define and #ifdef) - There is an angelscript extension for this.
Document AddKeyPart, SetPermaDeathSound functions
Set/GetLocalVar support for primitive arrays
CallFunction(string, string[] args) - Call specified function, negating the need to use function pointers for callbacks. The string[] args can be used to get arguments of any type using GetLocalVar functions.
Print a message to the program log or using AddDebugMessage stream if an exception is triggered inside the script [e.g. referencing a null object or array index out of bounds] containing line number & a brief error description.
string[] GetListLocalVariables<Type>() & GetListGlobalVariables<Type>()- List of all defined local/global variables of a specific type.
Quicksort, search & binarysearch for arrays of primitives
convert floats & doubles to string with fixed number of decimal places / sig. fig
Config options
Spoiler below!
Permit us to adjust the killplane position (default: -500y i think) in the global config
Permit us to disable saving in the global config
Edit: Okay that's my wall-of-functions done for now. Thanks for doing this script support update, even if you don't get round to all the stuff we come up with!
Edit 2: Added suggestion to misc regarding in-script exceptions (e.g. array index out of bounds).
Edit 3: Added a few more suggestions in utility & misc.
(This post was last modified: 08-27-2013, 10:30 PM by Apjjm.)