Cookie Clicker Script Extender (CCSE) (2024)

Current version : 2.035

CCSE is a modding framework for the game https://orteil.dashnet.org/cookieclicker/. On its own, it makes no changes to the game. Instead, it makes modding the game much easier.

The vanilla game has a couple mod hooks in it already. However, they are labelled as primitive and according to the changelog have been that way since they were introduced in 2014. This plus the innate silliness in having every add-on backup and replace the Game.UpdateMenu function led to the inspiration for this mod.

How to use it

If you want to make an add-on that uses CCSE, just put this line at the top of your mod:

if(typeof CCSE == 'undefined') Game.LoadMod('https://klattmose.github.io/CookieClicker/CCSE.js');

To wait for CCSE to finish loading before continuing to load your mod, frame your mod in this general style:

if(MyMod === undefined) var MyMod = {};if(typeof CCSE == 'undefined') Game.LoadMod('https://klattmose.github.io/CookieClicker/CCSE.js');MyMod.launch = function(){/**All the code you want to delay goes herePut "MyMod.isLoaded = 1;" somewhere within**/}if(!MyMod.isLoaded){if(CCSE && CCSE.isLoaded){MyMod.launch();}else{if(!CCSE) var CCSE = {};if(!CCSE.postLoadHooks) CCSE.postLoadHooks = [];CCSE.postLoadHooks.push(MyMod.launch);}}

What can you do with CCSE?

More like what can’t you do? Seriously, tell me if it can’t do something you want it to do. Just make an issue here.

CCSE puts mod hooks in most of the functions in the game, as well as adds some helper functions to make soem things a little easier. Here’s a quick and incomplete list of some of the features.

Menu functions

There are four separate hooks into Game.UpdateMenu.

Game.customMenuGame.customOptionsMenuGame.customStatsMenuGame.customInfoMenu

To use these, just push your menu function into the array you choose, like so:

Game.customMenu.push(MyMod.menuFunction);

Functions in the Game.customMenu will be called whenerver Game.UpdateMenu is called. The other three arrays are used when their particular menu is in focus (i.e. Game.customOptionsMenu functions are only called when the Options menu is open)

There are several functions in CCSE that make menu functions easier.

  • CCSE.AppendOptionsMenu(inp)
    • Accepts input of either string or html element. Appends {inp} to the Options menu.
  • CCSE.AppendCollapsibleOptionsMenu(title, body)
    • {title} must be a string, {body} can be either a string or html element. Appends {body} to the Options menu under a header with {title} as the text. The header has a button to hide {body}.
  • CCSE.AppendStatsGeneral(inp)
    • Accepts input of either string or html element. Appends {inp} to the General section in the Stats menu.
  • CCSE.AppendStatsSpecial(inp)
    • Accepts input of either string or html element. Appends {inp} to the Special section in the Stats menu.
  • CCSE.AppendStatsVersionNumber(modName, versionString)
    • Both inputs must be strings. Adds a line in the format “{modName} version : {versionString} after the Game version in the General section of the Stats menu.

An example of how these functions might be used:

Game.customOptionsMenu.push(function(){CCSE.AppendCollapsibleOptionsMenu(MyMod.name, MyMod.getMenuString());});Game.customStatsMenu.push(function(){CCSE.AppendStatsVersionNumber(MyMod.name, MyMod.version);});

Of course, MyMod.name, MyMod.version, and MyMod.getMenuString must be declared elsewhere in your add-on.

Saving data

If your mod or add-on has configuration choices or other data you’d like to persist between sessions, you’ll have to save it at some point and load it later. You could write your own functions for that, or you could let CCSE handle that for you. How?

