With Amnesia: A Machine for Pigs just around the corner, it's time to update The Dark Descent so it's able to use all those new and cool assets.
While we're at it, we thought we'd turn to our awesome modding community to see if there are any script functions you feel are missing in the current version of the game.
Edit: Suggestions are now closed. A big thanks to everyone who contributed. Expect the update some time soon.
I remember that when I toyed with the Custom Story Development Kit, I was mostly experiencing problems with handling the monsters.
A function to give away the player's position to the monster, but without having it chase the player. Just have him look around where the player was at the moment the function was executed, just like if the player had made some noise.
A callback function that is called when the monster(1) searches for the player (alert) (2) chases the player (attack) (3) gives up chasing the player (idle), for example void MonsterTriggered( enum State state, const Monster & monster) (C++ syntax here; sorry have forgotten the AngelScript syntax). The level editor could just leave a blank where the developer can choose to define a callback function for a monster entity.
A function to force the monster to forget it was chasing the player, to use for example when it gets stuck into a wall or breakable door. Make it as though it lost track of Daniel and just go back to its route. [Note : I am not sure if this can be achieved by calling SetEnemyDisableTriggers().]
A function to check whether the monster can be seen/heard by the player, that could be used to force the monster to despawn without letting it finish its course.
Note: it has been a long time since I haven't touched the level editor, I have forgotten many things about it, but these are the points I (think I) can remember.
Some script functions from hpl1 - ReplaceEntity, SetWideScreenActive, AttachBillboardToLight, MoveEntityToArea, SetBodyProperty (change body mass, gravity and other body setup in game)
Add function CreateEntityAtPlayer, its really missing.
And add function for change screen color with different intensity.
Perhaps something that can return the exact position of certain object's positions of the map (X, Y, or Z values)?
Also maybe something similar to Actionscript 3's OnEnterFrame function which will constantly check the state of something int he map so that we wouldn't have to use a incredibly fast timer as an alternative.
asEffect = Name of the insanity effect
abActive = true or false to activate or deactivate
PHP Code:
TurnWheelToSpeed(string& asName, float afAcc, float afGoalSpeed, int alState, bool abResetSpeed);
Turns a wheel, like a valve, at a defined speed and direction.
asName = Internal name of wheel
afAcc = Acceleration
afGoalSpeed = Desired speed
alState = End state of wheel. 1 = Right. 0 = Middle. -1 = Left.
abResetSpeed = determines whether the speed is reset after goal speed is reached.
Forces monster to patrol between the desired pathnodes. When reaching the first pathnode, he will wait the waittime, then continue to the second pathnode etc. If no third pathnode is specified, it will go back to the first pathnode again.
So it goes like First, Second, Third, Second, First, Second, Third etc.
Does three events in one consecutive order. Note that all three events have to be called first. It takes the Function of the event's name.
asEventOne - Event number one. asEventTwo - Event number two. asEventThree - Event number three. afEventTime - Time in seconds does the time of the chain will occur.
[php]
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.