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 afMin, float afMax) 
= RandFloat

PHP Code:
int Math_RandInt(int alMin, int 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 afX, float afY) 
= MathAtan2

PHP Code:
float Math_Sqrt(float afX) 
= MathSqrt

PHP Code:
float Math_Pow(float afBase, float afExp) 
= MathPow

PHP Code:
float Math_Min(float afA, float afB) 
= MathMin

PHP Code:
float Math_Max(float afA, float afB) 
= MathMax

PHP Code:
float Math_Clamp(float afX, float afMin, float afMax) 
= MathClamp

PHP Code:
float Math_Abs(float afX) 
= MathAbs


String

Quote:
PHP Code:
bool String_Contains(string& asString, string& asSubString) 
= StringContains

PHP Code:
string String_Sub(string& asString, int alStart, int 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(string& asString) 
= Print

PHP Code:
void Debug_AddMessage(string& asString, bool abCheckForDuplicates) 
= AddDebugMessage

PHP Code:
void Debug_ProgLog(string& asLevel, string& asMessage) 
= ProgLog

PHP Code:
bool Debug_GetEnabled() 
= ScriptDebugOn


Script

Quote:
PHP Code:
void Script_SetLocalVarInt(string& asName, int alVal) 
= SetLocalVarInt

PHP Code:
void Script_AddLocalVarInt(string& asName, int alVal) 
= AddLocalVarInt

PHP Code:
int Script_GetLocalVarInt(string& asName) 
= GetLocalVarInt

PHP Code:
void Script_SetLocalVarFloat(string& asName, float afVal) 
= SetLocalVarFloat

PHP Code:
void Script_AddLocalVarFloat(string& asName, float afVal) 
= AddLocalVarFloat

PHP Code:
float Script_GetLocalVarFloat(string& asName) 
= GetLocalVarFloat

PHP Code:
void Script_SetLocalVarString(string& asName, const string& asVal) 
= SetLocalVarString

PHP Code:
void Script_AddLocalVarString(string& asName, string& asVal) 
= AddLocalVarString

PHP Code:
string Script_GetLocalVarString(string& asName) 
= GetLocalVarString

PHP Code:
void Script_SetGlobalVarInt(string& asName, int alVal) 
= SetGlobalVarInt

PHP Code:
void Script_AddGlobalVarInt(string& asName, int alVal) 
= AddGlobalVarInt


PHP Code:
int Script_GetGlobalVarInt(string& asName) 
= GetGlobalVarInt


PHP Code:
void Script_SetGlobalVarFloat(string& asName, float afVal) 
= SetGlobalVarFloat


PHP Code:
void Script_AddGlobalVarFloat(string& asName, float afVal) 
= AddGlobalVarFloat


PHP Code:
float Script_GetGlobalVarFloat(string& asName) 
= GetGlobalVarFloat


PHP Code:
void Script_SetGlobalVarString(string& asName, const string& asVal) 
= SetGlobalVarString


PHP Code:
void Script_AddGlobalVarString(string& asName, string& asVal) 
= AddGlobalVarString


PHP Code:
string Script_GetGlobalVarString(string& asName) 
= GetGlobalVarString


ParticleSystem

Quote:
PHP Code:
void ParticleSystem_Preload(string& asPSFile) 
= PreloadParticleSystem

PHP Code:
void ParticleSystem_CreateAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool 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(string& asName) 
= DestroyParticleSystem

PHP Code:
void ParticleSystem_StartPlayerSpawnPS(string& asPSFile) 
= StartPlayerSpawnPS

PHP Code:
void ParticleSystem_StopPlayerSpawnPS() 
= StopPlayerSpawnPS


Sound

Quote:
PHP Code:
void Sound_Preload(string& a) 
= PreloadSound

PHP Code:
Sound_PlayAtEntity(string& a, string& b, string& c, float d, bool e) 
= PlaySoundAtEntity

PHP Code:
void Sound_FadeIn(string& a, float b, bool c) 
= FadeInSound

PHP Code:
void Sound_Stop(string& a, float b) 
= StopSound

PHP Code:
void Sound_PlayMusic(string& a, bool b, float c, float d, int e, bool f) 
= PlayMusic

PHP Code:
void Sound_StopMusic(float a, int b) 
= StopMusic

PHP Code:
void Sound_FadeGlobalVolume(float a, float b) 
= FadeGlobalSoundVolume

PHP Code:
void Sound_FadeGlobalSpeed(float a, float 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(string& asFunc) 
= SetEffectVoiceOverCallback


PHP Code:
void Sound_PlayGuiSound(string& asSoundFile, float afVolume) 
= PlayGuiSound


Light

Quote:
PHP Code:
void Light_SetVisible(string& a, bool b) 
= SetLightVisible
PHP Code:
void Light_FadeTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime) 
= FadeLightTo


PHP Code:
void Light_SetFlickerActive(string& asLightName, bool abActive) 
= SetLightFlickerActive



Game


Quote:
PHP Code:
void Game_StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum) 
= StartCredits


