How to create a custom Bro. (modding)

How to create a custom Bro. (modding)

Requirements

Basic knowledge of programming C#

The mod BroMaker[www.nexusmods.com]

How to do a mod for Unity Mod Manager (the guide)

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

1 - Create The Custom Bro


How to create a custom Bro. (modding) image 6

First create a very simple mod and add BroMaker to dependencies .

In your Visual Studio project, create a new derived class (Name it like you want) of BroBaseMaker.

Like this :

Then override the method bm_SetupBro.

Before calling the base method of bm_SetupBro, assign the material of the character, gun, avatar and ammo.

public override void bm_SetupBro(Player player) { this.bm_DefaultMaterial = BroMaker.CreateMaterialFromFile(Path of the body file ); this.bm_DefaultGunMaterial = BroMaker.CreateMaterialFromFile(Path of the gun file ); this.bm_avatarMaterial = BroMaker.CreateMaterialFromFile(Path of the avatar file ); this.bm_ammoMaterial = BroMaker.CreateMaterialFromFile(Path of the ammo file ); base.bm_SetupBro(player); } You can also use a custom shader if you want for the material.

BroMaker.CreateMaterialFromFile(Path of the file , shader)

If you want to use the material from an existing character, you can use the HeroController.GetHeroPrefab method to get it. (explain later)

If you don't have a material for something, leave the variable empty.

Great, we did half of the job ! Now we need to give our new bro a projectile and a grenade and do some little fix.

Now, we override the method Awake. Before the call of the base method, we assign the number of ammo we have and the fire rate..

protected override void Awake() { originalSpecialAmmo = 3; // Leave the number you want. (minimum is 0; Maximum is 6) fireRate = 0.10f; // interval time between shoot base.Awake(); }

For the grenade and the projectile, we need to do this in the Start method. Override it, and add after or before the base method the grenade and the projectile.

protected override void Start() { base.Start(); Rambro rambro = HeroController.GetHeroPrefab(HeroType.Rambro) as Rambro; BrodellWalker brodellWalker = HeroController.GetHeroPrefab(HeroType.BrodellWalker) as BrodellWalker; Projectile projectileRambro = Projectile.Instantiate(rambro.projectile, rambro.projectile.transform); // Don't forget to do this or you will get bugs projectile = projectileRambro; specialGrenade = brodellWalker.specialGrenade; }

The HeroController.GetHeroPrefab method, like it said, get the hero/bro prefab. With this you can access to everything from a bro.

We finish our Custom Bro !

But we need to inform BroMaker we have one. In the load method of Main class, add

new NewBroInfo(typeof(class of the bro), Name of the bro);

2 - Load The Bro In Game


How to create a custom Bro. (modding) image 26

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.

Have fun !

Bro Variable

Variables that you can change while creating the bro. They are showned with their default value

Every variables/methods with a 'bm_' before are BroMaker variables/methods

canGib = true; canWallClimb = true; // If false, you still climbing but the animation is messed up canPushBlocks = true; canDash = true; canLedgeGrapple = false; breakDoorsOpen = false; canBeCoveredInAcid = true; canBeStrungUp = false; JUMP_TIME = 0.123f; // The time you can hold jump for jumping. Be careful adding a small number can really increase time. speed = 110.0f; // Speed of the bro. maxFallSpeed = -400f; // The speed for falling when he is in the air. fireRate = 0.0334f; // The time between each bullet. fireDelay = 0.0f; // the delay between press fire and the bro fire. Example on Brominator. _jumpForce = 260f; // Jump height. health = 3; // Don't change it value to stay as the same difficulty. // Animation useNewPushingFrames = false; // Custom animation when pushing something. The gun stay reverse after pushing the block. useNewLadderClimbingFrames = false; // Custom climbing frame that isn't use for bro. Some sprite are missing. useLadderClimbingTransition = false; // Do nothing, still missing Enter and Exit frame on the ladder. Because they don't exist. useNewLedgeGrappleFrames = false; // Better animation who belong '.canLedgeGrapple' useDashFrames = true; // Already enabled. If false, your character will just be faster and look like it slide on the ground. useDuckingFrames = true; // Already enabled. If disable you will not see your bro ducking. canDoIndependentMeleeAnimation = false; // Don't know how it works bloodColor = BloodColor.Red; // Change the blood color when hit or gib. bloodCountAmount = 80; // The number of blood square which spawn on death. deathSoundVolume = 0.4f;

Here's the variable where BroMaker change their value.

canChimneyFlip = true; // Do the things when you catch a ledge. !! Glitch if disable. !! doRollOnLand = true; // Do roll on land when it fall from far. !! Glitch if disable. !! canHear = true; canCeilingHang = true; meleeType = MeleeType.Knife; // You can change the value to the one you want. You need to do the method if you change the melee type. // Better animation. useDashFrames = true; useNewFrames = true; useNewDuckingFrames = true; useNewThrowingFrames = true; useNewKnifingFrames = true; useNewKnifeClimbingFrames = true; isHero = true; health = 1;

BroMaker variable

bm_DefaultGunMaterial; Material bm_avatarMaterial; Material bm_ammoMaterial; bm_secondMaterial; bm_secondGunMaterial; bm_bulletShell; // Shrapnel which are drop while firing bm_IsInGame = false; // Unused bm_originalSpeed; bm_fireCount; // Count the number of shot if you want. bm_ProjectileXRange = 400f; // Change the range of the projectile.

Character SpriteSheet Explain

TODO

Know Issue

You can't take special ammo

Freeze the faces huggers

You can't flex

Their is probably more. let me know if you find one.

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=2738232988					

More Broforce guilds