The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

[AB+|Rep(+)] External Item Descriptions
This topic has been locked
Wofsauge  [developer] Jan 4, 2018 @ 10:04am
(Depricated) [How to] API & Adding Modded item descriptions
API Functions
EID:isDisplayingText()
This returns True if a Description is currently displayed.

EID:getTextPosition()
This returns a Vector of the x and y position at which the descriptions are displayed.

EID:getLastDescribedEntity()
This returns an Entity object of the last entity that was described. If EID is currently displaying a description, this will return the currently displayed entity.

--------------------------------------------------------------------------------

Adding Modded item descriptions

This tutorial will show you how to add new descriptions to this mod. This method supports Collectibles, Cards, Trinkets and Pills.

---------------------------------------------------------------------

Basics

EID features four global tables for mods to define their descriptions:
__eidTrinketDescriptions for trinkets
__eidCardDescriptions for cards
__eidPillDescriptions for pills
__eidItemDescriptions for Collectibles / items
__eidItemTransformations to assign Transformationinformation to a collectible
__eidEntityDescriptions for entities


Adding an entry to either of those tables will add that description to the mod.

An entry exists of an itemid and a description. Descriptions are simple Strings, where a '#' represents the start of a new line.

You can also assign new Descriptions & Transformations to vanilla items. This works the same way modded items get their descriptions.


Example 1

To add the item "My Item Name" and the Description "Most Fitting Description" do something like this:

local item = Isaac.GetItemIdByName("My Item Name"); if not __eidItemDescriptions then __eidItemDescriptions = {}; end __eidItemDescriptions[item] = "Most Fitting Description";

Add this code into the "main.lua" file of the mod thats responsible for the item.

Result:
- Most Fitting Description

Example 2: Draw multiple descriptions for one item

A '#' can be used to start a new line on the description. Usage is simply like this:

__eidItemDescriptions[item] = "Line 1#Line 2#Line 3";

Result:
- Line 1 - Line 2 - Line 3

Add Custom transformations
To add custom Transformationinformations, just do something like this:

local item = Isaac.GetItemIdByName("My Item Name"); if not __eidItemDescriptions then __eidItemDescriptions = {}; end __eidItemDescriptions[item] = "Most Fitting Description"; if not __eidItemTransformations then __eidItemTransformations = {}; end __eidItemTransformations[item] = "Test Transformation";
Result:
Test Transformation (Text in blue) - Line 1 - Line 2 - Line 3


Explaination:

Find the ID of your item
local item = Isaac.GetItemIdByName("My Item Name");
Make sure we're not adding to an empty table
if not __eidItemDescriptions then __eidItemDescriptions = {}; end
Add the description
__eidItemDescriptions[item] = "Most Fitting Description";


Example 3: Entities
You can add descriptions to any kind of entity. You can use the table __eidEntityDescriptions for entities.You can define your Headline and the description yourself. Just remember that the syntax for entites is a bit different than for pickup descriptions.

if not __eidEntityDescriptions then __eidEntityDescriptions = {}; end __eidEntityDescriptions["ID.Variant.Subtype"] = {"HEADLINE","DESCRIPTION"}

Result:
HEADLINE - DESCRIPTION

Example 4: Dynamic descriptions for anything

To assign a unique description for a specific entity, you can use

entity:GetData()["EID_Description"] = {"HEADLINE","DESCRIPTION"}

"entity" should refer to any gameobject that allows for "GetData" to be used uppon. "EID_Description" is the identifier and name of the data, that EID will be looking for.
the part after the "=" defines the description table, where the first entry is the headline and the second one is a description-text.
Last edited by Wofsauge; Nov 30, 2020 @ 10:28am
< >
Showing 1-15 of 47 comments
Dedayius Jan 10, 2018 @ 4:55pm 
Hi I'm trying to add descriptions for modded items but I'm getting effect not defined errors. Below is an example of what I put in the main.lua based on your instructions.

local item = Isaac.GetItemIdByName("Mirror");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Swaps location with a random enemy";


Completely new to this so I'm sure I'm doing something wrong. Any thoughts? Thanks!
Wofsauge  [developer] Jan 11, 2018 @ 6:07am 
Originally posted by Dedayius:
Hi I'm trying to add descriptions for modded items but I'm getting effect not defined errors. Below is an example of what I put in the main.lua based on your instructions.

local item = Isaac.GetItemIdByName("Mirror");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Swaps location with a random enemy";


Completely new to this so I'm sure I'm doing something wrong. Any thoughts? Thanks!

The code you posted works for me. Ive put it in the "main.lua" file of the mod, that adds the item. Have you put it into EIDs "main.lua" file? if yes, then please add it into the main.lua file of the mod the item originates from.
Dedayius Jan 11, 2018 @ 4:00pm 
Ah that's it then. I only put it into EID and not into the mod it originated from. I'll give that a try!

EDIT: Gave it a try and also noticed some of the item names weren't the exact same as the other mods. Once I cleaned up the names and added the code to all mods it worked!!

Thank you!
Last edited by Dedayius; Jan 11, 2018 @ 4:47pm
V-trés Jan 21, 2018 @ 1:36pm 
Hello, tell me please how to add description to modded trinket "plucked daisy"
Wofsauge  [developer] Jan 21, 2018 @ 4:41pm 
Originally posted by Ruby:
Hello, tell me please how to add description to modded trinket "plucked daisy"
Here is example code on how to add trinkets:

