Broforce

Broforce

Not enough ratings
[UPDATED] How to create a custom Bro. (modding)
By Gorzon
This guide aim to explain how to make a custom Bro through the mod BroMaker.

Remember the mod is still working on, there is bug and some part are not simplify.

https://github.com/Gorzon38/Bro-Maker/wiki
2
   
Award
Favorite
Favorited
Unfavorite
Requirements

If you want to know how Vanilla bros work, you can use dnSpy[github.com] to look through game's code.

1 - Create a Bro with a JSON file
Create the file

You have 2 possibilities to create the file
1. Create a file inside BroforceModsBroMakerStorageBros then change the extension to .json. Insert The following text inside
{ "name": "ExampleName", "characterPreset": "CustomHero", "parameters": {}, "beforeAwake": {}, "afterAwake": {}, "beforeStart": {}, "afterStart": {} }
2. Launch the game, inside on BroMaker GUI go to Create New Object tab, give a name to the file then click Create.

Little explication of the keys

inside the JSON you can find multiple keys, each key has a purpose.
* "name" is the name of the bro
* "characterPreset" is the "base" of the character. It can be a name of a vanilla bro or a custom preset such as "CustomHero" or "SwordHero"
* "parameters" can have some keys that BroMaker will load to make some parts easier. See Parameters[github.com]

Then you have before and after Awake/Start. They are called before or after, depending on what's in the name, the method Start[docs.unity3d.com] or Awake[docs.unity3d.com].
Inside them, you put the variable name and the value you desired to assign to it.
e.g.
{ [...] "beforeAwake": { "speed": 200 }, [...] }

Variables

To see what variable you can assign value, you can take a look at this page[github.com] which have most of the variable.
To find more you can use DnSpy[github.com] or RuntimeUnityEditor[github.com]

Handled types

  • bool : true or false
  • int : a number (e.g. 123)
  • float : a floating number (e.g. 12.345)
  • Enum Type : a string or an int (e.g. from BloodColor | Red or 0)
  • SpriteSM or Material or Texture or Texture2D : value is string which is the name of the file with the extension. The image should be located in the same folder as the JSON file.
  • Grenade or subclass of Grenade : value is string ; it's the name of the grenade. Names[github.com]
  • Projectile or subclass of Projectile : value is string ; it's the name of the projectile. Names[github.com]

Example
{ [...] "beforeAwake": { "speed": 150, // float "originalSpecialAmmo": 2, // int "canChimneyFlip": true, // bool "projectile": "Sniper", // Projectile "specialGrenade": "HolyWater" // Grenade }, [...] "afterStart": { "sprite": "Bronobi_anim.png" // Texture } }

Change a value of a variable class

Let's say you want to change the damage of a projectile, how do you do it ?
To navigate through variables, you need to place a . between the variable
e.g.
{ [...] "afterAwake": { "projectile.damage": 50 }, [...] }
So if you want to change the avatar sprite
{ [...] "afterStart": { "player.hud.avatar": "MyCoolAvatar.png" } }
2 - Load the bro in game
Our bro is ready to fight.
Once you are in a level, open the menu of BroMaker and click on the name of our new bro, then Load Bro.

Or go to the Settings tab then enable Automatic Spawn

Have fun !
Bro variables
See all Variables here[github.com].
Character SpriteSheet explain
TODO
Adding a Preset
TODO
Know issue
  • You can't take special ammo
  • You can't pilot the mech/tank
  • Player bubble is misplaced
3 Comments
N 9 Sep, 2023 @ 5:30am 
a valuable guide. thanks:steamthumbsup:
Wo0jin 21 Jul, 2023 @ 11:02am 
perfect, thanks!
nihilist52 3 Apr, 2023 @ 7:13pm 
this was Extremely helpful man. thanks