Repository navigation
Adding Items
AgentCucco edited this page Jan 22, 2021
·
15 revisions
Encyclopedia.AddItem(class, id, wikidesc, pools, name, desc)-
class: 'string'. The class for your item, usually referenced as your mod's name. (optional)- Note: On smaller mods, it's recommended to leave this argument as nil, so the item gets added to "general mods" instead of occupying a new cateogory in the menu.
-
id: 'number'. Your item's id. -
wikidesc: 'table'. Your wiki table for the item. (optional)- See here how to make Wiki descriptions.
-
pools: 'table': A table of pools. (optional)- Make sure to follow the mod's variables, not the vanilla enumerations.
-
name: 'string'. The name of your item, used in case the name in the xml causes an [ERROR] tag to display in-game. (optional) -
desc: 'string'. The description of your item, used in case the description in the xml causes an [ERROR] tag to display in-game. (optional)
You can choose to register your item differently depending on how much effort you wanna put into the encyclopedia compatibility.
local MyMod = RegisterMod("Super Mod", 1)
local FunkyItem = Isaac.GetItemIdByName("Funky Item")
if Encyclopedia then
Encyclopedia.AddItem(
nil,
FunkyItem,
nil,
{
Encyclopedia.ItemPools.POOL_TREASURE,
Encyclopedia.ItemPools.POOL_GREED_TREASURE,
}
)
endlocal MyMod = RegisterMod("Super Mod", 1)
local FunkyItem = Isaac.GetItemIdByName("<Funky Item>")
if Encyclopedia then
Encyclopedia.AddItem(
nil,
FunkyItem,
nil,
nil,
"Funky Item"
)
endlocal MyMod = RegisterMod("Super Mod", 1)
local FunkyItem = Isaac.GetItemIdByName("Funky Item")
if Encyclopedia then
local Wiki = {
Funky = {
{ -- Effect
{str = "Effect", fsize = 2, clr = 3, halign = 0},
{str = "Gives you some massive funk boost."},
{str = "If you get enough funk boost (20), summon Funky Kong."},
{str = "+1 Funk point when you are funky."},
},
{ -- Trivia
{str = "Trivia", fsize = 2, clr = 3, halign = 0},
{str = "I made this item because I honestly really like funky kong."},
},
}
}
Encyclopedia.AddItem(
nil,
FunkyItem,
Wiki.Funky,
{
Encyclopedia.ItemPools.POOL_TREASURE,
Encyclopedia.ItemPools.POOL_GREED_TREASURE,
}
)
endlocal MyMod = RegisterMod("Super Mod", 1)
local FunkyItem = Isaac.GetItemIdByName("Funky Item")
local FunkyDescription = "{{ArrowUp}} Gives you a lot of funk. #If you get enough funk, you will summon Funky Kong."
if EID then
EID:addCollectible(FunkyItem, FunkyDescription)
end
if Encyclopedia then
Encyclopedia.AddItem(
nil,
FunkyItem,
Encyclopedia.EIDtoWiki(FunkyDescrption),
{
Encyclopedia.ItemPools.POOL_TREASURE,
Encyclopedia.ItemPools.POOL_GREED_TREASURE,
}
)
endlocal MyMod = RegisterMod("Super Mod", 1)
local FunkyItem = Isaac.GetItemIdByName("Funky Item")
local FunkyDescription = "{{ArrowUp}} Gives you a lot of funk. #If you get enough funk, you will summon Funky Kong."
if Encyclopedia then
Encyclopedia.AddItem(
"Funky Kong Pack (25+ Items)",
FunkyItem,
Encyclopedia.EIDtoWiki(FunkyDescrption),
{
Encyclopedia.ItemPools.POOL_TREASURE,
Encyclopedia.ItemPools.POOL_GREED_TREASURE,
}
)
end