User Tools

Site Tools


data_files

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
Next revisionBoth sides next revision
data_files [2020/05/05 12:34] justindata_files [2020/05/05 13:20] justin
Line 57: Line 57:
 </code> </code>
  
-As another example, assume that we want to maintain a list of [[entity]] properties that will be assigned to a [[character]] at some point during the game. A file named "npc_properties.json" could be created in the data folder with the following contents (specifically an object with a set of key/value pairs as the root element).+As another example, assume that we want to maintain a list of [[entity]] properties that will be assigned to a [[character]] at some point during the game. A file named "npc_props.json" could be created in the data folder with the following contents (specifically an object with a set of key/value pairs as the root element).
  
 <code javascript> <code javascript>
Line 70: Line 70:
  
 <code bauxite> <code bauxite>
-for prop_name in data["npc_properties"] do +for key in data["npc_props"] do 
-   set_entity_property(entity["npc01"], prop_name, data["props"][prop_name])+   set_entity_property(entity["npc01"], prop_name, data["npc_props"][key])
 end end
 </code> </code>
  
 ~~NOTOC~~ ~~NOTOC~~
data_files.txt · Last modified: 2022/06/26 02:27 by justin