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:13] – justin | data_files [2022/06/26 02:26] – 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 40: | Line 52: | ||
<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~~ |