Add a body part to your combatants to create a weakpoint.
Body parts are individual combatants that are part of another combatant. They can be added either directly in a combatant’s setup or added via battle AI or schematics in a running game. They’re placed on the game object of their parent combatant and will be removed from the game/battle when their parent combatant dies.
A body part has it’s own status and can be targeted individually as any other combatant. You can also set it up as an active or passive combatant, i.e. a body part can either use actions and participate in battle, or just serve as another target without doing anything.
When a body part is killed, it can inflict status changes on it’s parent combatant, e.g. add a status effect or change it’s status values. You can learn more about body parts in the combatant documentation.
In this tutorial, we’ll set up a simple weakpoint body part that’ll have just a small amount of health. Killing it will stun it’s parent combatant and also set it’s health to 1, bringing it close to death.
This tutorial is based on the 3D RPG Quickstart tutorial series, but you can use this for any kind of project.
Adding Weakpoint Combatant #
We’ll start with setting up the combatant for the weakpoint. As said, body parts are combatants.
The weakpoint will be used as a passive combatant, i.e. we don’t need to set up anything beside the health of the combatant.
Open the Makinom editor, navigate to Combatants > Combatants and add a new combatant.
Content Information #
- Name
Set to: Weakpoint
Prefab Settings #
We won’t use a prefab for this combatant, but you can use a combatant’s prefab even when using it as body part (more on that below when setting up the body part).
Status Settings > Status Value Settings #
We won’t use a status development and simply set up the health, ignoring all the rest of the status values. When not using status development or adding a start value for a status value, the status value will use the default start value defined in it’s settings (e.g. 1 for most of the status values in the tutorial project).
Start Values #
Click on Add Initial Value.
- Status Value
Select Max HP. - Start Value
Set to 5. - Set In
Select Value.
And that’s it for the body part. The rest is set up when adding it to a combatant.
Inventory & Equipment #
Body parts can also drop loot (and give experience) when killed. We don’t want that for this body part, so we’ll replace the default setup from the general settings with dropping nothing.
Start Inventory #
- Replace Default
Enable this setting.
Loot Settings #
- Replace Default
Enable this setting.
Battle Settings > Override Settings > Battle Animations #
We’ll override the default death animation, since our body part doesn’t need to animate it’s death. However, you can still use them if needed.
Click on Add Battle Animation.
- Action Type
Select Death.
No further settings needed, this’ll override it with not using a schematic to animate death.
Adding a Body Part #
With our body part combatant set up, we can now add it as a body part to other combatants.
I’ll add it to the Snake combatant, but the setup is the same for any combatant (except for where to place it, if you want to add it to a child object).
Select the Snake combatant and change the following settings.
Status Settings > Body Parts #
Body parts defined here (or in the general settings for all combatants) will be added to a combatant when it’s initialized, e.g. when spawned in battle or added to the player group.
Beside this, you can also add and remove body parts as part of a battle AI or schematic using Add Combatant Body Part and Remove Combatant Body Part nodes. This can e.g. be used to add or remove body parts as part of an ongoing battle, e.g. the weakpoint being exposed by a special attack or after the combatant’s health dropped below 50%, etc.
For our tutorial setup, we’ll just have the weakpoint available from the start.
Click on Add Body Part.
- Base Combatant
Select Weakpoint.
This is the combatant that’s used for the body part.
The default setup for a body part uses it as a passive combatant and doesn’t learn any abilities, adds nothing to the inventory, etc. – which is already set up as we need it. Let’s still take a look at the most important settings for this:
- Is Passive
Enable this setting.
The body part is passive and doesn’t participate in battle (i.e. it’s still available as target, but doesn’t use any actions). - Must Defeat
Disable this setting.
Killing the body part isn’t required to end the battle.
If the combatant’s parent combatant (i.e. the Snake in this setup) is killed, the body part will be removed in any case.
Game Object #
These settings define where or how the body part is spawned.
The body part can be added to a combatant’s game object in 3 ways:
- Parent
Simply adds the needed components to the parent combatant’s game object.
Using this requires to use a child object, otherwise the body part can’t be added (conflicts with the parent combatant on the game object). - Empty
Creates an empty game object and mounts it to the parent.
We’ll use this option. - Prefab
Spawns the body part combatant’s prefab and mounts it to the parent.
Also, keep in mind that the body part combatant’s death settings are also used, i.e. they define if a spawned prefab will be destroyed when the combatant dies.
As said, we’ll use the Empty option for the body part’s game object. This is the best way to not use a separate prefab for a body part but be independent of the child object’s rotation the body part is placed on.
- Body Part Object
Select Empty. - Child Object
Select Path. - Find Child
Set to: Head - Use Rotation
Disable this setting.
This’ll add the weakpoint to the snake’s head.
Death Status Changes #
These settings allow us to change the status of the parent combatant when the body part dies.
We’ll add a stun status effect and set the parent’s HP to 1.
- Remove On Death
Enable this setting.
This’ll remove the body part from it’s parent when it dies.
Click on Add Status Change.
- Change Type
Select Status Effect. - Change
Select Add. - Status Effect
Select Stun.
Click on Add Status Change again.
- Change Type
Select Status Value. - Status Value
Select HP. - Operator
Select Set. - Change In
Select Value. - Change Value
Select Value > Value.
Set the value to 1.
That’s all there is to adding a body part.
Save Changes #
And that’s it – click on Save Settings to save the changes.
Testing #
Hit play and go fight a snake.
The body part is available as a target.
Attacking it will most likely kill it in one hit, stunning the snake and dropping it’s HP to 1.
This is just a small example for using body parts, let your fantasy run wild on what you can do with them!