Parameters - Gorzontrok/Bro-Maker GitHub Wiki
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. |
Parameter Variants
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.
Parameters That Support Variants
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
How Variants Work
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.
Examples
Single Variant (Standard)
{
"name": "MyBro",
"parameters": {
"BetterAnimation": true,
"Sprite": "sprite.png",
"GunSprite": "gunSprite.png",
"SpecialIcons": "special.png",
"Avatar": "avatar.png",
"GunSpriteOffset": {
"x": 0,
"y": -1
}
}
}
Multiple Variants
{
"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)
SpriteandAvatarhave different values for each variantGunSprite,SpecialIcons,GunSpriteOffset, andSpecialIconSpacinguse single values shared by all variants
Mixed Arrays and Objects
{
"name": "R.J. Brocready",
"parameters": {
"Sprite": ["sprite.png", "thingSprite.png"],
"GunSprite": "gunSprite.png",
"SpecialIcons": ["special.png"], ["thingSpecial.png"](/Gorzontrok/Bro-Maker/wiki/"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.
SpecialIcons with Multiple Ammo Types
SpecialIcons supports an additional format that the other variant parameters don't. If your bro has a special that uses multiple types of ammo (each with a different icon), you can provide an array of icon paths for a single variant. This gives each ammo slot its own icon rather than using the same icon for all of them.
There are three formats you can use:
Single icon for all ammo slots:
"SpecialIcons": "special.png"
Multiple icons per ammo slot (one variant):
"SpecialIcons": ["ammo1.png", "ammo2.png", "ammo3.png"]
Each file becomes a separate icon for each ammo slot, so the first ammo slot would show ammo1.png, the second ammo2.png, etc.
Multiple variants, each with multiple icons per ammo slot:
"SpecialIcons": ["ammo1.png", "ammo2.png"], ["alt_ammo1.png", "alt_ammo2.png"](/Gorzontrok/Bro-Maker/wiki/"ammo1.png",-"ammo2.png"],-["alt_ammo1.png",-"alt_ammo2.png")
The outer array is one entry per variant, and the inner arrays are the icons for each ammo slot within that variant.
If you only have one icon per variant but still want different icons per variant, you still need to use the nested array format:
"SpecialIcons": ["special.png"], ["thingSpecial.png"](/Gorzontrok/Bro-Maker/wiki/"special.png"],-["thingSpecial.png")
This is because a flat array like ["special.png", "thingSpecial.png"] would be interpreted as two ammo slot icons for a single variant, not two variants with one icon each.
Cutscene Variants
Cutscenes also support variants, allowing different intro animations for each bro variant. See this page for details on how to implement cutscene variants.