Just gonna use this page for organizing some new content – it will eventually go into other pages of this wiki.
- Mudbill
A list of script functions available in A Machine For Pigs (that are not present in The Dark Descent)
void CheckPoint(string@& asName, string@& asStartArea, string@& asFunction, string@& asTextCat, string@& asTextEntry, const bool abPlayerLimbo)
Creates a check point where the player will respawn if they die. Callback syntax: void MyFunc(string &in asName, int alCount)
This function replaces TDD's CheckPoint
.
ReleasePlayerFromLimbo
is called. Player is still controllable during death.void ReleasePlayerFromLimbo();
Respawns the player if stuck in “limbo”. Limbo can be enabled with CheckPoint
. Limbo is the state between life and death. The player enters limbo upon dying but won't respawn until this function is called.
void ShowScreenImage(string@& asImageFile, int alX, int alY, const float afUnknown1, const bool abUnknown2, const float afDuration, const float afFadeInTime, const float afFadeOutTime);
Shows a 2D image on the screen. Originally used for showing the intro logo during a sequence.
void AddHint(string& asNameAndTextEntry, string@& asImage);
Adds a hint to the player's journal.
This function replaces TDD's AddDiary
.
void SetJournalDisabled(const bool abDisabled);
Disables the player's ability to open their journal.
void SetLanternFlickerActive(const bool abActive);
Enables/disables the flicker effect for the lantern's light.
void SetPlayerInfection(const float afInfectionLevel);
Sets the infection level for the player. Infection replaces sanity from TDD and acts similar, however it goes from 0-100 instead of 100-0. An infection level above approximately 20 will affect the player's ability to move. Infection level above 80 will kill the player. Infection slowly decreases over time, unless high enough.
This function replaces TDD's SetPlayerSanity
.
void FadePlayerPitchTo(const float afPitch, const float afDeaccelleration, const float afSpeed);
Moves the player's pitch (up and down rotation).
void SetPhysicsAutoDisable(string@& asEntity, const bool abDisabled);
Does… something. Not immediately apparent. Is only used on chandeliers in the campaign.
void SetLampFlickerActive(string@& asLamp, const bool abActive);
Enables a flickering effect on a Lamp-type entity.
void StartPhoneRinging(string@& asEntity);
Enables a PhoneBox-type entity to start ringing. A ringing phone box can be interacted with to play some audio files. After interacting, the phone will stop ringing.
void StopPhoneRinging(string@& asEntity)
Stops a ringing PhoneBox-type entity.
bool GetEntityActive(string@& asEntity);
Returns whether an entity in the level is active or not.
void StopPropAnimation(string@& asProp);
Stops the animation currently playing on a prop. Animations can be started with PlayPropAnimation
.
void SetSwingDoorOpenAmount(string@& asEntity, const float afOpenAmount, const float afTime, const bool abUnknown);
Sets the open amount for a swing door.
void FadeLampTo(string@& asEntity, const uint alR, const uint alG, const uint alB, const uint alA, int alRadius, const double afTime);
Fades a Lamp-type entity's light to another color. This function uses integers for color values instead of floats, which is a little odd. Likewise, it uses a double floating point for the last argument instead of a regular one.
void SetButtonCanBeSwitchedOn(string@& asEntity, const bool abX);
Changes whether a Button-type entity can be toggled.
void CreateEntityAtArea(string@& asName, string@& asFile, string@& asArea, const bool abUnknown, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ);
Creates an entity at an area with the specified offsets and rotation.
This function replaces TDD's CreateEntityAtArea
.
void AttachPropToBone(string@& asProp, string@& asEntity, string@& asBone, const float afOffsetX, const float afOffsetY, const float afOffsetZ, const float afRotX, const float afRotY, const float afRotZ);
Attaches a prop to a specific bone within another entity. You can inspect bones in the Model Editor. Note: Offsets and rotations are local to the bone and relative to its rotation.
void DetachPropFromBone(string@& asProp);
Detaches an attached prop. Note: When detached, physics are not automatically enabled on the prop.
void AddEffectVoice2(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 2 consecutive subtitles.
void AddEffectVoice3(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, string@& asTextEntry3, const float afStartTime3, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 3 consecutive subtitles.
void AddEffectVoice4(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, string@& asTextEntry3, const float afStartTime3, string@& asTextEntry4, const float afStartTime4, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 4 consecutive subtitles.
void AddEffectVoice5(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, string@& asTextEntry3, const float afStartTime3, string@& asTextEntry4, const float afStartTime4, string@& asTextEntry5, const float afStartTime5, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 5 consecutive subtitles.
void AddEffectVoice6(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, string@& asTextEntry3, const float afStartTime3, string@& asTextEntry4, const float afStartTime4, string@& asTextEntry5, const float afStartTime5, string@& asTextEntry6, const float afStartTime6, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 6 consecutive subtitles.
void AddEffectVoice7(string@& asVoiceFile, string@& asEffectFile, string@& asTextCat, string@& asTextEntry1, const float afStartTime1, string@& asTextEntry2, const float afStartTime2, string@& asTextEntry3, const float afStartTime3, string@& asTextEntry4, const float afStartTime4, string@& asTextEntry5, const float afStartTime5, string@& asTextEntry6, const float afStartTime6, string@& asTextEntry7, const float afStartTime7, const bool abUsePosition, string@& asPosEntity, const float afMinDistance, const float afMaxDistance);
Plays an audio file with 7 consecutive subtitles.
void AddEnemyPatrolNode(string@& asEnemy, string@& asPathNode, const float afWaitTime, string@& asAnimation, const bool abUnknown)
Adds a patrol node to the enemy's walking path. A path is restarted from the beginning when the final node is reached. Note: Inputting an invalid animation in asAnimation at the final node will make the enemy wait there indefinitely.
This function replaces TDD's AddEnemyPatrolNode.
void SetEnemyMoveType(string@& asEnemy, string@& asMoveType);
Changes how an enemy moves.
void SetManPigType(string@& asEnemy, string@& asType);
Sets the type for a ManPig enemy. It is unknown whether this function does anything or if it's just left over from an earlier state of the game. Only “Freddy” is used as the type, but supposedly it should also accept “Rod” and “Jane”.
void PlayEnemyAnimation(string@& asEnemy, string@& asAnimation, const bool abLoop, const float afDelay);
Plays a specific animation for an enemy.
void ChangeEnemyPose(string@& asEnemy, string@& asPose);
Changes the pose for an enemy. Can be either “Biped” or “Quadruped”.
void ForceEnemyWaitState(string@& asEnemy);
Forces the enemy's AI to change the state to “Wait” which makes the enemy wait for a short while before continuing its' normal actions. An enemy without patrol nodes defaults to the “Wait” state. Otherwise, if patrol nodes are added, the enemy will continue the path after waiting is done.
void SetEnemyBlind(string@& asEnemy, const bool abX);
Sets whether the enemy can see the player if they are within visible range.
void SetEnemyDeaf(string@& asEnemy, const bool abX);
Sets whether the enemy can hear the player make sound if they are within audible range.
bool GetPlayerCanSeeEnemy(string@& asEnemy);
Returns whether the enemy is within visible range of the player.
float GetEnemyPlayerDistance(string@& asEnemy);
Returns the distance (in HPL units) between the enemy and the player.
void SetParticleSystemActive(string@& asParticleSystem, const bool abActive);
Pauses a particle system in its current frame. The paused particle system remains frozen at this frame until reactivated or destroyed.
void DestroyParticleSystemInstantly(string@& asParticleSystem);
Destroys a particle system and any existing particles already emitted from it. Similar to DestroyParticleSystem
, except that one will not destroy the existing particles and rather let them live out their lives. This function will cut all particles' lives short.