-
Notifications
You must be signed in to change notification settings - Fork 24
[1.4] Boss Log Entry Mod Call
If you develop a mod with bosses, considering adding support via Mod Calls. We offer a mod call that you can use in Mod.PostSetupContent to automatically add your boss to the boss checklist and boss log. Users will be able to view all bosses and information about them at a glance. We also will provide support for other features in this mod such as the Boss Radar and Boss Records. Even if you only play with mods, considering asking any mod developers to add support if they haven't already and possibly redirect them to this page!
Here are some examples of mods integrating with Boss Checklist. If the instructions on this page confuse you, it might be helpful to read some real examples:
- ExampleMod - Shows adding one boss. This example is highly commented.
string
The first argument needed is what type of entry you are submitting.
For bosses use AddBoss
, for mini-bosses use AddMiniBoss
, and for events use AddEvent
.
Mod
A Mod instance will be necessary for logging and native support. Use this
if you are within your Mod class or use Mod
if in a ModSystem class.
string
This will determine what the name of your boss/miniboss/event will be displayed as. This supports localization keys, if you have one for your boss. A localization key can be submitted to show the name in the appropriate language. This also may be helpful if you boss has a different name than what it needs to be displayed as, such as 'The Twins'.
Note: If using a translation key for this argument, please insert a $
at the beginning of your key! It is needed to properly assign an internal name and boss key.
int
or List<int>
The NPC ID number(s) of your boss/event NPCs is needed. Use ModContent.NPCType<>()
to submit your ID(s). Bosses should also include any npc that is an extension of the boss, such as Skeletron's Arms or how the Twins consist of Retinazer and Spazmatism. If your entry in an event, the NPCs will be displayed as banners. [Example banner currently missing]
Note: Do NOT submit any NPCs that are considered minions (like the Eye of Cthulhu's servants) as they may potentially break other features provided by BossChecklist.
float
Determine what part of the game you boss should be fought at and how difficult is it to fight compared to other bosses. Is it a pre-hardmode boss? Should it be fought after Plantera? Use these numbers as a reference to vanilla boss progression: Vanilla Progression Values List
Func<bool>
All bosses should have a downed boolean within you ModWorld class. This argument should be a delegate cast as a Func (Func<bool>)(() => ModdedWorld.downedWolfBoss)
as this would need to be checked at multiple points in the mod, not just during the entry submission. Proper saving and syncing of the downed bool is up to your mod to implement. Follow tModLoader's ExampleMod if you do not know how to do that.
Func<bool>
If you need to hide your boss for whatever reason, make a Func of the conditions need to be met for this boss to be available. If your boss should always be visible on the checklist, just use () => true
for this argument. Otherwise, this can be useful for secret bosses or bosses that are dependent on a condition, such as the Brain of Cthulhu only being available in crimson worlds. Be aware that users usually expect to be able to see all bosses in the checklist, and have the option to circumvent the availability check.
int
or List<int>
This should include the item IDs of any collectibles that are tied to your boss. Examples include relics, trophies, masks, music boxes, and pet items. You can add any special items that your boss will have, but refrain from using weapons, armor, and other non-aesthetic items.
int
or List<int>
Any items that spawn your boss will go into this next argument. Similar to Boss IDs, you can pass a single integer, or pass in a list of integers if your mod contains multiple spawning items.
string
(optional)
You may want to provide additional info to how your boss naturally spawns or the conditions that have to be met in order to fight it. Make it as simple OR descriptive as you think it needs to be. This supports localization keys. Chat Tags are also supported in this argument.
string or Func<NPC, string>
(optional)
Note: If registering an event, skip this argument. Despawn messages are not support for events and should be handled on your mod's end.
Consider submitting a custom despawn message for your boss! This message only appears once a boss despawns, whether its killed all players or not. For more complex despawn messages, a Func<NPC, string> is provided, allowing you customize what conditions need to be met in order to get a specific message. This supports localization keys.
// In this example, the despawn message will be "The boss laughs as it leaves {Main.worldName}" if all players are dead and the boss's health was above half.
// The despawn message will be "The boss has left" if all players are dead and the boss was below half health.
// Finally, the despawn message will the translation key if not all players were killed when it despawns.
Func<bool> AllPlayersAreDead = () => Main.player.All(plr => !plr.active || plr.dead);
Func<NPC, string> message = npc => AllPlayersAreDead() ? (npc.life > npc.lifeMax / 2 ? $"{npc.FullName} laughs as it leaves" : "The boss has left") : $"Mods.MyModName.BossName.BossDespawnMessage";
Action<SpriteBatch, Rectangle, Color>
(optional)
For advanced modders, your entry can include custom drawing for your Boss's portrait. You will have free reign over the area within the rectangle. The color input is for the Blind Mode (Boss Silhouettes) masking for people who want to go in blind, which will render a texture completely black. This is completely optional and not using it will auto-generate an image for you. If the auto-generated image looks off or doesn't work and you are not sure how to use this, you can use and modify this example with a provided texture:
(SpriteBatch sb, Rectangle rect, Color color) => {
Texture2D texture = ModContent.Request<Texture2D>("Texture/File/Path/Here").Value;
Vector2 centered = new Vector2(rect.X + (rect.Width / 2) - (texture.Width / 2), rect.Y + (rect.Height / 2) - (texture.Height / 2));
sb.Draw(texture, centered, color);
}
(This won't be exactly how you'll want it, but close enough to make adjustments for)
string
or List<string>
(optional)
Normally, head textures are found by looking through the NPC IDs and attempting to find any corresponding head types. There may be a case where modders would not want this to automatically occur, such as creating an Event where there are no heads to find or having an NPC(s) with multiple head textures but you only want one to display. Submit a list of texture paths and the textures will be displayed instead. Head textures are displayed right to left, so be sure to set up your list to show the heads in the order you desire.