Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 15 Enemies Pt.5! Ghoul Hole Networks!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- /////////////////////////////////////////////
- //Hole functionality with command functions
- /////////////////////////////////////////////
- //Command a ghoul to go to a hole, either the closest one or a random one
- Ghoul_CommandGoToHole_Execute("ghoul_hallway", Map_GetEntity("ghoul_hallway").GetPosition(),
- false, false, false, true, eGhoulSpeed_Run, -1, -1, false, false, "OnEnterHole_GhoulHallway");
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulPosition (cVector3f)- the coordinates that the ghoul is at.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
- //teleportToHole (bool)- should the ghoul be teleported into the hole or should he make his way there on foot.
- //deactivateAfter (bool)- deactivate this command after completed.
- //useClosestHole (bool)- if true the ghoul will go to the nearest hole, otherwise if false it will pick a random one.
- //ghoulSpeed (eGhoulSpeed)- the speed at which the ghoul should move.
- //minRadius (float)- the minimum radius that the ghoul will look for a hole (-1 for unlimited).
- //maxRadius (float)- the maximum radius that the ghoul will look for a hole (-1 for unlimited).
- //freeHole (bool)- should the ghoul only use holes that arent occupied by other ghouls.
- //outPlayerSight (bool)- should the ghoul avoid a hole if the player is looking at the hole.
- //completedCallback (String)- the name of the function you want to run when the ghoul enters the hole.
- //Command ghoul to go to a specific hole
- Ghoul_CommandGoToSpecificHole_Execute("ghoul_hallway", "hole_hallway_1", false, false, false, eGhoulSpeed_Walk, "OnEnterHole_GhoulHallway");
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulHoleName (String)- name of your ghoul hole area as it appears in your level editor.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
- //teleportToHole (bool)- should the ghoul be teleported into the hole or should he make his way there on foot.
- //deactivateAfter (bool)- deactivate this command after completed.
- //ghoulSpeed (eGhoulSpeed)- the speed at which the ghoul should move.
- //completedCallback (String)- the name of the function you want to run when the ghoul enters the hole.
- //Syntax for the Ghoul_CommandGoToHole_Execute and Ghoul_CommandGoToSpecificHole_Execute completed callbacks
- void OnEnterHole_GhoulHallway(const tString &in asEntity){
- cLux_AddDebugMessage("Ghoul entered hole");
- }
- //Command a ghoul to leave from a specified hole
- Ghoul_CommandEmergeFromHole_Execute("ghoul_hallway", "hole_hallway_2", false, "OnEmergeCompleted_GhoulHallway", "", "");
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulHoleName (String)- name of your ghoul hole area as it appears in your level editor.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
- //completedCallback (String)- the name of the function you want to run when the ghoul exits the hole.
- //customAnimationEmerge (String)- the animation you want the ghoul to play when he is emerging.
- //customAnimationCmergeComplete (String)- the animation for the ghoul to play after emerging from the hole.
- //Syntax for Ghoul_CommandEmergeFromHole_Execute completed callback
- void OnEmergeCompleted_GhoulHallway(const tString &in asEntity){
- cLux_AddDebugMessage("Ghoul emerged from hole");
- }
- /////////////////////////////////////////////
- //Hole functionality with mode functions
- /////////////////////////////////////////////
- //Have the ghoul go into the nearest hole and follow the player by jumping through holes
- Ghoul_ModeStalkThroughHoles_Setup("ghoul_hallway", "hole_hallway_*", "", "", false);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulHoleNetwork (String)- name of your ghoul holes by providing a wildcard.
- //playerPath (String)- name of your path nodes that outline the general direction the player will head, provide a wildcard.
- //ghoulHoleConnections (String)- name of another network of holes that this one is connected to, provide a wildcard.
- //hideUnlessDisturbed (bool)- should the ghoul hide until the player makes a noise.
- //Sets the mode that the ghoul should operate in
- Ghoul_Mode_Set("ghoul_hallway", eGhoulMode_StalkThroughHoles, false);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulMode (eGhoulMode)- the mode we want the ghoul to be in, eGhoulMode_StalkThroughHoles for a hole stalking ghoul.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
Advertisement
Add Comment
Please, Sign In to add comment