This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
data_files [2020/05/05 11:14] – justin | data_files [2021/04/21 20:15] – justin | ||
---|---|---|---|
Line 14: | Line 14: | ||
</ | </ | ||
- | You can then use the " | + | You can then use the " |
<code bauxite> | <code bauxite> | ||
for item_id in data[" | for item_id in data[" | ||
- | | + | |
- | end | + | end; |
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | <code bauxite> | ||
+ | for i in range(3) do | ||
+ | | ||
+ | end; | ||
+ | </ | ||
+ | |||
+ | <code bauxite> | ||
+ | give_item(data[" | ||
</ | </ | ||
Line 41: | Line 53: | ||
<code bauxite> | <code bauxite> | ||
for item in data[" | for item in data[" | ||
- | give_item(item[" | + | give_item(item[" |
- | end | + | end; |
</ | </ | ||
+ | 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 " | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You could then loop through the key/value pairs and assign each value to a property on the [[entity]]. | ||
+ | |||
+ | <code bauxite> | ||
+ | for prop in data[" | ||
+ | | ||
+ | end; | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |