Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon authored Aug 3, 2024
1 parent 6ecb7ce commit 78b0cc2
Showing 1 changed file with 47 additions and 70 deletions.
117 changes: 47 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,49 @@
[![Release](https://github.com/fgardt/factorio-mod-template/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/fgardt/factorio-mod-template/actions/workflows/release.yml)
[![Release](https://github.com/notnotmelon/fluid-memory-storage/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/notnotmelon/fluid-memory-storage/actions/workflows/release.yml)
<!-- ^======[REPLACE THIS]======^ ^======[REPLACE THIS]======^ -->

# factorio-mod-template

A small Factorio Mod template which also contains GitHub Actions for automatic changelog generation, packaging and releasing to the [Factorio Mod Portal](https://mods.factorio.com)

# How it works

This template uses [semantic-release](https://github.com/semantic-release/semantic-release) to automate the changelog generation aswell as packaging and releasing the mod. \
Changelog generation is done with [this preset](https://github.com/fgardt/conventional-changelog-conventionalcommits-factorio) while packaging and releasing is done with [this plugin](https://github.com/fgardt/semantic-release-factorio). \
Additionally the GitHub Action will also create a release in your repository on GitHub itself.

Once you push new commits to the main branch the release action will trigger. \
First it scans all your commit messages to figure out what the new version should be and what to put into the changelog. \
To make this possible you need to use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).

| Commit type | Changelog section |
| --------------------------- | ----------------- |
| `feat` or `feature` | `Features` |
| `fix` | `Bugfixes` |
| `perf` or `performance` | `Optimizations` |
| `compat` or `compatibility` | `Compatibility` |
| `balance` | `Balancing` |
| `graphics` | `Graphics` |
| `sound` | `Sounds` |
| `gui` | `Gui` |
| `info` | `Info` |
| `locale` | `Locale` |
| `translate` | `Translation` |
| `control` | `Control` |
| `other` | `Changes` |

Because a push to the main branch triggers the release action it is recommended to work on a separate branch until your work is done and then merge that branch into main to release it. \
_Or you just work locally and if you want to release you push your changes to main, up to you how you want to do it ;)_

# How to use

## Repository setup

Click the `Use this template` button and create your own repository.

Once you have your new repository you need to add a Factorio token as a GitHub Actions secret so that the mod releasing can work. \
To get the token go to [Factorio's website](https://factorio.com/login) and login with your account. \
Then you need to go to your [profile](https://factorio.com/profile) and generate a new API key. \
The API key needs `Upload Mods`, `Publish Mods` and `Edit Mods` permissions. Copy the generated key.

Now you need to go to your repository settings > `Secrets and variables` > `Actions` and add a new Repository secret called `FACTORIO_TOKEN` with your copied key as the secret.

## Mod setup

- Swap out the [`LICENSE`](LICENSE) to your own liking _**(especially change out my name for yours)**_
- Populate the [`info.json`](info.json) file with correct values _(the `version` field gets updated automatically)_
- Add the corresponding text into [`locale.cfg`](locale/en/locale.cfg)
- Add a `thumbnail.png` to the root of the repository _([ideally 144x144px](https://wiki.factorio.com/Tutorial:Mod_structure#Files))_

# Misc

## How the packaging works

The [`semantic-release-factorio` plugin](https://github.com/fgardt/semantic-release-factorio) uses the `git archive` command to package the mod. \
That way you can specify what folders / files to exclude from your packaged mod by specifying them in [`.gitattributes`](.gitattributes).

If you want to locally test packaging of your mod you can run the following command:
```sh
git archive --format zip --prefix [YOUR-MOD-NAME]/ --worktree-attributes --output [YOUR-MOD-NAME]_[VERSION].zip HEAD
```

## Need help?

Checkout the [official Factorio Discord](https://discord.gg/factorio) and check the pins in the `#mod-making` channel. \
There is also the [Lua API documentation](https://lua-api.factorio.com/latest/) and the [modding section in the wiki](https://wiki.factorio.com/Modding).
### Adds a container that can store an infinite amount of any fluid

Graphics from kaueNP
Compatible with all mods
Packed unit graphic from calcwizard's Packing Tape (MIT). https://mods.factorio.com/mod/packing-tape

![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Packed units
Q: What happens when a unit is broken? Are my fluids lost?

A: Fluids are not lost. Fluids are "packed" inside the item and are recovered when you place the unit back down.
![](https://i.imgur.com/U5drgmQ.png)
Warning: If a fluid unit is destroyed (biters, nuke, or otherwise) then you will NOT get a packed unit and your items will be lost!
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Power
The fluid unit requires power to function!
The power usage is equal to:
1MW + (ceil(fluid amount / 1000) ^ 0.35) * 300kW
This can be changed in mod settings

If it runs out of power, then it will not accept any more fluids until it gets power again.

![](https://i.imgur.com/W2Qxm3F.png)
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Circuits
Memory units can connect to the circuit network! Simply attach a red or green wire to the circle on the top of the container.
This will read both the type and amount of whatever you have stored in the unit.

Circuit signals in Factorio can only go up to 2147483647. If you happen to have more items than this stored in a memory unit, then the signal will still only display as 2.1G.
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### UPS
This mod is optimized. Should have a very minor impact on your UPS.
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Graphics
The color of the unit is based on the fluid inside!
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Custom GUI
Fluid units have a custom gui as of v1.4.0!
![](https://i.imgur.com/g9BwpM0.png)
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)
### Addon
This mod is the official add-on to the Memory Storage mod, but they can work separately if you don't need both.
https://mods.factorio.com/mod/deep-storage-unit
![](https://mods-data.factorio.com/assets/4b89c9d3e7ae1cbb8457f0ae75444976ee64570f.png)

### [> Check out my other mods! <](https://mods.factorio.com/user/notnotmelon)

0 comments on commit 78b0cc2

Please sign in to comment.