GDT.addResearchItem() - greenheartgames/gdt-modAPI GitHub Wiki
Add a custom research item to the game.
Parameters
Parameter |
Data Type |
Description |
research |
object |
The custom research item |
Example
GDT.addResearchItem({
id: "Swift Loading",
name: "Swift loading".localize(),
v: 4,
canResearch: function (company) {
return LevelCalculator.getMissionLevel('Level Design') > 5 // The 'Level Design' level has to 6 or higher
},
category: "Level Design",
categoryDisplayName: "Level Design".localize()
});
Research object
Member |
Data Type |
Description |
id |
string |
The unique identifier of the research item |
name |
string |
The display name of the research item |
v |
integer |
The technology level of the research |
pointsCost* |
integer |
The number of research points that the research item costs |
pointsCostAdjustment |
integer |
The offset from the points cost lookup table below |
duration* |
integer |
The time it takes (in milliseconds) to research the item. |
category |
string |
The category the research belongs to, must be: "Genera", "Dialogs", "AI", "Level Design", "Gameplay", "Engine", "Story/Quests", "Sound", "Graphic", or "World Design" |
categoryDisplayName |
string |
Almost the same as the normal category property, but this category your research will be placed when you create a custom engine |
canResearch |
function |
A function which returns whether or not the item can be researched |
complete |
function |
A callback function which is invoked once the item has been researched |
V value |
Points Cost |
Duration |
Dev Cost |
Engine Points |
Engine Cost |
1 |
10 |
8 |
20K |
10 |
10K |
2 |
15 |
10 |
40K |
15 |
30K |
4 |
40 |
12 |
120K |
30 |
50K |
6 |
80 |
14 |
180K |
40 |
100K |
8 |
100 |
16 |
400K |
80 |
140K |
10 |
150 |
20 |
600K |
120 |
180K |
12 |
250 |
25 |
1.2M |
200 |
350K |
14 |
300 |
30 |
1.6M |
300 |
500K |
Notes
- Bolded properties are required.
*
fields are required when v
is not provided (Must use Research.engineItems.push(research)
instead).
- The function for
canResearch
accepts the Company object as its first parameter.
- The function for
complete
accepts the Company object as its first parameter.