Frictional Games Forum (read-only)
Engine Scripts Plus [ES+ 1.3] - More sensical function names - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Resources (https://www.frictionalgames.com/forum/forum-42.html)
+---- Thread: Engine Scripts Plus [ES+ 1.3] - More sensical function names (/thread-54775.html)



Engine Scripts Plus [ES+ 1.3] - More sensical function names - Mudbill - 10-26-2018

One of the good things to come from SOMA / HPL3 is the naming convention used for script functions to group related things together. This was something I thought would be useful to have in HPL2, so I made this library for those wishing to use exactly that.

What's different?
Basically every single script function has been given a new name. Instead of SetEntityActive, you use Entity_SetActive. Every function has been renamed to start with a category word, then an underscore, then the description of the function. This is a standard that HPL2 has been lacking.

Why?
There are several reason why one might want this. The biggest benefit is autocompletion. In pretty much every script editor, without additional configuration, you can now start typing "Entity_" or "Game_" or "Player_" and produce a list of all functions related to that category. See screenshot from the Atom editor below.

[Image: 4O75ijm.png]

Another reason, although more subjective, is that things are more clearly defined, so when reading your code, it can be easier to quickly see what a function does and what it affects.

How do I get started?
Because HPL2 does not allow the use of importing scripts, you will need to copy and paste the provided contents and put them into each script file you want to use this convention in. The contents are provided in a "minified" form, which means the code has been reduced in size where possible and is spread across a single line. This line is very long, so make sure you do not use line wrapping in your editor so it becomes as invisible as possible.

Click here to see the contents you need to copy, or click here to download it as a file.

Again, in case you didn't understand, all you need to do is paste the code into your .hps file, somewhere in the root level (where OnStart resides). Example:

PHP Code:
void OnStart()
{
 
   Entity_SetActive("chair"false);
}

/* ES+ BEGIN VERSION 1.0 */ ETC ETC ETC /* ES+ END */ 


While the code is in your script file, you can use all the functions and they should autocomplete as well, depending on your editor.

Changelog

Spoiler below!

1.2 (2018-11-10):
  • Added categories Lever, Wheel, Button, MultiSlider, SwingDoor, LevelDoor, Lamp, MoveObject.
  • Changed Entity_SetObjectStuckState to just Entity_SetStuckState.
1.1 (2018-11-10):
  • Fixed Entity_AddBodyForce and Entity_AddBodyImpulse so they call the correct functions rather than the same as their non-body counterparts.
1.0 (2018-10-26):
  • Initial release




Anything else?
  • If you want some trivia, it took about 4 hours to create, and is about 1000 lines non-minified. Oh, but the forum post took like 4 more.
  • Want to have a look at the non-minified version? Here you go.
  • Why so late? Yeah, I don't know. I guess I just suddenly felt like doing it. Wish I had done it years ago though, but better late than never?
  • Did you know that InsanityEventIsActive() actually returns a void, which practically renders this function useless?
Engine Scripts Plus reference

The documentation for each function follows here, if you need it. I won't explain them in-depth, but I will tell you which original function lies behind so you can look up the documentation for that function. Most are self-explanatory however, and they all use the exact same parameters as the originals. Here's a link to the official Engine Scripts documentation if you need it.

Before we get into it, here are all the categories that the scripts belong to:
  • Debug
  • Script
  • Math
  • String
  • Game
  • ParticleSystem
  • Sound
  • Light
  • Map
  • Timer
  • Effect
  • Player
  • Journal
  • Inventory
  • Entity
  • MoveObject
  • Lamp
  • LevelDoor
  • SwingDoor
  • Wheel
  • Lever
  • Button
  • MultiSlider
  • NPC
  • Enemy
Math

Quote:
PHP Code:
float Math_RandFloat(float afMinfloat afMax
= RandFloat

PHP Code:
int Math_RandInt(int alMinint alMax
= RandInt

PHP Code:
float Math_Sin(float afX
= MathSin

PHP Code:
float Math_Cos(float afX
= MathCos

PHP Code:
float Math_Tan(float afX
= MathTan

PHP Code:
float Math_Asin(float afX
= MathAsin

PHP Code:
float Math_Acos(float afX
= MathAcos

PHP Code:
float Math_Atan2(float afXfloat afY
= MathAtan2

PHP Code:
float Math_Sqrt(float afX
= MathSqrt

PHP Code:
float Math_Pow(float afBasefloat afExp
= MathPow

PHP Code:
float Math_Min(float afAfloat afB
= MathMin

PHP Code:
float Math_Max(float afAfloat afB
= MathMax

PHP Code:
float Math_Clamp(float afXfloat afMinfloat afMax
= MathClamp

PHP Code:
float Math_Abs(float afX
= MathAbs


String

Quote:
PHP Code:
bool String_Contains(stringasStringstringasSubString
= StringContains

PHP Code:
string String_Sub(stringasStringint alStartint alCount
= StringSub

PHP Code:
int String_ToInt(string&in asString
= StringToInt

PHP Code:
float String_ToFloat(string&in asString
= StringToFloat

PHP Code:
bool String_ToBool(string&in asString
= StringToBool


Debug

Quote:
PHP Code:
void Debug_Print(stringasString
= Print

PHP Code:
void Debug_AddMessage(stringasStringbool abCheckForDuplicates
= AddDebugMessage

PHP Code:
void Debug_ProgLog(stringasLevelstringasMessage
= ProgLog

PHP Code:
bool Debug_GetEnabled() 
= ScriptDebugOn


Script

Quote:
PHP Code:
void Script_SetLocalVarInt(stringasNameint alVal
= SetLocalVarInt

PHP Code:
void Script_AddLocalVarInt(stringasNameint alVal
= AddLocalVarInt

PHP Code:
int Script_GetLocalVarInt(stringasName
= GetLocalVarInt

PHP Code:
void Script_SetLocalVarFloat(stringasNamefloat afVal
= SetLocalVarFloat

PHP Code:
void Script_AddLocalVarFloat(stringasNamefloat afVal
= AddLocalVarFloat

PHP Code:
float Script_GetLocalVarFloat(stringasName
= GetLocalVarFloat

PHP Code:
void Script_SetLocalVarString(stringasName, const stringasVal
= SetLocalVarString

PHP Code:
void Script_AddLocalVarString(stringasNamestringasVal
= AddLocalVarString

PHP Code:
string Script_GetLocalVarString(stringasName
= GetLocalVarString

PHP Code:
void Script_SetGlobalVarInt(stringasNameint alVal
= SetGlobalVarInt

PHP Code:
void Script_AddGlobalVarInt(stringasNameint alVal
= AddGlobalVarInt


PHP Code:
int Script_GetGlobalVarInt(stringasName
= GetGlobalVarInt


PHP Code:
void Script_SetGlobalVarFloat(stringasNamefloat afVal
= SetGlobalVarFloat


PHP Code:
void Script_AddGlobalVarFloat(stringasNamefloat afVal
= AddGlobalVarFloat


PHP Code:
float Script_GetGlobalVarFloat(stringasName
= GetGlobalVarFloat


PHP Code:
void Script_SetGlobalVarString(stringasName, const stringasVal
= SetGlobalVarString


PHP Code:
void Script_AddGlobalVarString(stringasNamestringasVal
= AddGlobalVarString


PHP Code:
string Script_GetGlobalVarString(stringasName
= GetGlobalVarString


ParticleSystem

Quote:
PHP Code:
void ParticleSystem_Preload(stringasPSFile
= PreloadParticleSystem

PHP Code:
void ParticleSystem_CreateAtEntity(stringasPSNamestringasPSFilestringasEntitybool abSavePS
= CreateParticleSystemAtEntity


Code:
void ParticleSystem_CreateAtEntityExt(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS, float afR, float afG, float afB, float afA, bool abFadeAtDistance, float afFadeMinEnd, float afFadeMinStart, float afFadeMaxStart, float afFadeMaxEnd)
= CreateParticleSystemAtEntityExt

PHP Code:
void ParticleSystem_Destroy(stringasName
= DestroyParticleSystem

PHP Code:
void ParticleSystem_StartPlayerSpawnPS(stringasPSFile
= StartPlayerSpawnPS

PHP Code:
void ParticleSystem_StopPlayerSpawnPS() 
= StopPlayerSpawnPS


Sound

Quote:
PHP Code:
void Sound_Preload(stringa
= PreloadSound

PHP Code:
Sound_PlayAtEntity(stringastringbstringcfloat dbool e
= PlaySoundAtEntity

PHP Code:
void Sound_FadeIn(stringafloat bbool c
= FadeInSound

PHP Code:
void Sound_Stop(stringafloat b
= StopSound

PHP Code:
void Sound_PlayMusic(stringabool bfloat cfloat dint ebool f
= PlayMusic

PHP Code:
void Sound_StopMusic(float aint b
= StopMusic

PHP Code:
void Sound_FadeGlobalVolume(float afloat b
= FadeGlobalSoundVolume

PHP Code:
void Sound_FadeGlobalSpeed(float afloat b
= FadeGlobalSoundSpeed


Code:
void Sound_AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry, bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance)
= AddEffectVoice

PHP Code:
void Sound_StopAllEffectVoices(float afFadeOutTime
= StopAllEffectVoices

PHP Code:
bool Sound_GetEffectVoiceActive() 
= GetEffectVoiceActive

PHP Code:
void Sound_SetEffectVoiceOverCallback(stringasFunc
= SetEffectVoiceOverCallback


PHP Code:
void Sound_PlayGuiSound(stringasSoundFilefloat afVolume
= PlayGuiSound


Light

Quote:
PHP Code:
void Light_SetVisible(stringabool b
= SetLightVisible
PHP Code:
void Light_FadeTo(stringasLightNamefloat afRfloat afGfloat afBfloat afAfloat afRadiusfloat afTime
= FadeLightTo


PHP Code:
void Light_SetFlickerActive(stringasLightNamebool abActive
= SetLightFlickerActive



Game


Quote:
PHP Code:
void Game_StartCredits(stringasMusicbool abLoopMusicstringasTextCatstringasTextEntryint alEndNum
= StartCredits


PHP Code:
void Game_StartDemoEnd() 
= StartDemoEnd


PHP Code:
void Game_AutoSave() 
= AutoSave


PHP Code:
void Game_SetupLoadScreen(string&asTextCatstring&asTextEntryint alRandomNumstring&asImageFile
= SetupLoadScreen


PHP Code:
void Game_SetDeathHint(stringasTextCategorystringasTextEntry
= SetDeathHint


PHP Code:
void Game_DisableDeathStartSound() 
= DisableDeathStartSound


PHP Code:
void Game_GiveHint(stringasNamestringasMessageCatstringasMessageEntryfloat afTimeShown
= GiveHint


PHP Code:
void Game_RemoveHint(stringasName
= RemoveHint


PHP Code:
void Game_BlockHint(stringasName
= BlockHint


PHP Code:
void Game_UnblockHint(stringasName
= UnBlockHint


PHP Code:
void Game_CreateDataCache() 
= CreateDataCache


PHP Code:
void Game_DestroyDataCache() 
= DestroyDataCache



Map

Quote:
Code:
void Map_CheckPoint(string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry)

= CheckPoint


PHP Code:
void Map_Change(stringasMapNamestringasStartPosstringasStartSoundstringasEndSound
= ChangeMap


PHP Code:
void Map_ClearSavedMaps() 
= ClearSavedMaps


PHP Code:
void Map_SetDisplayNameEntry(stringasNameEntry
= SetMapDisplayNameEntry


PHP Code:
void Map_SetSkyboxActive(bool abActive
= SetSkyBoxActive


PHP Code:
void Map_SetSkyboxTexture(string asTexture
= SetSkyboxTexture


PHP Code:
void Map_SetSkyboxColor(float afRfloat afGfloat afBfloat afA
= SetSkyboxColor


PHP Code:
void Map_SetFogActive(bool abActive
= SetFogActive


PHP Code:
void Map_SetFogColor(float afRfloat afGfloat afBfloat afA
= SetFogColor


PHP Code:
void Map_SetFogProperties(float afStartfloat afEndfloat afFalloffExpbool abCulling
= SetFogProperties



Timer


Quote:
PHP Code:
void Timer_Add(stringasNamefloat afTimestringasFunction
= AddTimer

PHP Code:
void Timer_Remove(stringasName
= RemoveTimer

PHP Code:
float Timer_GetTimeLeft(stringasName
= GetTimerTimeLefT

Effect

Quote:
PHP Code:
void Effect_FadeOut(float afTime
= FadeOut

PHP Code:
void Effect_FadeIn(float afTime
= FadeIn

PHP Code:
void Effect_FadeImageTrailTo(float afAmountfloat afSpeed
= FadeImageTrailTo

PHP Code:
void Effect_FadeSepiaColorTo(float afAmountfloat afSpeed
= FadeSepiaColorTo

PHP Code:
void Effect_FadeRadialBlurTo(float afSizefloat afSpeed
= FadeRadialBlurTo

PHP Code:
void Effect_SetRadialBlurStartDist(float afStartDist
= SetRadialBlurStartDist

PHP Code:
void Effect_StartFlash(float afFadeInfloat afWhitefloat afFadeOut
= StartEffectFlash

PHP Code:
void Effect_StartEmotionFlash(stringasTextCatstringasTextEntrystringasSound
= StartEffectEmotionFlash

PHP Code:
bool Effect_GetFlashbackIsActive() 
= GetFlashbackIsActive

PHP Code:
void Effect_StartScreenShake(float afAmountfloat afTimefloat afFadeInTimefloat afFadeOutTime
= StartScreenShake

PHP Code:
void Effect_SetInDarknessEffectsActive(bool abX
= SetInDarknessEffectsActive

PHP Code:
void Effect_SetInsanitySetEnabled(stringasSetbool abX
= SetInsanitySetEnabled

PHP Code:
void Effect_StartInsanityEvent(string &in asEventName
= StartInsanityEvent

PHP Code:
void Effect_StartRandomInsanityEvent() 
= StartRandomInsanityEvent

PHP Code:
void Effect_StopCurrentInsanityEvent() 
= StopCurrentInsanityEvent

PHP Code:
void Effect_FadeFOVMulTo(float afXfloat afSpeed
= FadePlayerFOVMulTo

PHP Code:
void Effect_FadeAspectMulTo(float afXfloat afSpeed
= FadePlayerAspectMulTo

PHP Code:
void Effect_FadePlayerRollTo(float afXfloat afSpeedMulfloat afMaxSpeed
= FadePlayerRollTo

PHP Code:
void Effect_MovePlayerHeadPos(float afXfloat afYfloat afZfloat afSpeedfloat afSlowDownDist
= MovePlayerHeadPos

PHP Code:
void Effect_SetMessage(stringasTextCategorystringasTextEntryfloat afTime
= SetMessage


Player

Quote:
PHP Code:
void Player_SetActive(bool abActive
= SetPlayerActive

PHP Code:
void Player_ChangeStateToNormal() 
= ChangePlayerStateToNormal

PHP Code:
void Player_SetCrouching(bool abCrouch
= SetPlayerCrouching

PHP Code:
void Player_AddPlayerBodyForce(float afXfloat afYfloat afZbool abUseLocalCoords
= AddPlayerBodyForce

PHP Code:
void Player_ShowCrossHairIcons(bool abX
= ShowPlayerCrossHairIcons

PHP Code:
void Player_SetSanity(float afSanity
= SetPlayerSanity

PHP Code:
void Player_AddSanity(float afSanity
= AddPlayerSanity

PHP Code:
float Player_GetSanity() 
= GetPlayerSanity

PHP Code:
void Player_SetHealth(float afHealth
= SetPlayerHealth

PHP Code:
void Player_AddPlayerHealth(float afHealth
= AddPlayerHealth

PHP Code:
float Player_GetHealth() 
= GetPlayerHealth

PHP Code:
void Player_SetLampOil(float afOil
= SetPlayerLampOil

PHP Code:
void Player_AddLampOil(float afOil
= AddPlayerLampOil

PHP Code:
float Player_GetLampOil() 
= GetPlayerLampOil

PHP Code:
float Player_GetSpeed() 
= GetPlayerSpeed

PHP Code:
float Player_GetYSpeed() 
= GetPlayerYSpeed

PHP Code:
void Player_SetSanityDrainDisabled(bool abX
= SetSanityDrainDisabled


PHP Code:
void Player_GiveSanityBoost() 
= GiveSanityBoost


PHP Code:
void Player_GiveSanityBoostSmall() 
= GiveSanityBoostSmall


PHP Code:
void Player_GiveSanityDamage(float afAmountbool abUseEffect
= GiveSanityDamage


PHP Code:
void Player_GiveDamage(float afAmountstringasTypebool abSpinHeadbool abLethal
= GivePlayerDamage


PHP Code:
void Player_StartLookAt(stringasEntityNamefloat afSpeedMulfloat afMaxSpeedstringasAtTargetCallback
= StartPlayerLookAt


PHP Code:
void Player_StopLookAt() 
= StopPlayerLookAt


PHP Code:
void Player_SetMoveSpeedMul(float afMul
= SetPlayerMoveSpeedMul


PHP Code:
void Player_SetRunSpeedMul(float afMul
= SetPlayerRunSpeedMul


PHP Code:
void Player_SetLookSpeedMul(float afMul
= SetPlayerLookSpeedMul


PHP Code:
void Player_SetJumpForceMul(float afMul
= SetPlayerJumpForceMul


PHP Code:
void Player_SetJumpDisabled(bool abX
= SetPlayerJumpDisabled


PHP Code:
void Player_SetCrouchDisabled(bool abX
= SetPlayerCrouchDisabled


PHP Code:
void Player_Teleport(stringasStartPosName
= TeleportPlayer


PHP Code:
void Player_SetLanternActive(bool abXbool abUseEffects
= SetLanternActive


PHP Code:
void Player_SetLanternDisabled(bool abX
= SetLanternDisabled


PHP Code:
bool Player_GetLanternActive() 
= GetLanternActive


PHP Code:
void Player_SetLanternLitCallback(stringasCallback
= SetLanternLitCallback


PHP Code:
void Player_MoveForward(float afAmount
= MovePlayerForward


PHP Code:
void Player_SetFallDamageDisabled(bool abX
= SetPlayerFallDamageDisabled


PHP Code:
void Player_SetPos(float afXfloat afYfloat afZ
= SetPlayerPos


PHP Code:
float Player_GetPosX() 
= GetPlayerPosX


PHP Code:
float Player_GetPosY() 
= GetPlayerPosY


PHP Code:
float Player_GetPosZ() 
= GetPlayerPosZ


Journal

Quote:
PHP Code:
void Journal_AddNote(stringasNameAndTextEntrystringasImage
= AddNote


PHP Code:
void Journal_AddDiary(stringasNameAndTextEntrystringasImage
= AddDiary


PHP Code:
void Journal_ReturnOpen(bool abOpenJournal
= ReturnOpenJournal


PHP Code:
void Journal_AddQuest(stringasNamestringasNameAndTextEntry
= AddQuest


PHP Code:
void Journal_CompleteQuest(stringasNamestringasNameAndTextEntry
= CompleteQuest


PHP Code:
bool Journal_GetQuestIsAdded(stringasName
= QuestIsAdded


PHP Code:
void Journal_SetNumberOfQuestsInMap(int alNumberOfQuests
= SetNumberOfQuestsInMap


Inventory

Quote:
PHP Code:
void Inventory_Exit() 
= ExitInventory

PHP Code:
void Inventory_SetDisabled(bool abX
= SetInventoryDisabled

PHP Code:
void Inventory_SetMessage(stringasTextCategorystringasTextEntryfloat afTime
= SetInventoryMessage


PHP Code:
void Inventory_GiveItem(stringasNamestringasTypestringasSubTypeNamestringasImageNamefloat afAmount
= GiveItem

PHP Code:
void Inventory_GiveItemFromFile(stringasNamestringasFileName
= GiveItemFromFile


PHP Code:
void Inventory_RemoveItem(stringasName
= RemoveItem


PHP Code:
bool Inventory_HasItem(stringasName
= HasItem


PHP Code:
void Inventory_AddCombineCallback(stringasNamestringasItemAstringasItemBstringasFunctionbool abAutoRemove
= AddCombineCallback


PHP Code:
void Inventory_RemoveCombineCallback(stringasName
= RemoveCombineCallback


PHP Code:
void Inventory_AddUseItemCallback(stringasNamestringasItemstringasEntitystringasFunctionbool abAutoDestroy
= AddUseItemCallback


PHP Code:
void Inventory_RemoveUseItemCallback(stringasName
= RemoveUseItemCallback


Entity


Quote:
PHP Code:
void Entity_SetActive(stringasNamebool abActive
= SetEntityActive


PHP Code:
void Entity_SetVisible(stringasNamebool abVisible
= SetEntityVisible


PHP Code:
bool Entity_GetExists(stringasName
= GetEntityExists


PHP Code:
void Entity_SetCustomFocusCrossHair(stringasNamestringasCrossHair
= SetEntityCustomFocusCrossHair


PHP Code:
void Entity_CreateAtArea(stringasEntityNamestringasEntityFilestringasAreaNamebool abFullGameSave
= CreateEntityAtArea


Code:
void Entity_Replace(string &in asName, string &in asBodyName, string &in asNewEntityName, string &in asNewEntityFile, bool abFullGameSave)

= ReplaceEntity


PHP Code:
void Entity_PlaceAtEntity(string &in asNamestring &in asTargetEntitystring &in asTargetBodyNamebool abUseRotation
= PlaceEntityAtEntity


PHP Code:
void Entity_SetPos(string &in asNamefloat afXfloat afYfloat afZ
= SetEntityPos


PHP Code:
float Entity_GetPosX(string &in asName
= GetEntityPosX


PHP Code:
float Entity_GetPosY(string &in asName
= GetEntityPosY

PHP Code:
float Entity_GetPosZ(string &in asName
= GetEntityPosZ


PHP Code:
void Entity_SetPlayerLookAtCallback(stringasNamestringasCallbackbool abRemoveWhenLookedAt
= SetEntityPlayerLookAtCallback


PHP Code:
void Entity_SetPlayerInteractCallback(stringasNamestringasCallbackbool abRemoveOnInteraction
= SetEntityPlayerInteractCallback


PHP Code:
void Entity_SetCallbackFunc(stringasNamestringasCallback
= SetEntityCallbackFunc


PHP Code:
void Entity_SetConnectionStateChangeCallback(stringasNamestringasCallback
= SetEntityConnectionStateChangeCallback


PHP Code:
void Entity_SetInteractionDisabled(stringasNamebool abDisabled
= SetEntityInteractionDisabled


PHP Code:
void Entity_BreakJoint(stringasName
= BreakJoint


Code:
void Entity_AddCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates)
= AddEntityCollideCallback


PHP Code:
void Entity_RemoveCollideCallback(stringasParentNamestringasChildName
= RemoveEntityCollideCallback


PHP Code:
bool Entity_GetCollide(stringasEntityAstringasEntityB
= GetEntitiesCollide


PHP Code:
void Entity_SetBodyMass(string &in asNamefloat afMass
= SetBodyMass


PHP Code:
float Entity_GetBodyMass(string &in asName
= GetBodyMass


PHP Code:
void Entity_SetEffectActive(stringasNamebool abActivebool abFadeAndPlaySounds
= SetPropEffectActive


PHP Code:
void Entity_SetActiveAndFade(stringasNamebool abActivefloat afFadeTime
= SetPropActiveAndFade


PHP Code:
void Entity_SetStaticPhysics(stringasNamebool abX
= SetPropStaticPhysics

PHP Code:
bool Entity_GetInteractedWith(stringasName
= GetPropIsInteractedWith


Code:
void Entity_RotateToSpeed(string& asName, float afAcc, float afGoalSpeed, float afAxisX, float afAxisY, float afAxisZ, bool abResetSpeed, string& asOffsetArea)

= RotatePropToSpeed


PHP Code:
void Entity_StopMovement(stringasName
= StopPropMovement


Code:
void Entity_AttachEntity(string& asPropName, string& asAttachName, string& asAttachFile, float afPosX, float afPosY, float afPosZ, float afRotX, float afRotY, float afRotZ)

= AttachPropToProp


PHP Code:
void Entity_RemoveAttachedEntity(stringasPropNamestringasAttachName
= RemoveAttachedPropFromProp

PHP Code:
void Entity_SetHealth(stringasNamefloat afHealth
= SetPropHealth


PHP Code:
void Entity_AddHealth(stringasNamefloat afHealth
= AddPropHealth


PHP Code:
float Entity_GetHealth(stringasName
= GetPropHealth

PHP Code:
void Entity_Reset(stringasName
= ResetProp


PHP Code:
void Entity_PlayAnimation(stringasPropstringasAnimationfloat afFadeTimebool abLoopstringasCallback
= PlayPropAnimation


PHP Code:
void Entity_AddForce(stringasNamefloat afXfloat afYfloat afZstringasCoordSystem
= AddPropForce


PHP Code:
void Entity_AddImpulse(stringasNamefloat afXfloat afYfloat afZstringasCoordSystem
= AddPropImpulse

PHP Code:
void Entity_AddBodyForce(stringasNamefloat afXfloat afYfloat afZstringasCoordSystem
= AddBodyForce


PHP Code:
void Entity_AddBodyImpulse(stringasNamefloat afXfloat afYfloat afZstringasCoordSystem
= AddBodyImpulse



Code:
void Entity_ConnectWithRope(string& asName, string& asPropName, string& asRopeName, bool abInteractOnly, float afSpeedMul, float afToMinSpeed, float afToMaxSpeed, bool abInvert, int alStatesUsed)

= InteractConnectPropWithRope



Code:
void Entity_ConnectWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly, bool abInvert, int alStatesUsed)

= InteractConnectPropWithMoveObject



Code:
void Entity_ConnectEntities(string& asName, string& asMainEntity, string& asConnectEntity, bool abInvertStateSent, int alStatesUsed, string& asCallbackFunc)

= ConnectEntities


PHP Code:
void Entity_SetStuckState(stringasNameint alState
= SetPropObjectStuckState


PHP Code:
void Entity_SetAllowStickyAreaAttachment(bool abX
= SetAllowStickyAreaAttachment


PHP Code:
void Entity_AttachToStickyArea(stringasAreaNamestringasProp
= AttachPropToStickyArea


PHP Code:
void Entity_AttachBodyToStickyArea(stringasAreaNamestringasBody
= AttachBodyToStickyArea


PHP Code:
void Entity_DetachFromStickyArea(stringasAreaName
= DetachFromStickyArea


MoveObject


Quote:
PHP Code:
void MoveObject_SetState(stringasNamefloat afState
= SetMoveObjectState


Code:
void MoveObject_SetStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed)

= SetMoveObjectStateExt



Lamp

Quote:
PHP Code:
void Entity_SetLampLit(stringasNamebool abLitbool abEffects
= SetLampLit


SwingDoor

Quote:
PHP Code:
void SwingDoor_SetLocked(stringasNamebool abLockedbool abEffects
= SetSwingDoorLocked


PHP Code:
void SwingDoor_SetClosed(stringasNamebool abClosedbool abEffects
= SetSwingDoorClosed


PHP Code:
bool SwingDoor_GetLocked(stringasName
= GetSwingDoorLocked


PHP Code:
bool SwingDoor_GetClosed(stringasName
= GetSwingDoorClosed


PHP Code:
void SwingDoor_SetDisableAutoClose(stringasNamebool abDisableAutoClose
= SetSwingDoorDisableAutoClose


PHP Code:
int SwingDoor_GetState(stringasName
= GetSwingDoorState



LevelDoor

Quote:
PHP Code:
void LevelDoor_SetLocked(stringasNamebool abLocked
= SetLevelDoorLocked

PHP Code:
void LevelDoor_SetLockedSound(stringasNamestringasSound
= SetLevelDoorLockedSound


PHP Code:
void LevelDoor_SetLockedText(stringasNamestringasTextCatstringasTextEntry
= SetLevelDoorLockedText



Wheel

Quote:
PHP Code:
void Wheel_SetStuckState(stringasNameint alStatebool abEffects
= SetWheelStuckState


PHP Code:
void Wheel_SetAngle(stringasNamefloat afAnglebool abAutoMove
= SetWheelAngle

PHP Code:
void Wheel_SetInteractionDisablesStuck(stringasNamebool abX
= SetWheelInteractionDisablesStuck



Lever

Quote:
PHP Code:
void Lever_SetStuckState(stringasNameint alStatebool abEffects
= SetLeverStuckState


PHP Code:
void Lever_SetInteractionDisablesStuck(stringasNamebool abX
= SetLeverInteractionDisablesStuck


PHP Code:
int Lever_GetState(stringasName
= GetLeverState



Button

Quote:
PHP Code:
void Button_SetSwitchedOn(stringasNamebool abSwitchedOnbool abEffects
= SetButtonSwitchedOn



MultiSlider

Quote:
PHP Code:
void MultiSlider_SetStuckState(stringasNameint alStuckStatebool abEffects
= SetMultiSliderStuckState


PHP Code:
void MultiSlider_SetCallback(stringasNamestringasCallback
= SetMultiSliderCallback



NPC

Quote:
PHP Code:
void NPC_SetAwake(stringasNamebool abAwakebool abEffects
= SetNPCAwake


PHP Code:
void NPC_SetFollowPlayer(stringasNamebool abX
= SetNPCFollowPlayer


Enemy


Quote:
PHP Code:
void Enemy_SetDisabled(stringasNamebool abDisabled
= SetEnemyDisabled

PHP Code:
void Enemy_SetIsHallucination(stringasNamebool abX
= SetEnemyIsHallucination


PHP Code:
void Enemy_FadeToSmoke(stringasNamebool abPlaySound
= FadeEnemyToSmoke


PHP Code:
void Enemy_ShowPlayerPosition(stringasName
= ShowEnemyPlayerPosition


PHP Code:
void Enemy_AlertPlayerPresence(string &in asName
= AlertEnemyOfPlayerPresence


PHP Code:
void Enemy_SetTriggersDisabled(stringasNamebool abX
= SetEnemyDisableTriggers


PHP Code:
void Enemy_AddPatrolNode(stringasNamestringasNodeNamefloat afWaitTimestringasAnimation
= AddEnemyPatrolNode

PHP Code:
void Enemy_ClearPatrolNodes(stringasEnemyName
= ClearEnemyPatrolNodes


PHP Code:
void Enemy_SetSanityDecreaseActive(string &in asNamebool abX
= SetEnemySanityDecreaseActive


PHP Code:
void Enemy_TeleportToNode(string &in asEnemyNamestring &in asNodeNamebool abChangeY
= TeleportEnemyToNode

PHP Code:
void Enemy_TeleportToEntity(string &in asEnemyNamestring &in asTargetEntitystring &in asTargetBodybool abChangeY
= TeleportEnemyToEntity


PHP Code:
void Enemy_ChangeManPigPose(string&in asNamestring&in asPoseType
= ChangeManPigPose


PHP Code:
void Enemy_SetTeslaPigFadeDisabled(string&in asNamebool abX
= SetTeslaPigFadeDisabled


PHP Code:
void Enemy_SetTeslaPigSoundDisabled(string&in asNamebool abX
= SetTeslaPigSoundDisabled


PHP Code:
void Enemy_SetTeslaPigEasyEscapeDisabled(string&in asNamebool abX
= SetTeslaPigEasyEscapeDisabled


PHP Code:
void Enemy_ForceTeslaPigSighting(string&in asName
= ForceTeslaPigSighting


PHP Code:
string Enemy_GetStateName(string &in asName
= GetEnemyStateName



RE: Engine Scripts Plus [ES+ 1.2] - More sensical function names - HappyMatt12345 - 12-02-2018

Looking to use this, the only thing I want to do is add a few custom ones (following the same name convention of course) for your SetLocalVarBool, GetLocalVarBool, SetGlobalVarBool, etc. functions that I am also using.


RE: Engine Scripts Plus [ES+ 1.2] - More sensical function names - Mudbill - 12-03-2018

This by default only includes the main functions, but custom ones are no problem of course Tongue

This would be the code to add for those functions:
PHP Code:
void Script_SetLocalVarBool(stringasNamebool abVal) {
    
SetLocalVarInt(asNameabVal 0);
}
 
bool Script_GetLocalVarBool(stringasName) {
    return 
GetLocalVarInt(asName) != 0;
}

void Script_SetGlobalVarBool(stringasNamebool abVal) {
    
SetGlobalVarInt(asNameabVal 0);
}
 
bool Script_GetGlobalVarBool(stringasName) {
    return 
GetGlobalVarInt(asName) != 0;