Skip to content

[1.4.4] Boss Log Entry Mod Call

Sheepish Shepherd edited this page May 28, 2023 · 26 revisions

What is this?

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!

Examples

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.

Arguments

[1] Entry Type

string - The first argument needed is the message type, which determines what type of entry you are submitting. For bosses use LogBoss, for mini-bosses use LogMiniBoss, and for events use LogEvent.

[2] Mod Instance

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.

[3] Internal Name

string - For this argument, you are free to choose what internal name is assigned to your entry. For most cases, you will just use nameOf(MyNPCClassName) but for special cases and events you may decide to use the entry's name. The internal name you submit for your entry with solely be for your entry key. Your entry key can be used by other developers to submit mod-collaborative data to your entry. Vanilla entries have entry keys too!. Please note that internal names cannot contain spaces and must consist entirely of letter characters.

[4] Progression

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 the Progression Reference Guide for vanilla entry progression values and to learn how to access modded entry values.

[5] Localized Name

LocalizedText - Please provide your entries localized name so it can be displayed on the checklist as well as other parts of the mod and within logging. This argument no longer accepts string values.

[6] Boss ID / List of IDs

int or List<int> - Submit all necessary NPC ID numbers that is apart of you entry. Use ModContent.NPCType<>() to submit your ID(s). Most boss and mini-boss entries only require a single int to be passed, but for special cases or events where multiple NPCs must be added, please use a List<int>. NPCs that consist of multiple parts, such as Skeletron 's head and arms or how the Twins consist of Retinazer and Spazmatism. However, this should NOT include any minion-like NPCs such as Eye of Cthulhu servants. For event entries, the Boss Log will list off the NPCs by their banner item. Be sure to apply a banner to all your NPCs to have them be displayed.

[7] Downed Boolean

Func<bool> - Your entries should have a downed boolean assigned to them within a ModSystem class.* Your downed boolean must then be cast as a Func<bool> before being submitted as this would need to be checked at multiple points during gameplay, not just during the entry submission. An example of this is shown on ExampleMod.

*Note: It is up to the mod developer to properly set up saving and syncing for their downed booleans. ExampleMod has a good example of this.

[8] Spawn Info

LocalizedText - Your entries must provide a localized text of any and all ways to encounter your entry. You may want to provide additional info such as spawn items in the form of Chat Tags or any conditions that need to be met. Write the description out as simple or detailed as you think it needs to be; there's character limit!

[9] Additional Entry Data

Dictionary<string, object> (optional) - A dictionary of objects with string keys can be passed to add any additional data that isn't required to make an entry. BossChecklist will look through your dictionary for specific string keys to apply your data where needed. The keys can be applied in any order and not all of them have to be present. The current keys that are checked for are the following:

  • "availability"

Func<bool> - If you need to hide your boss for whatever reason, make a Func<bool> of the conditions that need to be met for this entry to be available. This can be useful for that are dependent on a condition, such as the Brain of Cthulhu only being available in crimson worlds. Be aware that users expect to be able to see all bosses in the checklist, and have the option to circumvent the availability check within their configs.

  • "spawnItems"

int or List<int> - Not all entries have spawn items, but if your entry happens to, use this key. This can include any items that are needed to spawn your entry. You may need to add multiple items such as how Golem requires both the Lihzahrd Altar and a Lihzahrd Power Cell to be summoned. The Boss Log will also automatically search for any crafting recipes you items may have and display them on the spawn info page, so you may want to submit this for you players to reference to.

  • "collectibles"

int or List<int> - If your entry has collectible items include the item IDs in a list. Collectible items are NOT your entry's loot. Entry loot is automatically fetched using the bestiary. Avoid including items such as weapons, armor, and other non-aesthetic items. However, if you feel that they can be considered a collectible because of their extreme rarity (such as the Terraprisma from the Empress of Light) feel free to do so. The following are fully recognized as collectible items:

  • Relics and Trophies

  • Masks

  • Music Boxes

  • Pet Items

  • "overrideHeadTextures"

string or List<string> - Head textures are searched for by looking through the NPC IDs provided and attempting to find any corresponding head types. There may be a case where you may not want this to automatically occur, such as when submitting an event or having an NPC with multiple head textures but you only want one to display. To remedy this, use this key and submit a list of texture paths and those textures will completely override the auto-generated ones.

  • "despawnMessage"

Func<NPC, LocalizedText> (advanced) - Despawn messages are NOT supported for event entries. BossChecklist has despawn message feature to signal players via chat when a boss has despawned and is no longer active. Mod developers can submit their own despawn messages using this key! Despawn messages are full customizable in terms of conditions, allowing unique messages to be displayed under multiple different circumstances. Here is an example of how this feature can be utilized:

// In this example, the despawn message will be "The boss laughs as it leaves the world" 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, if no conditions have been met, default to the generic despawn message.

Func<NPC, LocalizedText> ExampleDespawnMessage = delegate (NPC npc)
{
	if (Main.player.All(plr => !plr.active || plr.dead)) {
		if (npc.life > npc.lifeMax / 2) {
			// A despawn message if the boss despawns with more than half health
			return Language.GetText("Mods.YourMod.Path.To.DespawnMessage.ExtraExample");
		}
		else {
			// A despawn message when all players are dead
			return Language.GetText("Mods.YourMod.Path.To.DespawnMessage.PlayerDeath");
		}
	}

	// return your generic despawn message if no conditions are met
	return Language.GetText("Mods.YourMod.Path.To.DespawnMessage.Generic");
};
  • "customPortrait"

Action<SpriteBatch, Rectangle, Color> (advanced) - A portrait is auto-generated for you, but if it looks funky or you want to customize it to how you think it should look, your entry can include a custom drawing action. You will have free reign over the area within the rectangle provided. The color input is for detecting the mask status of progression mode for players who want to go through the game without knowing what's to come, which will render the texture completely black. For developers who don't know how to take advantage of this can use the following to submit an image for the portrait:

(This may not be exactly how you'll want it, but close enough to make adjustments for)

(SpriteBatch spriteBatch, 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));
	spriteBatch.Draw(texture, centered, color);
}
Clone this wiki locally