PHP Code:
void Game_StartDemoEnd() 
= StartDemoEnd


PHP Code:
void Game_AutoSave() 
= AutoSave


PHP Code:
void Game_SetupLoadScreen(string&asTextCat, string&asTextEntry, int alRandomNum, string&asImageFile) 
= SetupLoadScreen


PHP Code:
void Game_SetDeathHint(string& asTextCategory, string& asTextEntry) 
= SetDeathHint


PHP Code:
void Game_DisableDeathStartSound() 
= DisableDeathStartSound


PHP Code:
void Game_GiveHint(string& asName, string& asMessageCat, string& asMessageEntry, float afTimeShown) 
= GiveHint


PHP Code:
void Game_RemoveHint(string& asName) 
= RemoveHint


PHP Code:
void Game_BlockHint(string& asName) 
= BlockHint


PHP Code:
void Game_UnblockHint(string& asName) 
= 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(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound) 
= ChangeMap


PHP Code:
void Map_ClearSavedMaps() 
= ClearSavedMaps


PHP Code:
void Map_SetDisplayNameEntry(string& asNameEntry) 
= SetMapDisplayNameEntry


PHP Code:
void Map_SetSkyboxActive(bool abActive) 
= SetSkyBoxActive


PHP Code:
void Map_SetSkyboxTexture(string & asTexture) 
= SetSkyboxTexture


PHP Code:
void Map_SetSkyboxColor(float afR, float afG, float afB, float afA) 
= SetSkyboxColor


PHP Code:
void Map_SetFogActive(bool abActive) 
= SetFogActive


PHP Code:
void Map_SetFogColor(float afR, float afG, float afB, float afA) 
= SetFogColor


PHP Code:
void Map_SetFogProperties(float afStart, float afEnd, float afFalloffExp, bool abCulling) 
= SetFogProperties



Timer


Quote:
PHP Code:
void Timer_Add(string& asName, float afTime, string& asFunction) 
= AddTimer

PHP Code:
void Timer_Remove(string& asName) 
= RemoveTimer

PHP Code:
float Timer_GetTimeLeft(string& asName) 
= 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 afAmount, float afSpeed) 
= FadeImageTrailTo

PHP Code:
void Effect_FadeSepiaColorTo(float afAmount, float afSpeed) 
= FadeSepiaColorTo

PHP Code:
void Effect_FadeRadialBlurTo(float afSize, float afSpeed) 
= FadeRadialBlurTo

PHP Code:
void Effect_SetRadialBlurStartDist(float afStartDist) 
= SetRadialBlurStartDist

PHP Code:
void Effect_StartFlash(float afFadeIn, float afWhite, float afFadeOut) 
= StartEffectFlash

PHP Code:
void Effect_StartEmotionFlash(string& asTextCat, string& asTextEntry, string& asSound) 
= StartEffectEmotionFlash

PHP Code:
bool Effect_GetFlashbackIsActive() 
= GetFlashbackIsActive

PHP Code:
void Effect_StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime) 
= StartScreenShake

PHP Code:
void Effect_SetInDarknessEffectsActive(bool abX) 
= SetInDarknessEffectsActive

