-
Notifications
You must be signed in to change notification settings - Fork 0
Parameters
These are the variables that can be set in the "parameters" section of a bro's json file:
Variable Name | Type | Purpose |
---|---|---|
Sprite | String | Give a path to the main character sprite. |
GunSprite | String | Give a path to the gun sprite. |
SpecialIcons | String | Give a path to a sprite sheet for custom special icons. |
SpecialIconOffset | Vector2 | Specify the offset of the special icons. |
SpecialIconSpacing | float | Specify the horizontal space between special icons. |
Avatar | String | Give a path to a sprite for a custom avatar. |
GunSpriteOffset | Vector2 | Specify the offset the gunSprite should have. This is used for the death screen gun offset as well. |
BetterAnimation | bool | If true BroMaker will enable a lot of animation variables. |
Halo | bool | If true add the halo from Broffy. |
JetPackSprite | bool | If true add the missing jetpack sprite if a bro uses it. |
Many parameters support variants, allowing a single bro to have multiple different appearances that are randomly selected when spawning. To use variants, instead of providing a single value for certain parameters, you can provide an array of values.
The following parameters can accept either a single value (used for all variants) or an array of values (one per variant):
-
Sprite
- Main character sprite(s) -
GunSprite
- Weapon sprite(s) -
Avatar
- Character avatar(s) -
SpecialIcons
- Special ability icon sprite sheet(s) -
GunSpriteOffset
- Gun positioning offset(s) -
SpecialIconOffset
- Special icon positioning offset(s) -
SpecialIconSpacing
- Horizontal spacing between special icons
The variant count is automatically determined by the largest array in your parameters. By default, a variant is randomly selected when the bro spawns using the GetVariant()
method, which you can override in your custom bro class to implement your own selection logic. You can mix single values and arrays in your parameters - single values apply to all variants while arrays provide per-variant values. Additionally, you can call SwitchVariant(int variantIndex)
during game to change between variants, which is useful when variants represent alternate forms or transformations rather than just visual variations (like R.J. Brocready's human/Thing transformation).
Important: All variant parameters must have the same number of elements. For example, if you have 4 sprite variants, any other variant parameters must also have exactly 4 elements, or 1 element. For example, you can't have 4 sprites and 2 gun sprites. If you wanted to achieve this though, you could repeat each gun sprite twice to get up to 4 elements. Use single values for properties that should be shared across all variants.
{
"name": "MyBro",
"parameters": {
"BetterAnimation": true,
"Sprite": "sprite.png",
"GunSprite": "gunSprite.png",
"SpecialIcons": "special.png",
"Avatar": "avatar.png",
"GunSpriteOffset": {
"x": 0,
"y": -1
}
}
}
{
"name": "Brostbuster",
"parameters": {
"BetterAnimation": true,
"Sprite": ["sprite.png", "variants/sprite_venkman.png", "variants/sprite_spengler.png", "variants/sprite_zeddemore.png"],
"GunSprite": "gunSprite.png",
"SpecialIcons": "special.png",
"Avatar": ["avatar.png", "variants/avatar_venkman.png", "variants/avatar_spengler.png", "variants/avatar_zeddemore.png"],
"GunSpriteOffset": {
"x": 0,
"y": -1
},
"SpecialIconSpacing": 4
}
}
In this example:
- The bro has 4 variants (determined by the 4-item arrays)
-
Sprite
andAvatar
have different values for each variant -
GunSprite
,SpecialIcons
,GunSpriteOffset
, andSpecialIconSpacing
use single values shared by all variants
{
"name": "R.J. Brocready",
"parameters": {
"Sprite": ["sprite.png", "thingSprite.png"],
"GunSprite": "gunSprite.png",
"SpecialIcons": ["special.png", "thingSpecial.png"],
"Avatar": ["avatar.png", "thingAvatar.png"],
"GunSpriteOffset": [
{"x": 0, "y": 0},
{"x": -2, "y": 0}
],
"SpecialIconSpacing": [0, 4]
}
}
This creates 2 variants with different sprites, special icons, avatars, gun offsets, and icon spacing.
Cutscenes also support variants, allowing different intro animations for each bro variant. See this page for details on how to implement cutscene variants.
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.