TechOFreak

Episode 10 Functions

Nov 23rd, 2020
899
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 10 Timers and Enemy Spawning
  3. //https://www.youtube.com/channel/UCHEzyhMw1EALBcJEKVJFmwA
  4. //-----------------------------------------------------------
  5.  
  6. //Creates a timer that runs a function when the time expires
  7. Map_AddTimer("Timer_HallwayGhoul", 10.0f, "OnTimer_HallwayGhoul");
  8. //timerName (String)- the name of your timer to reference within your script (not anything in your level).
  9. //timerTime (float)- the amount of time you want to set the timer for.
  10. //functionName (String)- the name of the function you wish to execute when the timer expires.
  11.  
  12. //Checks if the specified timer exists
  13. Map_TimerExists("Timer_HallwayGhoul");
  14. //timerName (String)- the name of your timer to reference within your script (First value in your AddTimer function).
  15.  
  16. //Removes a specified timer
  17. Map_RemoveTimer("Timer_HallwayGhoul");
  18. //timerName (String)- the name of your timer to reference within your script (First value in your AddTimer function).
  19.  
  20. //Pause an existing timer
  21. Map_SetTimerPaused("Timer_HallwayGhoul", true);
  22. //timerName (String)- the name of your timer to reference within your script (First value in your AddTimer function).
  23. //pause (bool)- should the timer be paused true or false
  24.  
  25. //Get the time left on a timer
  26. Map_GetTimerTime("Timer_HallwayGhoul");
  27. //timerName (String)- the name of your timer to reference within your script (First value in your AddTimer function).
  28.  
  29. //If called from within a timer function it will restart the timer to the specified time
  30. Map_RestartCurrentTimer(5.0f);
  31. //timerTime (float)- the amount of time the timer should be recreated with.
  32.  
  33. //Checks to see if a timer has already expired and recreates the timer
  34. Map_TimeHasPassed("Timer_HallwayGhoul", 5.0f);
  35. //timerName (String)- the name of your timer to reference within your script (First value in your AddTimer function).
  36. //timerTime (float)- the amount of time the timer should be recreated with.
  37.  
  38. //Make an entity in your level active or inactive
  39. Entity_SetActive("ghoul_hallway", true);
  40. //entityName (String)- the name of your entity as it appears in your level editor.
  41. //activate (bool)- should the entity be set active (true) or inactive (false).
RAW Paste Data