-
-
Notifications
You must be signed in to change notification settings - Fork 131
How to add descriptions
Descriptions are the core feature of EID. They describe the effect of the item in a short, precise and easy to understand way.
EID-Descriptions can be added to any item or entity of the game. To do this, the EID API provides the following functions:
-- For Collectibles. Optional parameters: itemName, language
EID:addCollectible(id, description, itemName, language)
-- For Trinkets. Optional parameters: itemName, language
EID:addTrinket(id, description, itemName, language)
-- For cards/runes. Optional parameters: itemName, language
EID:addCard(id, description, itemName, language)
-- For pilleffect ids. Optional parameters: itemName, language
EID:addPill(id, description, itemName, language)
- id is refering to the specific subType of the entity.
- description is a string containing the itemdescription. See more on that >>> further down <<<
- itemName (Optional) Can be used to define a custom name. If not set, the mod takes the name from the ingame ItemConfig (XML-files)
-
language (Optional) Can be used to add the description into a specific language-pack. Default is
en_us
(english) - Valid languages are:
en_us
(english),fr
(French) ,pl
(Polish) ,spa
(Spanish) ,pt
(Portuguese) andru
(Russian)
-
EID:addCollectible(1, "Some text")
-- Overrides the description for "Sad Onion" -
EID:addCollectible(1, "Some text", "New name")
-- Overrides the description for "Sad Onion" and renames it into "New name" - Seting a russian translation for a custom item:
local myItemId = Isaac.GetItemIdByName("My Item Name");
EID:addCollectible(myItemId, "водка лучше пива", "Блядь", "ru")
In addition to adding descriptions to items, it is also possible to add descriptions to any entity of the game. this can be achieved with the following function:
-- For any entity. Optional parameters: language
EID:addEntity(id, variant, subtype, entityName, description, language)
- id, variant and subtype define the specific entity. When subtype is -1 or empty, it will affect all subtypes of that entity.
- entityName will be the text that is displayed in the "name" field of the description
- description is the description of the entity
- language (Optional) Can be used to add the description into a specific language-pack
Descriptions are defined using a single string.
New lines are added with the # Character.
Every new line starts with a bulletpoint indicator or an icon.
Example:
"Test description#A second line#A third line"
The bulletpoints infront of each line can be replaced with inline Markup Icons. The mod will try to read a markup string in the first position of a new line.
The markup needs to be followed by a space!
Example:
Description:"Some text#↑ Some text#↓Some text#{{Heart}} Some text#{{Blank}}#{{Blank}} Some text"
Explanation of the lines:
-
Default bulletpoint
-- Line doesnt start with something special. Normal bulletpoint will be rendered -
↑ space after icon
-- Line starts with markup. Use Markup icon as bulletpoint icon -
↓no space after icon
-- No space after icon will render the icon at the start of the text, rather than as a bulletpoint -
{{Heart}} a custom icon as bulletpoint
-- Same as 2. but with an explicit icon markup definition -
{{Blank}}
-- Renders an empty line without bulletpoint or text. Good for spacing things -
{{Blank}} A line without a bulletpoint
-- Renders the text without any bulletpoint
Every text rendered with EID does support the usage of the custom "Markup" of the mod. This allows mods to render icons and colored text inside their descriptions and objectnames.