local trinket= Isaac.GetTrinketIdByName("My Trinket Name"); if not __eidTrinketDescriptions then __eidTrinketDescriptions = {}; end __eidTrinketDescriptions [trinket] = "Most Fitting Description";
V-trés Jan 21, 2018 @ 6:20pm 
Originally posted by Wofsauge:
Originally posted by Ruby:
Hello, tell me please how to add description to modded trinket "plucked daisy"
Here is example code on how to add trinkets:

local trinket= Isaac.GetTrinketIdByName("My Trinket Name"); if not __eidTrinketDescriptions then __eidTrinketDescriptions = {}; end __eidTrinketDescriptions [trinket] = "Most Fitting Description";
Thank you :)
The Frogs Feb 15, 2018 @ 2:39am 
So I have put the code

local item = Isaac.GetItemIdByName("Birth Control");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Alive familiars are removed in exchange for random stat upgrades.";


into the alphabirth main.lua, and it still comes up with "effect not defined", am I doing something wrong?
작은 곤충 Mar 16, 2018 @ 11:31am 
Work's perfectly.
mutantdevle Mar 29, 2018 @ 6:39am 
Does it matter where in the code we place it? Eg. do we place it within the part of the code that defines the item or can we just place this code at the end?
TommyRox10 Mar 29, 2018 @ 1:54pm 
I need help. i'm trying to put in the description for the plagues of egypt mod but it doesn't seem to be working. below is what i;ve entered for each item

local item = Isaac.GetItemIdByName("The first plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "+3 red heart containers #all soul/demon hearts replaced with red hearts.";
local item = Isaac.GetItemIdByName("The second plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Killing flies can regenerate health!";

local item = Isaac.GetItemIdByName("The third plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Being near enemies may spawn blue spiders";

local item = Isaac.GetItemIdByName("The fourth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Being near enemies may spawn blue flies";

local item = Isaac.GetItemIdByName("The fifth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Poisons enemies that get close";

local item = Isaac.GetItemIdByName("The sixth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Gives Isaac some horrible boils that explode upon being hit and damage nearby enemies";

local item = Isaac.GetItemIdByName("The seventh plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Summons lightning to strike your enemies";

local item = Isaac.GetItemIdByName("The eighth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "May spawn locusts upon hitting enemies";

local item = Isaac.GetItemIdByName("The ninth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
end
__eidItemDescriptions[item] = "Permanent curse of darkness #enemies that go near Isaac may become scared";

local item = Isaac.GetItemIdByName("The tenth plague");
if not __eidItemDescriptions then
__eidItemDescriptions = {};
Wofsauge  [developer] Mar 30, 2018 @ 6:17am 
Originally posted by mutantdevle:
Does it matter where in the code we place it? Eg. do we place it within the part of the code that defines the item or can we just place this code at the end?
You can place it anywhere you want. but i would recommend to place it at the bottom of the code, to improve readability
Wofsauge  [developer] Mar 30, 2018 @ 6:24am 
Originally posted by TommyRox10:
I need help. i'm trying to put in the description for the plagues of egypt mod but it doesn't seem to be working. below is what i;ve entered for each item

You have multiple errors in your code. the first is, that you define the variable "item" multiple times. the second one is, that you check, if the EID global variable is defined, after every item you add. thats not nessasary. also, you forget a description for the tenth plague. here is the correct and faster code :

if not __eidItemDescriptions then __eidItemDescriptions = {}; end __eidItemDescriptions[Isaac.GetItemIdByName("The first plague")] = "+3 red heart containers #all soul/demon hearts replaced with red hearts."; __eidItemDescriptions[Isaac.GetItemIdByName("The second plague")] = "Killing flies can regenerate health!"; __eidItemDescriptions[Isaac.GetItemIdByName("The third plague")] = "Being near enemies may spawn blue spiders"; __eidItemDescriptions[Isaac.GetItemIdByName("The fourth plague")] = "Being near enemies may spawn blue flies"; __eidItemDescriptions[Isaac.GetItemIdByName("The fifth plague")] = "Poisons enemies that get close"; __eidItemDescriptions[Isaac.GetItemIdByName("The sixth plague")] = "Gives Isaac some horrible boils that explode upon being hit and damage nearby enemies"; __eidItemDescriptions[Isaac.GetItemIdByName("The seventh plague")] = "Summons lightning to strike your enemies"; __eidItemDescriptions[Isaac.GetItemIdByName("The eighth plague")] = "May spawn locusts upon hitting enemies"; __eidItemDescriptions[Isaac.GetItemIdByName("The ninth plague")] = "Permanent curse of darkness #enemies that go near Isaac may become scared"; __eidItemDescriptions[Isaac.GetItemIdByName("The tenth plague")] = "DESCRIPTION FOR TENTH PLAGUE";
AskipLudo. May 21, 2018 @ 7:21am 
I feel dumb but I don't understand how to add other items descriptions xD I tried with your tip but i'm lost x)
Wofsauge  [developer] May 21, 2018 @ 7:31am 
Originally posted by Ludo:
I feel dumb but I don't understand how to add other items descriptions xD I tried with your tip but i'm lost x)
Can you post your code here ? i can only help with code problems if i can see your attempts
AskipLudo. May 21, 2018 @ 7:48am 
I made it in fact x) sorry xp
< >
Showing 1-15 of 47 comments
Per page: 1530 50