ClipMod:Adding a project
Adding the project
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
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.