User Tools

Site Tools


hpl3:game:scripting:sequences

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl3:game:scripting:sequences [2015/09/17 13:56]
ian.thomas
hpl3:game:scripting:sequences [2015/09/17 14:05] (current)
ian.thomas [Important Functions]
Line 3: Line 3:
 Many of the events that happen throughout SOMA are triggered sequences - a sound plays, then the player'​s FoV changes, then a light starts flashing etc. etc. We control all of those through a set of wrappers we call Sequences, which hide a bunch of timers away and make things easier to read. Many of the events that happen throughout SOMA are triggered sequences - a sound plays, then the player'​s FoV changes, then a light starts flashing etc. etc. We control all of those through a set of wrappers we call Sequences, which hide a bunch of timers away and make things easier to read.
  
-For each sequence you need a map property to store the state - a ''​cSequenceStatesData<​code>​+For each sequence you need a map property to store the state - a ''​cSequenceStatesData''​ property e.g. 
 +<​code>​
 cSequenceStatesData mSequenceAlert;​ cSequenceStatesData mSequenceAlert;​
 </​code>​ </​code>​
Line 11: Line 12:
 void Sequence_Alert(const tString&​ in asName) void Sequence_Alert(const tString&​ in asName)
 { {
-    Sequence_Begin("​Sequence_Alert",​ mSequenceAlert); ​   ​+    Sequence_Begin("​Sequence_Alert",​ mSequenceAlert);​ 
 +    
     if(Sequence_DoStepAndWait(1.0f)) ​ // Do this step and then wait for 1 second     if(Sequence_DoStepAndWait(1.0f)) ​ // Do this step and then wait for 1 second
     {     {
Line 56: Line 58:
 ==== Important Functions ==== ==== Important Functions ====
  
 +=== Sequence_Begin === 
 +Mark the start of a sequence block. 
 +=== Sequence_End === 
 +Mark the end of the current sequence block. 
 +=== Sequence_Stop === 
 +Stop the current sequence immediately (sort of like an abort). 
 +=== Sequence_DoStepAndWait === 
 +Do the step within the following brackets and then wait for the specified time. 
 +=== Sequence_DoStepWaitAndRepeat === 
 +Do the step within the following brackets and then wait for the specified time; repeat for a number of iterations. 
 +=== Sequence_DoStepAndContinue === 
 +Do the step within the following brackets and then immediately carry on to the next step. 
 +=== Sequence_DoStepAndPause === 
 +Do the step within the following brackets and then pause until ''​Sequence_Resume''​ is called. 
 +=== Sequence_Wait === 
 +Just wait for a set period of time (no step in brackets). 
 +=== Sequence_Pause === 
 +Pause the sequence until ''​Sequence_Resume''​ is called. 
 +=== Sequence_SkipNextSteps === 
 +Skip the specified number of sequence steps. 
 +=== Sequence_SkipNextStep === 
 +Skip the next sequence step. 
 +=== SequenceStates_Pause === 
 +Pause a specified sequence. 
 +=== SequenceStates_Resume === 
 +Resume the specified sequence. 
 +=== SequenceStates_Stop === 
 +Stop the specified sequence. 
 +=== SequenceStates_IsActive === 
 +Returns true if a particular sequence is active.
hpl3/game/scripting/sequences.1442498185.txt.gz · Last modified: 2015/09/17 13:56 by ian.thomas