PHP Code:
void Effect_SetInsanitySetEnabled(string& asSet, bool 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 afX, float afSpeed) 
= FadePlayerFOVMulTo

PHP Code:
void Effect_FadeAspectMulTo(float afX, float afSpeed) 
= FadePlayerAspectMulTo

PHP Code:
void Effect_FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed) 
= FadePlayerRollTo

PHP Code:
void Effect_MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist) 
= MovePlayerHeadPos

PHP Code:
void Effect_SetMessage(string& asTextCategory, string& asTextEntry, float 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 afX, float afY, float afZ, bool 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 afAmount, bool abUseEffect) 
= GiveSanityDamage


PHP Code:
void Player_GiveDamage(float afAmount, string& asType, bool abSpinHead, bool abLethal) 
= GivePlayerDamage


PHP Code:
void Player_StartLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback) 
= 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(string& asStartPosName) 
= TeleportPlayer


PHP Code:
void Player_SetLanternActive(bool abX, bool abUseEffects) 
= SetLanternActive


PHP Code:
void Player_SetLanternDisabled(bool abX) 
= SetLanternDisabled


PHP Code:
bool Player_GetLanternActive() 
= GetLanternActive


PHP Code:
void Player_SetLanternLitCallback(string& asCallback) 
= SetLanternLitCallback


PHP Code:
void Player_MoveForward(float afAmount) 
= MovePlayerForward


PHP Code:
void Player_SetFallDamageDisabled(bool abX) 
= SetPlayerFallDamageDisabled


PHP Code:
void Player_SetPos(float afX, float afY, float 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(string& asNameAndTextEntry, string& asImage) 
= AddNote


PHP Code:
void Journal_AddDiary(string& asNameAndTextEntry, string& asImage) 
= AddDiary


PHP Code:
void Journal_ReturnOpen(bool abOpenJournal) 
= ReturnOpenJournal


PHP Code:
void Journal_AddQuest(string& asName, string& asNameAndTextEntry) 
= AddQuest


PHP Code:
void Journal_CompleteQuest(string& asName, string& asNameAndTextEntry) 
= CompleteQuest


PHP Code:
bool Journal_GetQuestIsAdded(string& asName) 
= 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(string& asTextCategory, string& asTextEntry, float afTime) 
= SetInventoryMessage


PHP Code:
void Inventory_GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount) 
= GiveItem

PHP Code:
void Inventory_GiveItemFromFile(string& asName, string& asFileName) 
= GiveItemFromFile


PHP Code:
void Inventory_RemoveItem(string& asName) 
= RemoveItem


PHP Code:
bool Inventory_HasItem(string& asName) 
= HasItem


PHP Code:
void Inventory_AddCombineCallback(string& asName, string& asItemA, string& asItemB, string& asFunction, bool abAutoRemove) 
= AddCombineCallback


PHP Code:
void Inventory_RemoveCombineCallback(string& asName) 
= RemoveCombineCallback


PHP Code:
void Inventory_AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy) 
= AddUseItemCallback


PHP Code:
void Inventory_RemoveUseItemCallback(string& asName) 
= RemoveUseItemCallback


Entity


Quote:
PHP Code:
void Entity_SetActive(string& asName, bool abActive) 
= SetEntityActive


PHP Code:
void Entity_SetVisible(string& asName, bool abVisible) 
= SetEntityVisible


PHP Code:
bool Entity_GetExists(string& asName) 
= GetEntityExists


PHP Code:
void Entity_SetCustomFocusCrossHair(string& asName, string& asCrossHair) 
= SetEntityCustomFocusCrossHair


PHP Code:
void Entity_CreateAtArea(string& asEntityName, string& asEntityFile, string& asAreaName, bool 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 asName, string &in asTargetEntity, string &in asTargetBodyName, bool abUseRotation) 
= PlaceEntityAtEntity


PHP Code:
void Entity_SetPos(string &in asName, float afX, float afY, float 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(string& asName, string& asCallback, bool abRemoveWhenLookedAt) 
= SetEntityPlayerLookAtCallback


PHP Code:
void Entity_SetPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction) 
= SetEntityPlayerInteractCallback