CCSE.customSave.push(function(){CCSE.config.OtherMods.MyMod = MyMod.config;});CCSE.customLoad.push(function(){if(CCSE.config.OtherMods.MyMod) MyMod.config = CCSE.config.OtherMods.MyMod; else MyMod.config = {};// Do other things if you want});

This data gets saved very time the game is saved, and loaded every time the game is loaded. the CCSE section of the Options menu has buttons that let you export and import the custom save. If you desire to change the save manually you can use the following functions through the console:

CCSE.ExportEditableSave();CCSE.ImportEditableSave();

Custom upgrades, achievements, buffs, and buildings

CCSE has functions to ease the creation of the above game items.

  • CCSE.NewUpgrade(name, desc, price, icon, buyFunction)
  • CCSE.NewHeavenlyUpgrade(name, desc, price, icon, posX, posY, parents, buyFunction)
  • CCSE.NewAchievement(name, desc, icon)
  • CCSE.NewBuilding(name, commonName, desc, icon, iconColumn, art, price, cps, buyFunction, foolObject, buildingSpecial)
  • CCSE.NewBuff(name, func)

If you use these functions, CCSE will know to save the created items automatically, with no extrea effort needed. In addition, the following base game functions have been altered so CCSE will know to save the resultant items:

  • Game.TieredUpgrade
  • Game.SynergyUpgrade
  • Game.GrandmaSynergy
  • Game.NewUpgradeCookie
  • Game.TieredAchievement
  • Game.ProductionAchievement
  • Game.BankAchievement
  • Game.CpsAchievement

Miscellaneous functions

  • CCSE.MinigameReplacer(func, objKey)

Use this function to delay the execution of code to after a minigame has loaded, or run it immediately if the minigame already is loaded.

CCSE.MinigameReplacer(MyMod.AlterGrimoire, 'Wizard tower');
  • CCSE.AddMoreWrinklers(n)

Wrinklers are stored in an array. Use this function to add more.

  • CCSE.CreateSpecialObject(name, conditionFunc, pictureFunc, drawFunc)

Special objects are Krumblor and Santa in the bottom left corner. You can totally make your own.

  • CCSE.ConfirmGameVersion(modName, modVersion, version)
  • CCSE.ConfirmCCSEVersion(modName, modVersion, version)
  • CCSE.ConfirmGameCCSEVersion(modName, modVersion, gameVersion, ccseVersion)

Use any one of these to preform a version check before loading the code. If the expected version is different from the current version, it shows a prompt allowing the user to cancel loading the mod.

if(CCSE.ConfirmGameVersion(MyMod.name, MyMod.version, MyMod.GameVersion)) MyMod.init();

Demo mods

I made a few quick mods to show off the capability of CCSE and provide example code of some of its features.

Timer Widget

javascript: (function(){Game.LoadMod('https://klattmose.github.io/CookieClicker/CCSE-POCs/TimerWidget.js');}());

If any part of this reminds you of the Timer Bar in Cookie Monster, there’s a very good reason for that: large chunks of code were copied from Cookie Monster.

Provides examples of:

  • Creating a special object next to Krumblor and Santa
  • Displaying the version number in the Stats menu

Hurricane Sugar

javascript: (function(){Game.LoadMod('https://klattmose.github.io/CookieClicker/CCSE-POCs/HurricaneSugar.js');}());

This adds a Golden Cookie effect that briefly shortens the time for sugar lumps to ripen to 1 second.

Provides examples of:

  • Creating a buff
  • Altering sugar lump times when that buff is active
  • Making a Golden Cookie effect activate that buff
  • Letting Force the Hand of Fate pick the new buff
  • Syncing up Fortune Cookie to be able to predict if FtHoF will call up the new effect

Black Hole Inverter

javascript: (function(){Game.LoadMod('https://klattmose.github.io/CookieClicker/CCSE-POCs/BlackholeInverter.js');}());

This adds a new building and an appropriate amount of upgrades and achievments

Provides examples of:

  • Creating a building
  • Creating upgrades
  • Creating achievements

Compatibility

CCSE sinks its grabby hooks into a huge number of the game’s functions. I haven’t done extensive testing with every single Cookie Clicker add-on in existence, so I can’t give any definitives. Tell me of any conflicts you find and I’ll add them to the list.

  • CCSE must be loaded before Cookie Monster. (Load any mod that uses CCSE before Cookie Monster)

Bugs and suggestions

Any bug or suggestion should be opened as an issue in the repository for easier tracking. This allows me to close issues once they’re fixed.

Version History

05/16/2023 - (2.035)

  • Can now give ids to Headers

03/13/2023 - (2.034)

  • Added option to hide the CCSE version in the lower left of the screen
  • Added some hooks for the YouCustomizer functions
  • Fixed compatibility with Frozen Cookies
  • Added hook for Game.resize
  • Added hook for Garden.logic (for plant aging)

10/04/2021 - (2.031)

  • Fixed bug that was preventing custom buildings, upgrades, and achievements from being saved in some circ*mstances

09/26/2021 - (2.030)

  • Steam version: Will now initialize before other mods
  • Fixed getting permanent upgrades on a Born Again ascension
  • Fixed breaking Game.NewUpgradeCookie
  • Reset custom upgrades, achievements, etc. managed by CCSE on game reset even if the mod generating them isn’t loaded

09/18/2021 - (2.029)

  • Fixed upgrade descriptions breaking in localization
  • Added hooks for Game.crate and Game.crateTooltip
  • Custom links in the menu will now open in a browser rather than Steam
  • Changed Game.Loader.Load injection to detect ‘/’ instead of ‘http’

09/11/2021 - (2.028)

  • Added PasswordBox and CheckBox to MenuHelper
  • Added function to append custom CSS styles
  • Fixed bug in custom Background selector

09/09/2021 - (2.027)

  • Added support for custom images for the Pantheon and Grimoire
  • Added hooks for Steam.modsPopup
  • Added support for custom Golden cookie sound selector options
  • Added support for custom Milk selector options
  • Added support for custom Background selector options

09/01/2021 - (2.025)

  • Vaulting for custom upgrades no longer depends on mod load order
  • Setting custom upgrades as Permanent will no longer break the game if the Stats menu is opened without the mod loaded
  • Added some functions for commonly used menu items

02/06/2021 - (2.023)

  • Optimized the initialization code
  • Will now load in roughly a quarter of the time

11/01/2020 - (2.020)

  • Changed CCSE.save to CCSE.config
  • Incorporated new mod api from Cookie Clicker

10/22/2019 - (2.016)

  • Added hook for the new function Game.auraMult

05/14/2019 - parallel processing (2.015)

  • Won’t freeze the game while CCSE is loading
  • Also has a progress meter for feedback
  • Bug fixes

05/11/2019 - take two (2.003)

  • You know that moment where you do something and then immediately realize a better way to do it?
  • Changed the method for injecting code to standardized functions rather than calling “eval” willy-nilly
  • Added function for creating seasons
  • Created an update log, and put the version number in the lower left corner

05/05/2019 - initial release (1.0)

  • Added a bunch of mod hooks to the game
  • Added functions to ease the creation of content like achievements and buildings
  • Added a save system to manage game objects created through CCSE

Special thanks

Anyone who gives a suggestion or bugfix, especially code that gets implemented into CCSE, will be listed here along with their contribution.

  • klattmose
    • Writing this thing
  • Or0b0ur0s
    • Assisting in making CCSE less strenuous on computers with fewer resources
  • G lander
    • Suggested using the prototype functions for upgrades instead of the individual functions
  • EntranceJew
    • Multiple code suggestions

This site is open source. Improve this page.

Cookie Clicker Script Extender (CCSE) (2024)
Top Articles
Davenport West senior an entrepreneur in produce
AFI’s 100 YEARS…100 HEROES & VILLAINS
Rainbird Wiring Diagram
Displays settings on Mac
Globe Position Fault Litter Robot
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Günstige Angebote online shoppen - QVC.de
3472542504
Discover Westchester's Top Towns — And What Makes Them So Unique
Foodland Weekly Ad Waxahachie Tx
Immortal Ink Waxahachie
Daily Voice Tarrytown
Free Online Games on CrazyGames | Play Now!
Heart and Vascular Clinic in Monticello - North Memorial Health
Mc Donald's Bruck - Fast-Food-Restaurant
Brazos Valley Busted Newspaper
Talk To Me Showtimes Near Marcus Valley Grand Cinema
Low Tide In Twilight Ch 52
Mythical Escapee Of Crete
Piedmont Healthstream Sign In
6892697335
Paris Immobilier - craigslist
Wolfwalkers 123Movies
A Man Called Otto Showtimes Near Carolina Mall Cinema
1964 Impala For Sale Craigslist
Issue Monday, September 23, 2024
Jt Closeout World Rushville Indiana
Craigslist Dallastx
Slv Fed Routing Number
Sedano's Supermarkets Expands to Orlando - Sedano's Supermarkets
Teenage Jobs Hiring Immediately
Craigslist Albany Ny Garage Sales
Final Exam Schedule Liberty University
9781644854013
Claim loopt uit op pr-drama voor Hohenzollern
Check From Po Box 1111 Charlotte Nc 28201
Gun Mayhem Watchdocumentaries
Japanese Big Natural Boobs
Umiami Sorority Rankings
Clima De 10 Días Para 60120
Discover Things To Do In Lubbock
Hk Jockey Club Result
3500 Orchard Place
Caesars Rewards Loyalty Program Review [Previously Total Rewards]
Motorcycles for Sale on Craigslist: The Ultimate Guide - First Republic Craigslist
Stoughton Commuter Rail Schedule
Madden 23 Can't Hire Offensive Coordinator
Product Test Drive: Garnier BB Cream vs. Garnier BB Cream For Combo/Oily Skin
Makes A Successful Catch Maybe Crossword Clue
Campaign Blacksmith Bench
King Fields Mortuary
Gameplay Clarkston
Latest Posts
Article information

Author: Errol Quitzon

Last Updated:

Views: 6674

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Errol Quitzon

Birthday: 1993-04-02

Address: 70604 Haley Lane, Port Weldonside, TN 99233-0942

Phone: +9665282866296

Job: Product Retail Agent

Hobby: Computer programming, Horseback riding, Hooping, Dance, Ice skating, Backpacking, Rafting

Introduction: My name is Errol Quitzon, I am a fair, cute, fancy, clean, attractive, sparkling, kind person who loves writing and wants to share my knowledge and understanding with you.