Duck Game

Duck Game

159 ratings
So, You Want To Make Hats?
By cami and 1 collaborators
Got an idea for a hat, but you don't know how to put it in the game? I'll tell you how to do it right here!
   
Award
Favorite
Favorited
Unfavorite
Disclaimer
Optimally, you should have some sort of experience with programming. You should have no problem if you just follow the instructions.
I will not accept friend requests to solve miscellaneous errors. It goes against my opinion of letting random people onto my friends list.
I offer no guarantee of support with making your mod. I provide this guide as assistance; I have done so in my free time and have not received compensation for my work. Any additional support is not my obligation.

In the chance I do decide to help, any requests for help due to errors must have their Mod.cs uploaded to http://pastebin.com/ , and the link to the pastebin pasted in your comment.
Getting started
Making hats for Duck Game is a relatively uncomplicated process. Instead of having you going off and trying to create a whole complicated mod for your hat/hat pack, in this tutorial we'll give you a template to make your hats from, and some best practices on how to implement your new hats.

To start off, navigate to the "C:\Users\[Your User Name]\My Documents\DuckGame\Mods" folder. This is where all of the mods you've created reside.

Create a new folder and call it something unique (no spaces permitted). Names like "Hat" and "HatMod" are probably too common and are bound to conflict with other hat packs, while a folder named "Hat Mod" is simply not permissable in this situation.

Next, download the following template:
http://puu.sh/jtojw/ddb4019245.zip
Alternate Download[mega.nz]
Extract this into the folder you've made.
Creating the Custom Content
Alright, so what do we have here?

The content folder contains the textures the game uses to make your mod. Inside I've included template.png, which is an outline of a duck when idling, one with it's mouth closed, and one with it's mouth open, as if it was quacking.


The template.png provided.

The second item in the folder, preview.png, is the preview of the mod. The game uses this when managing your mods as a little thumbnail for your mod.

For now, we're concerned with making a hat for Duck Game, aren't we? Open up template.png in an image editor of your choice.
I prefer MS Paint or Paint.NET for pixel work, but anything you like is fine.

An example of a finished hat design, made by my friend Mira.

Some things to consider when making a hat:
  • Anything that's the same color as the background (that bright magenta color) will appear transparent in the game.
  • You have a 32x32 space to work in when designing a hat.
  • Avoid designing a shirt for the hat, although necklaces are OK. They are hats after all, and the duck's torso squishes when he ducks, making any shirt you create misalign when crouching.
  • If you don't want to make a quacking animation for your hat, cut the image down to 32x32. The game will recognize to use the one image for both mouth closed and mouth open animations.
  • The game doesn't seem to support custom quacks or particle effects for new hats yet.

When you're done designing, save the file as a png in the "content" folder.
Use a name without any spaces.
Modifying the Code
We're almost there! Don't fire up Duck Game just yet; your game will crash and you'll probably complain about it until you actually read what I have to say next.

In your mod's folder, go into the "src" folder. You'll see Mod.cs, the configuration of how to add your new hats into the game. Open this up using a text editor; Notepad is fine, Notepad++ is better. If you're a coder, your favorite code-editor program will do.

I'll explain the components of this file:

[assembly: AssemblyTitle("Your hat pack name here")]
This is the name of your mod. Change "Your hat pack name here" to your mod's name.
You can say anything you want here, like "Bob's Awesome Hat Pack" or "John's Special Hat for Himself".

[assembly: AssemblyCompany("Your Name Here")]
This is your name! Change "Your Name Here" to anything you desire!
Use your real name, use your Steam name, use any nickname you like here!

[assembly: AssemblyDescription("Your description for your hat pack here")]
This is a tiny description for your mod. Duck Game displays this in the "manage mods" menu, and uses this in generating your workshop submission.

[assembly: AssemblyVersion("1.0.0.1")]
This is the mod's version number. You don't really need to change this, unless you find that versioning your submissions is important or something.

Once you've set all that, the next changes are a bit more complicated. I'll explain it using a picture:

What if you have multiple textures for multiple hats? Copy the Teams.cores.teams.Add... line and paste it into the line below. Change the details for Team name and texture name as needed.

Run into Duck Game and test out your hats! Adjust the textures as needed.
Uploading your Mod to the Workshop
So your mod looks good, you tested out your quack animation, and you're ready to upload your mod. How do you do that?

In the main menu of Duck Game, go to the top left of the screen, the options menu.

In the options menu, hit the Manage Mods option to view all of your mods.

Find your mod. At this point, it's a good time to review your thumbnail, your mod's name, the version number, your name as an author, and the description.

Once you've done that, click on your mod and press Upload; this will upload your mod to Steam Workshop for everyone to see!

What if you want to update a mod you've already uploaded?
In the same place where you found the "Upload" option, you will see Update instead; use that to update your mod.
Frequently Asked Questions
My game crashed when I try to launch it! My game opened up before, what gives?
If the crash is a result of an error of your mod, you'll find a log in your mod folder.


If you open this log in a text editor, it will divulge to you the location of your errors. I hope your errors are exclusive to typos; I don't know if I can help you with more complicated coding problems.

An example of an error log.

If you can't seem to fix the error, move the entire mod folder somewhere else so Duck Game can't load the mod, and you'll be able to play Duck Game just fine.

Can I make custom sounds or particles for my hat, like the Burger hat?
No one seems to have found a way of doing this yet. Perhaps stay tuned?
Conclusion
thanks you for look at my guide,
if you have nice suggestion or corrections please letting me know in the comments thank

- Kami Peppers



117 Comments
Aiden8rr 4 Sep, 2023 @ 6:37am 
Very well written guide!
Videogamer3108 8 Apr, 2023 @ 3:00pm 
Can it be done with particles and sounds? At the moment?
The Fox Lied 1 Aug, 2022 @ 6:24pm 
Thanks Bro!
I STAPLE TAPEWORMS ON MY 7 Oct, 2021 @ 4:22pm 
did the file location for mods change?
Juanpepe_II 19 Dec, 2020 @ 6:31pm 
Thanks for this tutorial, not joking I was searching for a tutorial of this for about 3+ hours because nobody explain how to upload to the workshop
Zloty_Diament (Golden_Diamond) 14 Dec, 2020 @ 7:02am 
Hello! I've made an upgrade to the standard Hat Modpack, that doesn't require having the mod enabled all the time AND doesn't require much code edits, pretty much only changing the Author's name:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2320604321
Blast Stratagem 11 May, 2018 @ 7:49am 
ATTENTION: For anyone who also wants to add an icon, Just put an image in the content area that is preferably 256 x 256 px, and make the name "preview". This will update the icon in the mods section. :steamsalty:
Pato 23 Apr, 2018 @ 12:01pm 
how i can modify the wing of the duck ?
ieToastie 22 Mar, 2018 @ 9:48pm 
.hat files are made by converting the .png file using external programs. There are certain .exe(s) that would do this for you, but most people use Quackhead, an online converter that's free to use. Just Google "Quackhead" and it should come up as the first result.
SauloTheMan 19 Sep, 2017 @ 11:42am 
I'd like to point out that, if your editing software supports alpha (transparency) you can delete the magenta area, and the game will also recognize colors with alpha on them.