User Tools

Site Tools


set_global_property

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
set_global_property [2017/05/14 15:58] justinset_global_property [2020/04/27 14:37] justin
Line 2: Line 2:
 ---- ----
  
-Sets a custom global property to the specified value. This property can then be referenced elsewhere, for example when evaluating a condition.+Sets a custom [[global_properties|global property]] to the specified value. This property can then be referenced elsewhere, for example when evaluating a condition. When editing this function in the [[Script Editor]], the [[Variable Expression Builder]] provides an easy way to choose which value you'd like to assign to the property. These properties can also be given values via [[script_syntax|assignment statements]] (i.e. the "Assign Value" visual [[script]] node) or even pre-defined with initial startup values from the [[Global Properties]] tab in your [[Game Configuration]].
  
 +====Signature:====
 <code python> <code python>
 set_global_property(property_name, property_value) set_global_property(property_name, property_value)
Line 10: Line 11:
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
 |property_name|Name of the property.|[[String]]|Yes| |property_name|Name of the property.|[[String]]|Yes|
-|property_value|Value that will be assigned to the property.|[[String]], [[Decimal]], [[Boolean]]|Yes|+|property_value|Value that will be assigned to the property.|[[String]], [[Number]], [[Boolean]]|Yes|
  
 <WRAP center round info 100%> <WRAP center round info 100%>
-You can also store properties that are specific to a tile, object, or character. For more information, see [[Set Entity Property]].+You can also store properties that are specific to a [[tile]][[object]], or [[character]]. For more information, see [[Set Entity Property]].
 </WRAP> </WRAP>
  
 ====Example:==== ====Example:====
-<code python+<code bauxite
-set_global_property("prop_name", "prop_value")+set_global_property("keys", global.property["keys"] + 1)
 </code> </code>
-//Results://+//Results:// The [[global_properties|global property]] "keys" (a counter being used to track the number of keys collected) is incremented by one.
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Set Global Property** function to store and keep track of game-level information such as the current chapter/act of the story or the player's score.+Use the **Set Global Property** function to store and keep track of game-level information such as the current chapter/act of the storythe player's score, or other custom statistics.
 </WRAP> </WRAP>
  
set_global_property.txt · Last modified: 2021/04/21 18:51 by justin