PHP Code:
void Entity_SetCallbackFunc(string& asName, string& asCallback) 
= SetEntityCallbackFunc


PHP Code:
void Entity_SetConnectionStateChangeCallback(string& asName, string& asCallback) 
= SetEntityConnectionStateChangeCallback


PHP Code:
void Entity_SetInteractionDisabled(string& asName, bool abDisabled) 
= SetEntityInteractionDisabled


PHP Code:
void Entity_BreakJoint(string& asName) 
= BreakJoint


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


PHP Code:
void Entity_RemoveCollideCallback(string& asParentName, string& asChildName) 
= RemoveEntityCollideCallback


PHP Code:
bool Entity_GetCollide(string& asEntityA, string& asEntityB) 
= GetEntitiesCollide


PHP Code:
void Entity_SetBodyMass(string &in asName, float afMass) 
= SetBodyMass


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


PHP Code:
void Entity_SetEffectActive(string& asName, bool abActive, bool abFadeAndPlaySounds) 
= SetPropEffectActive


PHP Code:
void Entity_SetActiveAndFade(string& asName, bool abActive, float afFadeTime) 
= SetPropActiveAndFade


PHP Code:
void Entity_SetStaticPhysics(string& asName, bool abX) 
= SetPropStaticPhysics

PHP Code:
bool Entity_GetInteractedWith(string& asName) 
= 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(string& asName) 
= 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(string& asPropName, string& asAttachName) 
= RemoveAttachedPropFromProp

PHP Code:
void Entity_SetHealth(string& asName, float afHealth) 
= SetPropHealth


PHP Code:
void Entity_AddHealth(string& asName, float afHealth) 
= AddPropHealth


PHP Code:
float Entity_GetHealth(string& asName) 
= GetPropHealth

PHP Code:
void Entity_Reset(string& asName) 
= ResetProp


PHP Code:
void Entity_PlayAnimation(string& asProp, string& asAnimation, float afFadeTime, bool abLoop, string& asCallback) 
= PlayPropAnimation


PHP Code:
void Entity_AddForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem) 
= AddPropForce


PHP Code:
void Entity_AddImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem) 
= AddPropImpulse

PHP Code:
void Entity_AddBodyForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem) 
= AddBodyForce


PHP Code:
void Entity_AddBodyImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem) 
= 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(string& asName, int alState) 
= SetPropObjectStuckState


PHP Code:
void Entity_SetAllowStickyAreaAttachment(bool abX) 
= SetAllowStickyAreaAttachment


PHP Code:
void Entity_AttachToStickyArea(string& asAreaName, string& asProp) 
= AttachPropToStickyArea


PHP Code:
void Entity_AttachBodyToStickyArea(string& asAreaName, string& asBody) 
= AttachBodyToStickyArea


PHP Code:
void Entity_DetachFromStickyArea(string& asAreaName) 
= DetachFromStickyArea


MoveObject


