Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:GameData/doc: Difference between revisions

From the Dyson Sphere Program Wiki
Content deleted Content added
Chorus (talk | contribs)
Add short description for GameData module
Tag: 2017 source edit
 
Chorus (talk | contribs)
Fix header
Tag: 2017 source edit
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Source data for this module is stored at [[Module:GameData/protosets.json]]
Source data for this module is stored at [[Module:GameData/protosets.json]]


= Exported Functions =
Templates that use this module can be found at [[:Category:GameData Templates]].

Each function in this module is exported twice: one as-is for use in templates, and once with a Direct suffix for use directly on pages using <nowiki>{{#invoke|GameData|functionDirect|...}}</nowiki>.

== recipesMaking ==

Arguments: Item Name

Print recipes making an item, given by name. This produces a full table with headers.

Example invocation:

<pre>{{#invoke:GameData|recipesMakingDirect|Sulfuric Acid}}</pre>

{{#invoke:GameData|recipesMakingDirect|Sulfuric Acid}}

== recipesUsing ==

Arguments: Item Name

Print recipes using an item as an ingredient. Output is separated into two full tables: recipes which create components, and recipes which create buildings. This is selected by the CanBuild property of the produced items.

Example invocation:

<pre>{{#invoke:GameData|recipesUsingDirect|Copper Ingot}}</pre>

{{#invoke:GameData|recipesUsingDirect|Copper Ingot}}

== itemRecipes ==

Arguments: Item Name

Print recipes making an item. This does not produce a full table, and is intended for use in ItemInfo boxes such as at [[Graphene/ItemInfo]].

== itemField ==

Arguments: Item Name, Field Name

Print a field from an item, with the field to print as an argument. You can look at [[Module:GameData/protosets.json]] and scroll down or search (Ctrl+F) to the ItemProtoSet to browse fields.

Example invocation:

<pre>{{#invoke:GameData|itemFieldDirect|Magnetic Coil|Description}}</pre>

{{#invoke:GameData|itemFieldDirect|Magnetic Coil|Description}}

<pre>{{#invoke:GameData|itemFieldDirect|Hydrogen|StackSize}}</pre>

{{#invoke:GameData|itemFieldDirect|Hydrogen|StackSize}}

Latest revision as of 03:16, 28 April 2024

Source data for this module is stored at Module:GameData/protosets.json

Exported Functions

Each function in this module is exported twice: one as-is for use in templates, and once with a Direct suffix for use directly on pages using {{#invoke|GameData|functionDirect|...}}.

recipesMaking

Arguments: Item Name

Print recipes making an item, given by name. This produces a full table with headers.

Example invocation:

{{#invoke:GameData|recipesMakingDirect|Sulfuric Acid}}
Recipe Building Replicator? Technology
4
6 s
6
8
4
1
1.2 s

recipesUsing

Arguments: Item Name

Print recipes using an item as an ingredient. Output is separated into two full tables: recipes which create components, and recipes which create buildings. This is selected by the CanBuild property of the produced items.

Example invocation:

{{#invoke:GameData|recipesUsingDirect|Copper Ingot}}

Components

Recipe Building Replicator? Technology
2
1 s
2
1
N/A
1
4 s
2
3
2
1 s
2
1
N/A
1
2 s
2
1
1
4 s
2
2
2
1
4 s
10
2
1
1 s
3
1
1.5 s
9
2
1
2 s
6
3
2
1
1
3 s
1
2

Buildings

Recipe Building Replicator? Technology
1
6 s
10
10
5
1
6 s
15
20
4
1
1
5 s
12
9
6
3

itemRecipes

Arguments: Item Name

Print recipes making an item. This does not produce a full table, and is intended for use in ItemInfo boxes such as at Graphene/ItemInfo.

itemField

Arguments: Item Name, Field Name

Print a field from an item, with the field to print as an argument. You can look at Module:GameData/protosets.json and scroll down or search (Ctrl+F) to the ItemProtoSet to browse fields.

Example invocation:

{{#invoke:GameData|itemFieldDirect|Magnetic Coil|Description}}

It is an extremely useful basic electromagnetic component.

{{#invoke:GameData|itemFieldDirect|Hydrogen|StackSize}}

20

🍪 We use cookies to keep session information to provide you a better experience.