Advertisement
TechOFreak

Episode 36 Functions

Mar 27th, 2021
1,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.00 KB | None | 0 0
  1. //From my Amnesia Rebirth Tutorial Series
  2. //Episode 36 Sequences!
  3. //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
  4. //-----------------------------------------------------------
  5.  
  6. //Include all sequence functions from the helper script
  7. #include "helpers/helper_sequences.hps"
  8.  
  9. //Create a global variable to store your sequence data
  10. cSequenceStatesData mSeq_Test;
  11.  
  12. //Your sequence function should look like this
  13. void Seq_Test(const tString &in asTimer){
  14.    
  15. }
  16.  
  17. //Start your sequence by calling it
  18. Seq_Test("");
  19. //timer (String)- name of a timer you would like to pass in.
  20.  
  21. //Used to identify the start of the sequence in your sequence function
  22. Sequence_Begin("Seq_Test", mSeq_Test);
  23. //functionName (String)- name of the sequence function your are starting.
  24. //sequenceStateData (cSequenceStatesData)- the cSequenceStatesData variable where all your sequence data will be stored.
  25.  
  26. //Used to identify the end of the sequence in your sequence function
  27. Sequence_End();
  28.  
  29. //Skip the next step in the sequence
  30. Sequence_SkipNextStep();
  31.  
  32. //Run the code inside of the statement and then wait a set amount of time (must be placed inside an if, else, while, etc.).
  33. Sequence_DoStepAndWait(5.0f)
  34. //time (float)- the amount of seconds that should be waited.
  35.  
  36. //Run the code inside of the statement and then move onto the next step (must be placed inside an if, else, while, etc.).
  37. Sequence_DoStepAndContinue()
  38.  
  39. //Run the code inside of the statement and then pause the sequence (must be placed inside an if, else, while, etc.).
  40. //Note: Sequence must be resumed from outside the sequence statement.
  41. Sequence_DoStepAndPause(0.0f)
  42. //time (float)- the amount of seconds that should be waited after the sequence has been resumed.
  43.  
  44. //Resume a sequence that had been paused
  45. SequenceStates_Resume("Seq_Test");
  46. //functionName (String)- name of the sequence function you want to resume.
  47.  
  48. //Example of function usage
  49.  
  50.     void Seq_Test(const tString &in asTimer){
  51.         Sequence_Begin("Seq_Test", mSeq_Test);
  52.        
  53.         if(Sequence_DoStepAndWait(5.0f)){
  54.             cLux_AddDebugMessage("Print this and wait 5 seconds...");
  55.         }
  56.         if(Sequence_DoStepAndContinue()){
  57.             cLux_AddDebugMessage("Print this and continue to do something else");
  58.         }
  59.         if(Sequence_DoStepAndWait(5.0f)){
  60.             cLux_AddDebugMessage("Print this and wait 5 seconds...");
  61.         }
  62.         if(Sequence_DoStepAndContinue()){
  63.             cLux_AddDebugMessage("Print this and skip the next step...");
  64.             Sequence_SkipNextStep();
  65.         }
  66.         if(Sequence_DoStepAndContinue()){
  67.             cLux_AddDebugMessage("This is going to be skipped!");
  68.         }
  69.         if(Sequence_DoStepAndPause(0.0f)){
  70.             cLux_AddDebugMessage("This sequence will be paused until the bottle is broken");
  71.         }
  72.         if(Sequence_DoStepAndContinue()){
  73.             cLux_AddDebugMessage("Looks like the bottle broke, finishing sequence!");
  74.         }
  75.        
  76.         Sequence_End();
  77.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement