Help:Adding a New Modification

From Blaseball Wiki

Adding a new modification is a little more straightforward than it used to be, particularly if you have access to the source code.

Getting Modification Information

First, you will need the following information:

  1. Modification name (NAME)
  2. Description (DESCRIPTION)
  3. Background colour (BACKGROUND_COLOR)
  4. Icon colour (ICON_COLOR)
  5. Name of the icon in game-icons.net (GAMEICON_NAME)
  6. Duration of effect (only needed for the last two steps) (DURATION)

If, for whatever reason, the icon isn't from game-icons.net, you may have to do this the old fashioned way-- saving the SVG. Ask for help in the wiki Discord about this.

This guide could tell you how to use browser tools/inspecting JS/etc. to grab the icon name from game-icons.net, but honestly: it is often faster to either (a) go to the website and search based on the image or (b) look at the blaseball diffs and see what icons are new in 2.js. (If somebody would like to update this guide for doing this the proper way, please do go ahead!)

There are a few ways to grab the colours, such as inspecting element if a player/team already has the attribute. The most likely easiest way is by checking Astrid's blaseball diff repo. This creates a JSON file that should have the information for each modification.

Updating the Modification Icon Template

You'll next need to update the icon template with the new values. Add a new row that will look this:

|NICKNAME={{#hashinclude:modHash|iconColor=ICON_COLOR|backgroundColor=BACKGROUND_COLOR|icon=GAMEICON_NAME}}

NICKNAME can be whatever you want, as long as you're consistent in usage. You can add an alias for the nickname by adding a row above it like so:

|ALIAS
|NICKNAME={{#hashinclude:modHash|iconColor=ICON_COLOR|backgroundColor=BACKGROUND_COLOR|icon=GAMEICON_NAME}}

Updating the Modification Template

Add a new row to the Template:Modif modification with the relevant information. If you've followed the steps above, it usually looks like this:

| NICKNAME = {{Modification_Icon|name=NICKNAME|duration=DURATION}} NAME

Duration can be one of [game, week, season, permanent, item, armor] (I admit the last two aren't durations...)

NAME is shown in the infoboxes, so make sure your spelling is correct!

Updating the Modification Table

Add a new row to the Modifications table with the relevant information. It usually looks like this:

|- style="text-align:center;"
|{{Modification_Icon|name=NICKNAME|size=40}}
|'''NAME'''
|[Team or Player]
|DESCRIPTION
|DURATION
|[Put the cause of the modification here. Often it's an election...]