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 revisionBoth sides next revision
data_files [2021/04/21 20:17] justindata_files [2022/06/26 02:26] justin
Line 14: Line 14:
 </code> </code>
  
-You can then use the "data" syntax to reference the filename (minus the .json extension) and access its data from a [[script]]. In our example, you could use this syntax along with a [[script_syntax|For loop]] to give each [[item]] to the player from your game's [[startup script]].+You can then use the "data" syntax to reference the filename and access its data from a [[script]]. In our example, you could use this syntax along with a [[script_syntax|For loop]] to give each [[item]] to the player from your game's [[startup script]].
  
 <code bauxite> <code bauxite>
-for $item_id in data["start_items"] do+for $item_id in data["start_items.json"] do
    give_item($item_id);    give_item($item_id);
 end; end;
data_files.txt · Last modified: 2022/06/26 02:27 by justin