-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a Bro Via a JSON File
Alex Neargarder edited this page Feb 21, 2024
·
1 revision
There are 2 ways to create the file
- Create a file inside
Broforce\BroMaker_Storage
then change the extension to.json
. Insert The following text inside
{
"name": "ExampleName",
"characterPreset": "CustomHero",
"parameters": {},
"cutscene": {},
"abilities": {},
"beforeAwake": {},
"afterAwake": {},
"beforeStart": {},
"afterStart": {}
}
- Launch the game, inside of the BroMaker GUI, go to
Create New Object
tab, give a name to the file then click Create.
Inside the JSON there are multiple keys and values. Each has its purpose.
-
"name"
is the name of the bro -
"characterPreset"
is the "base" of the character. It can be the name of a vanilla bro or a custom preset such as "CustomHero" or "SwordHero" -
"parameters"
have keys that can be enabled or disabled to make some things easier to do. See Parameters -
"cutscene"
contains variables that control the cutscene that is played when you unlock the character. See Cutscenes -
"abilities"
: contains abilities to call at a certain moment. Example:
{
[...]
"abilities": {
"GrenadeThrow": ["UseSpecial"]
},
[...]
}
The grenade throw ability is going to be called when the player presses the special key/button.
-
"beforeAwake" "afterAwake" "beforeStart" "afterStart"
are called before or after the methods Start or Awake.
Inside them, you put the variable name and the value you want to assign to it.
e.g.
{
[...]
"beforeAwake": {
"speed": 200
},
[...]
}
To see what variables you can assign values to, you can take a look at this page which has most of the variables.
To find more you can use DnSpy or RuntimeUnityEditor
-
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
orMaterial
orTexture
orTexture2D
: 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 ofGrenade
: value is string ; it's the name of the grenade. Names -
Projectile
or subclass ofProjectile
: value is string ; it's the name of the projectile. Names
{
[...]
"beforeAwake": {
"speed": 150, // float
"originalSpecialAmmo": 2, // int
"canChimneyFlip": true, // bool
"projectile": "Sniper", // Projectile
"specialGrenade": "HolyWater" // Grenade
},
[...]
"afterStart": {
"sprite": "Bronobi_anim.png" // Texture
}
}
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"
}
}
If you have questions or need help with creating custom bros, you can join the Free Lives Discord Server and post your questions in the bf-mods channel.