Advertisement
TechOFreak

Episode 35 Functions

Mar 17th, 2021
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.36 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 35 Permafail! Respawning!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. ///////////////////////////////////////////////////
  7. // Global Variables Created
  8. //////////////////////////////////////////////////
  9.  
  10. //Create a variable to store our checkpoints
  11. tString permaFailCheckpoint = "PermaFail_Default";
  12.  
  13. //Create a variable to store our ghouls vector coordinates
  14. cVector3f ghoulHallwaySpawnPos;
  15.  
  16. ///////////////////////////////////////////////////
  17. // Functions used in today's episode
  18. //////////////////////////////////////////////////
  19.  
  20. //This function is automatically called when the player permafails (after the player's screen goes black)
  21. bool OnPermaFail()
  22. {
  23.     return true;
  24. }
  25.  
  26. //This function is automatically called when the player respawns after permafailing (after respawn cutscene)
  27. bool OnPermaFailRespawn()
  28. {
  29.     return true;
  30. }
  31.  
  32. //Set the ghoul to auto kill/permafail the player
  33. Ghoul_SetInstantKill("ghoul_hallway", true);
  34. //ghoulName(String) - name of the ghoul.
  35. //instantKill(bool) - should the ghoul instant kill (true or false).
  36.  
  37. //Set the location the player should respawn if they permafail
  38. FearHandler_SetPermaFailRespawnArea(permaFailCheckpoint);
  39. //permaFailArea(String) - the name of the permafail area as it appears in the level editor.
  40.  
  41. //Gets the entity object from the string name of an entity
  42. Map_GetEntity("ghoul_hallway");
  43. //entityName(String) - name of the entity as it appears in your level.
  44.  
  45. //Set 1 or more doors to be completed closed
  46. SwingDoor_SetClosed("door_*", true, false);
  47. //doorName(String) - name of the door as it appears in the level editor(wildcards allowed for specifying more than 1 entity).
  48. //closed(bool) - should the door be closed or open (true or false).
  49. //effects(bool) - should any door specific effects play (true or false).
  50.  
  51. //Create a collide callback between 2 entities
  52. Entity_AddCollideCallback("player", "trigger_bottom_stairs", "OnCollide_Player_TriggerBottomStairs");
  53. //parentEntity(String) - the name of 1 of the entities that will be colliding (they will become the parent).
  54. //childEntity(String) - the name of 1 of the entities that will be colliding (they will become the child).
  55. //functionName(String) - the name of the function to call when the 2 entities collide.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement