Custom Cookie Replacement Tutorial

Custom Cookie Replacement Tutorial

Opening Notes

This guide assumes you have access to paint(.)net, which you can download here[www.getpaint.net] . Other image editors will suffice for the purposes of this guide, but the instructions here are tailored for paint(.)net specifically. I am not responsible for any errors or damage to save data that may have been caused by failure to properly follow the steps outlined in this guide.

Preparing Your Cookie


Custom Cookie Replacement Tutorial image 3
Custom Cookie Replacement Tutorial image 4
Custom Cookie Replacement Tutorial image 5

Before you start, you'll want a transparent PNG image of the cookie you'd like to put into the game. This can be a drawing that you've made, a cutout from a larger image, or even just a piece of clip art you got from Google searching '[thing] transparent PNG'. You're only limited by your creativity, however, the purpose of this guide isn't to tell you what to make, so we'll be using this stock image of a donut for now:

(Note: donut image courtesy of StickPNG)

Make sure that your transparent PNG is perfectly square, since the area defined for the clickable cookie in-game is square as well, and your cookie will appear stretched/compressed if your image's proportions don't match. If your transparent PNG isn't square to begin with, expand the image area such that the width and the height are equal and the image remains centered, as we do with our donut here:

Make sure to delete any white bars that appear as a result of the canvas expansion, and resize your image to 512x512 using the best available resampling preset in the image editor of your choice. (unless you're working with pixel art, in which case you'll want to use the nearest neighbor algorithm to avoid blurring when upscaling from a lower resolution)

Make a folder for your cookie mod at C:\Program Files (x86)\Steam\steamapps\common\Cookie Clicker\resources\app\mods\local\yourModName and save your image in the new folder as cookie.png. This is where you'll want to store all of your mod assets.

Adding A Drop Shadow


Custom Cookie Replacement Tutorial image 12
Custom Cookie Replacement Tutorial image 13
Custom Cookie Replacement Tutorial image 14
Custom Cookie Replacement Tutorial image 15
Custom Cookie Replacement Tutorial image 16
Custom Cookie Replacement Tutorial image 17

Congratulations - now that you have the cookie itself done with, it's time to add a drop shadow underneath it to give your mod a polished feel. Many cookie mods on the workshop neglect this step, and end up looking out-of-place as a result:

Luckily, the way to implement this effect is fairly straightforward. Using the magic wand tool, select all the transparent areas of your cookie like so,

and hit CTRL-I to invert your selection area such that it overlaps the non-transparent portion of your cookie:

Create a new layer for the drop shadow while deselecting the layer your cookie is on:

Fill the outline of the cookie with the color #2d2d2d by clicking Edit -> Fill Selection - we want to use a medium grey for the shadow, as black would look unnatural:

Next, we'll add a blur effect to make our shadow even more convincing, as if our cookie was being lit by a diffuse light source. (Effects -> Blurs -> Gaussian Blur) Play around with the blur radius until it feels just right:

Save your shadow in the same directory as your cookie as cookieShadow.png, and continue to the next step.

Mod Configuration

Create a new text file in Notepad, and replace the fields in parentheses with information relevant to your mod:

{ "Name": "(mod name)", "ID": "(modID)", "Author": "(your name)", "Description": "(mod description) This mod does not disable Steam achievements.", "ModVersion": 1, "GameVersion": 2.052, "Date": "(today's date in DD/MM/YYYY format)", "Dependencies": [], "Disabled": 0, "AllowSteamAchievs": 1 }

Make sure that your mod ID is something totally unique to avoid potential conflicts with other mods, (an easy solution is simply prefixing it with a unique identifier representing your username) save this file in your working directory as info.txt, and make a new file with the following block of code:

Game.registerMod("(modID)",{ init:function(){ Game.Loader.Replace('perfectCookie.png',this.dir+'/cookie.png'); Game.Loader.Replace('cookieShadow.png',this.dir+'/cookieShadow.png'); } });

Note that the (modID) field here *must* be exactly the same as the one in your info.txt, otherwise the game won't know where to find your image files. Save the above block of code as main.js.

Deploying Your Mod To The Workshop


Custom Cookie Replacement Tutorial image 32
Custom Cookie Replacement Tutorial image 33

Now that your cookie replacement mod is essentially complete, all that's left is to publish it to the Steam Workshop for others to enjoy. Cookie Clicker makes it easy and simple to upload your own mods, but we can't do that just yet without a thumbnail to show everyone what your mod adds to the game. Using the Windows snipping tool, take a roughly-square snapshot of your cookie (you don't have to get it exactly perfect) and resize it to 512x512 to meet the Steam Workshop's standards.

(Yes, I'm aware my cookie's shadow is clipped off at the edges; using a smaller blur radius can help with this issue)

Save your thumbnail as thumbnail.png in your project directory. With that out of the way, you're now all set to release your mod. Go to the options menu in Cookie Clicker and select Publish Mod, which is the very last button at the very bottom of the page, and select your mod folder, which should be in C:\Program Files (x86)\Steam\steamapps\common\Cookie Clicker\resources\app\mods\local if you've followed the first few steps correctly.

Good work - if you've made it to the end of this guide, you should have a nice, polished cookie replacement mod of your very own. Give yourself a pat on the back, and go eat some cookies (or donuts in this case) to celebrate. ^w^

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=3052762934					

More Cookie Clicker guilds