ClipMod:Adding a project: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Adding the project == <code>Project</code>s are made up of many different parameters and settings, all accessible via the <code>Mod.addProject</code> method. The <code>addProject</code> ''parameters'' are as follows: <pre> Mod.addProject(name: string, description: string, price: Requirements, requirement: Requirements, display: string, todo: (isStrat: boolean) => void) </pre> Each parameter, when broken down, can be interpreted as follows. The example provided is the..." |
m fix requirements example |
||
| Line 8: | Line 8: | ||
# <code>description: string</code>: The description below the visual name of a project, e.g. <code>"Pareto optimal solutions to all global conflicts. (+12 Trust)"</code> | # <code>description: string</code>: The description below the visual name of a project, e.g. <code>"Pareto optimal solutions to all global conflicts. (+12 Trust)"</code> | ||
# <code>price: Requirements</code>: The requirements to ''buy'' the project, e.g. <code>{"yomi": 15000, "operations": 30000}</code>. This is also automatically added to the title as subtext, i.e. how "World Peace" has "(15,000 yomi, 30,000 ops)" next to it. | # <code>price: Requirements</code>: The requirements to ''buy'' the project, e.g. <code>{"yomi": 15000, "operations": 30000}</code>. This is also automatically added to the title as subtext, i.e. how "World Peace" has "(15,000 yomi, 30,000 ops)" next to it. | ||
# <code>requirements: Requirements</code>: The requirements to ''view the project in the player's "Projects" section'', e.g. <code>{"projects": "projectButton29"}</code>. For "World Peace", the project depends on ''another'' project with the DOM ID <code>projectButton29</code>. ''This'' is the string used, '''not''' the index in the <code>projects</code> array. | # <code>requirements: Requirements</code>: The requirements to ''view the project in the player's "Projects" section'', e.g. <code>{"projects": ["projectButton29"]}</code>. For "World Peace", the project depends on ''another'' project with the DOM ID <code>projectButton29</code>. ''This'' is the string used, '''not''' the index in the <code>projects</code> array. | ||
# <code>display: string</code>: What to display in the console when the project is purchased, e.g. <code>"World peace achieved, +12 TRUST, global stock prices trending upward"</code> | # <code>display: string</code>: What to display in the console when the project is purchased, e.g. <code>"World peace achieved, +12 TRUST, global stock prices trending upward"</code> | ||
# <code>todo</code>: The function to run once your project is completed, e.g. <code>() => { trust += 12; stockGainThreshold += 0.01; }</code> | # <code>todo</code>: The function to run once your project is completed, e.g. <code>() => { trust += 12; stockGainThreshold += 0.01; }</code> | ||
Latest revision as of 12:49, 19 December 2025
Adding the project
[edit]Projects are made up of many different parameters and settings, all accessible via the Mod.addProject method. The addProject parameters are as follows:
Mod.addProject(name: string, description: string, price: Requirements, requirement: Requirements, display: string, todo: (isStrat: boolean) => void)
Each parameter, when broken down, can be interpreted as follows. The example provided is the vanilla "World Peace" project:
name: string: The title/name of a project, e.g."World Peace"description: string: The description below the visual name of a project, e.g."Pareto optimal solutions to all global conflicts. (+12 Trust)"price: Requirements: The requirements to buy the project, e.g.{"yomi": 15000, "operations": 30000}. This is also automatically added to the title as subtext, i.e. how "World Peace" has "(15,000 yomi, 30,000 ops)" next to it.requirements: Requirements: The requirements to view the project in the player's "Projects" section, e.g.{"projects": ["projectButton29"]}. For "World Peace", the project depends on another project with the DOM IDprojectButton29. This is the string used, not the index in theprojectsarray.display: string: What to display in the console when the project is purchased, e.g."World peace achieved, +12 TRUST, global stock prices trending upward"todo: The function to run once your project is completed, e.g.() => { trust += 12; stockGainThreshold += 0.01; }
The Requirements type
[edit]The parameters of type Requirements are paramount, since they control if the player can and when the player can buy your project. Requirements is a dictionary, and there are a few supported keys that can be checked against:
operations: number: Minimum operations.trust: number: Minimum trust.clipmaker_level: number: Number of AutoClippers.mws: number: Number of megawatt-seconds (HypnoDrones phase/phase 2 only).yomi: number: Number of yomi from Strategic Modeling.honor: number: Number of honor from battles (probe phase/phase 3 only).funds: number: Amount of dollars in Available Funds (pre-HypnoDrones phase/phase 1 only).projects: string[]: Array of project IDs, attainable from the DOM/Inspect Element when available to be purchased for from the corresponding entry in the globalprojectsarray'sidfield.custom: () => boolean): True/false value determined by a function.truemeans this requirement passes,falsemeans it fails the requirement.
All of these default to passing the requirement, so an empty Requirements type means that the project is available as soon as the Projects menu is unlocked.