User Tools

Site Tools


assets:scripting_with_stateanimator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
assets:scripting_with_stateanimator [2019-11-17 09:29]
skyjake [Introduction]
assets:scripting_with_stateanimator [2019-11-17 21:52] (current)
skyjake [StateAnimator methods]
Line 29: Line 29:
     end     end
 end</​code>​ end</​code>​
-  * The model asset'​s ''​animation''​ block can define named [[model#​timelines|script timelines]]. These can be started when a model animation sequence starts, or separately using the [[script:StateAnimator.startSequence]] method.+  * The model asset'​s ''​animation''​ block can define named [[model#​timelines|script timelines]]. These can be started when a model animation sequence starts, or separately using [[#StateAnimator ​methods]].
   * Any state sequence trigger defined in the model asset can have an embedded [[model#​timelines|script timeline]].   * Any state sequence trigger defined in the model asset can have an embedded [[model#​timelines|script timeline]].
 ===== StateAnimator variables ===== ===== StateAnimator variables =====
Line 48: Line 48:
 | (pass).''​enabled''​| Other pass variables in the pass records (e.g., ''​body.enabled''​). | | (pass).''​enabled''​| Other pass variables in the pass records (e.g., ''​body.enabled''​). |
 | (pass).''​material''​| Material to use when drawing a rendering pass (if declared in the definition). | | (pass).''​material''​| Material to use when drawing a rendering pass (if declared in the definition). |
 +
  
 ===== StateAnimator methods ===== ===== StateAnimator methods =====
  
-==== thing () ====+Objects of the Render.StateAnimator class have the following methods.
  
-==== playingSequences () ====+#​@Identifier_HTML~playingSequences~@# ( )
  
-==== startSequence (sequence, priority, looping, node) ====+#​@Identifier_HTML~startSequence~@# ( 
 + #​@Arg_HTML~Text,​sequence~@#,  
 + #​@Arg_HTML~Number,priority~@# 
 + #​@UArg_HTML~looping~@#,  
 + #​@Arg_HTML~Text,node~@# = "" ​)
  
-==== startTimeline (name) ​====+#​@Identifier_HTML~startTimeline~@# #​@Arg_HTML~Text,​name~@# )
  
-==== stopTimeline (name) ​====+#​@Identifier_HTML~stopTimeline~@# #​@Arg_HTML~Text,​name~@# )
  
 +#​@Identifier_HTML~thing~@#​ ( ) 
 +
 +Returns a World.Thing representing the mobj that the animator belongs to.
  
 ===== Asset callbacks ===== ===== Asset callbacks =====
Line 66: Line 74:
 StateAnimator will call methods defined in the model asset when certain events occur. StateAnimator will call methods defined in the model asset when certain events occur.
  
-==== onInit (animator) ​====+#​@Identifier_HTML~onInit~@# ( 
 + #​@Arg_HTML~Render.StateAnimator,​animator~@# ) 
 + 
 +#​@Identifier_HTML~onDamage~@#​ ( 
 + #​@Arg_HTML~Render.StateAnimator,​animator~@#,​  
 + #​@Arg_HTML~Number,​points~@#,​  
 + #​@Arg_HTML~World.Thing,​inflictor~@# ​)
  
-==== onDamage ​(animator, ​pointsinflictor====+#​@Identifier_HTML~onStateChange~@# ​( 
 + #​@Arg_HTML~Render.StateAnimator,​animator~@# 
 + #​@Arg_HTML~Text,state~@# ​
  
-==== onStateChange (animator, ​state) ====+This is only called if the state is in the animator's ''​notifiedStates''​ variable. For examplein the model definition, one could use: 
 +<​code>​ 
 +notifiedStates <​DEADARTI1,​ DORMANTARTI1>​ 
 +</​code>​
  
 ===== Examples ===== ===== Examples =====
assets/scripting_with_stateanimator.1573975782.txt.gz · Last modified: 2019-11-17 09:29 by skyjake