Quote:
PHP Code:
void MoveObject_SetState(string& asName, float 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(string& asName, bool abLit, bool abEffects) 
= SetLampLit


SwingDoor

Quote:
PHP Code:
void SwingDoor_SetLocked(string& asName, bool abLocked, bool abEffects) 
= SetSwingDoorLocked


PHP Code:
void SwingDoor_SetClosed(string& asName, bool abClosed, bool abEffects) 
= SetSwingDoorClosed


PHP Code:
bool SwingDoor_GetLocked(string& asName) 
= GetSwingDoorLocked


PHP Code:
bool SwingDoor_GetClosed(string& asName) 
= GetSwingDoorClosed


PHP Code:
void SwingDoor_SetDisableAutoClose(string& asName, bool abDisableAutoClose) 
= SetSwingDoorDisableAutoClose


PHP Code:
int SwingDoor_GetState(string& asName) 
= GetSwingDoorState



LevelDoor

Quote:
PHP Code:
void LevelDoor_SetLocked(string& asName, bool abLocked) 
= SetLevelDoorLocked

PHP Code:
void LevelDoor_SetLockedSound(string& asName, string& asSound) 
= SetLevelDoorLockedSound


PHP Code:
void LevelDoor_SetLockedText(string& asName, string& asTextCat, string& asTextEntry) 
= SetLevelDoorLockedText



Wheel

Quote:
PHP Code:
void Wheel_SetStuckState(string& asName, int alState, bool abEffects) 
= SetWheelStuckState


PHP Code:
void Wheel_SetAngle(string& asName, float afAngle, bool abAutoMove) 
= SetWheelAngle

PHP Code:
void Wheel_SetInteractionDisablesStuck(string& asName, bool abX) 
= SetWheelInteractionDisablesStuck



Lever

Quote:
PHP Code:
void Lever_SetStuckState(string& asName, int alState, bool abEffects) 
= SetLeverStuckState


PHP Code:
void Lever_SetInteractionDisablesStuck(string& asName, bool abX) 
= SetLeverInteractionDisablesStuck


PHP Code:
int Lever_GetState(string& asName) 
= GetLeverState



Button

Quote:
PHP Code:
void Button_SetSwitchedOn(string& asName, bool abSwitchedOn, bool abEffects) 
= SetButtonSwitchedOn



MultiSlider

Quote:
PHP Code:
void MultiSlider_SetStuckState(string& asName, int alStuckState, bool abEffects) 
= SetMultiSliderStuckState


PHP Code:
void MultiSlider_SetCallback(string& asName, string& asCallback) 
= SetMultiSliderCallback



NPC

Quote:
PHP Code:
void NPC_SetAwake(string& asName, bool abAwake, bool abEffects) 
= SetNPCAwake


PHP Code:
void NPC_SetFollowPlayer(string& asName, bool abX) 
= SetNPCFollowPlayer


Enemy


Quote:
PHP Code:
void Enemy_SetDisabled(string& asName, bool abDisabled) 
= SetEnemyDisabled

PHP Code:
void Enemy_SetIsHallucination(string& asName, bool abX) 
= SetEnemyIsHallucination


PHP Code:
void Enemy_FadeToSmoke(string& asName, bool abPlaySound) 
= FadeEnemyToSmoke


PHP Code:
void Enemy_ShowPlayerPosition(string& asName) 
= ShowEnemyPlayerPosition


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


PHP Code:
void Enemy_SetTriggersDisabled(string& asName, bool abX) 
= SetEnemyDisableTriggers


PHP Code:
void Enemy_AddPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation) 
= AddEnemyPatrolNode

PHP Code:
void Enemy_ClearPatrolNodes(string& asEnemyName) 
= ClearEnemyPatrolNodes


PHP Code:
void Enemy_SetSanityDecreaseActive(string &in asName, bool abX) 
= SetEnemySanityDecreaseActive


PHP Code:
void Enemy_TeleportToNode(string &in asEnemyName, string &in asNodeName, bool abChangeY) 
= TeleportEnemyToNode

PHP Code:
void Enemy_TeleportToEntity(string &in asEnemyName, string &in asTargetEntity, string &in asTargetBody, bool abChangeY) 
= TeleportEnemyToEntity


PHP Code:
void Enemy_ChangeManPigPose(string&in asName, string&in asPoseType) 
= ChangeManPigPose


PHP Code:
void Enemy_SetTeslaPigFadeDisabled(string&in asName, bool abX) 
= SetTeslaPigFadeDisabled


PHP Code:
void Enemy_SetTeslaPigSoundDisabled(string&in asName, bool abX) 
= SetTeslaPigSoundDisabled


PHP Code:
void Enemy_SetTeslaPigEasyEscapeDisabled(string&in asName, bool 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(string& asName, bool abVal) {
    
SetLocalVarInt(asName, abVal ? 1 : 0);
}
 
bool Script_GetLocalVarBool(string& asName) {
    return 
GetLocalVarInt(asName) != 0;
}

void Script_SetGlobalVarBool(string& asName, bool abVal) {
    
SetGlobalVarInt(asName, abVal ? 1 : 0);
}
 
bool Script_GetGlobalVarBool(string& asName) {
    return 
GetGlobalVarInt(asName) != 0;
}