Mod For More Accessories in 1.3?

The Heart of Nature seems to be incompatible with the Demon Heart. It freezes my character and glitches the inventory screen
 
Last edited:
The Heart of Nature seems to be incompatible with the Demon Heart. It freezes my character and glitches the inventory screen
I've done some snooping around on this subject and have come to the following conclusion: Multiple extra accessory slots are NOT allowed in Terraria. Look at the following:
Code:
if (this.extraAccessory && (Main.expertMode || Main.gameMenu))
{
    this.extraAccessorySlots = 1;
}
else
{
    this.extraAccessorySlots = 0;
}
This is a little piece of code that gets called every single frame (so 60 times a second) in Terraria. If you know some programming, you'd see that this hardcodes Terraria into allowing only 1 extraAccessory slot.
The good news is: I can work around this. The (not too) bad new is: I need ModPlayer hooks for tModLoader to achieve this. These hooks will be released in a week or two (probably), so if you hang on just a little longer, I'll make this a fully integrated (and working) mod.
Thanks for your patience. Cheers.
 
  • Like
Reactions: ULF
I've done some snooping around on this subject and have come to the following conclusion: Multiple extra accessory slots are NOT allowed in Terraria. Look at the following:
Code:
if (this.extraAccessory && (Main.expertMode || Main.gameMenu))
{
    this.extraAccessorySlots = 1;
}
else
{
    this.extraAccessorySlots = 0;
}
This is a little piece of code that gets called every single frame (so 60 times a second) in Terraria. If you know some programming, you'd see that this hardcodes Terraria into allowing only 1 extraAccessory slot.
The good news is: I can work around this. The (not too) bad new is: I need ModPlayer hooks for tModLoader to achieve this. These hooks will be released in a week or two (probably), so if you hang on just a little longer, I'll make this a fully integrated (and working) mod.
Thanks for your patience. Cheers.
Is there a way to make an accessory slot that only accepts '1' type of item

For example if I wanted to create a new subset of items for my core mod

Would I be able to add a 'core slot'

Also, would it be able to have 'core set bonuses'
 
I've done some snooping around on this subject and have come to the following conclusion: Multiple extra accessory slots are NOT allowed in Terraria. Look at the following:
Code:
if (this.extraAccessory && (Main.expertMode || Main.gameMenu))
{
    this.extraAccessorySlots = 1;
}
else
{
    this.extraAccessorySlots = 0;
}
This is a little piece of code that gets called every single frame (so 60 times a second) in Terraria. If you know some programming, you'd see that this hardcodes Terraria into allowing only 1 extraAccessory slot.
The good news is: I can work around this. The (not too) bad new is: I need ModPlayer hooks for tModLoader to achieve this. These hooks will be released in a week or two (probably), so if you hang on just a little longer, I'll make this a fully integrated (and working) mod.
Thanks for your patience. Cheers.

oh man if this mod actually does come out soon and works, i'm downloading it; with ALL of the great mods in place and even more on the way this will be a MUST in my oppinion, esspecially if yopu want to run more then one, like me, cuz they all so awesome lol xD
 
Allright you guys, I rebuild the mod and stuff, so everything should be working fine. Made a few minor changes, so here we go:
  1. Heart of Nature is now to be consumed and will add 2 extra accessory slots (this stacks with the Demon Heart).
  2. Demon Heart accessory buff is now also available in non-expert worlds (same for the Heart of Nature).
  3. Demon Heart still needs an expert world to drop and consume, tell me if you'd like this changed.
I think that's it... With all that said, here's the file (don't forget to unpack!). Tell me if you come accross any errors/bugs in the game due to this mod, plix. Enjoy!

EDIT:
This mod is now also available on the ModBrowser. Keeping this download here for Mac users (since I'm not positive the ModBrowser was fixed for them).
 

Attachments

  • MoreAccessories.zip
    11.4 KB · Views: 771
Last edited:
I installed the mod you included in the attached files, Eldrazi.

For whatever reason, i acquired the Heart of Nature from a Destroyer kill (you mentioned this being the method to acquire before?) despite it being a drop from Plantera in the mod browser description.

Anyway, after consuming the heart the armour/accessories/dyes UI bugged out and my character froze. After that, the game would throw a 'crash' error when i tried to reload the world and game. The only way the game won't crash is when i disable the mod in the browser and i restart the game. Re-enabling the mod causing the same crash error.

For reference, i have the Tremor mod, Thorium mod and Quality of Life mods installed alongside your one.

If you want me to post screenshots of the error/crash logs then i will do. :)
 
I installed the mod you included in the attached files, Eldrazi.

For whatever reason, i acquired the Heart of Nature from a Destroyer kill (you mentioned this being the method to acquire before?) despite it being a drop from Plantera in the mod browser description.

Anyway, after consuming the heart the armour/accessories/dyes UI bugged out and my character froze. After that, the game would throw a 'crash' error when i tried to reload the world and game. The only way the game won't crash is when i disable the mod in the browser and i restart the game. Re-enabling the mod causing the same crash error.

For reference, i have the Tremor mod, Thorium mod and Quality of Life mods installed alongside your one.

If you want me to post screenshots of the error/crash logs then i will do. :)
Allrightiyo, yeah I decided to still make it drop from Plantera, since the mechanical bosses felt a bit too early in-game for such an OP item.

It IS weird that your came starts crashing, so that's something we'll have to flesh out. Error logs would help a lot ;)
Other than that, could you give me a bit of info: Do you also have the Demon Heart passive? Are you trying the use the accessory slots?
 
Sure thing. More than happy to help.

I am currently playing an expert world and in hardmode, so yes i have the demon heart passive active. When it comes to using the slots, i didn't get a chance to actually put anything in them. As soon as the Heart of Nature was consumed the UI bug occurred.

Unfortunately, i'm unable to post a screenshot of what the UI looked like when i consumed the heart but from what i remember all the armour and dye slots disappeared and there only appeared to be one extra accessory slot added.

I'll attach the crash log to the post. If you need anything else let me know. I'm unsure if the crash is on a per world/player basis or if it's a game wide crash but i can check if that would help.
 

Attachments

  • crash_error.jpg
    crash_error.jpg
    99.3 KB · Views: 1,444
Sure thing. More than happy to help.

I am currently playing an expert world and in hardmode, so yes i have the demon heart passive active. When it comes to using the slots, i didn't get a chance to actually put anything in them. As soon as the Heart of Nature was consumed the UI bug occurred.

Unfortunately, i'm unable to post a screenshot of what the UI looked like when i consumed the heart but from what i remember all the armour and dye slots disappeared and there only appeared to be one extra accessory slot added.

I'll attach the crash log to the post. If you need anything else let me know. I'm unsure if the crash is on a per world/player basis or if it's a game wide crash but i can check if that would help.
No need (probably). This way I might be able to recreate the problem and find a solution. Many thanks for the bug report and I'll let you know when I fixed it ASAP!
 
Allright, so this bug is very unfortunate... It seems the game isn't able to handle the total amount of accessory slots when having both the Demon Heart and Heart of Nature passives (which would be 3 extra slots). For now the only solution seems to be bringing down the amount of accessory slots that are added by the Heart of Nature, capping the total (including both passives) at 2 extra accessory slots.
Although this may be more balanced (if I recall correctly) the request was for 2 extra accessory slots, so I will still look into that. For now; here's the new (working) version (also updated on the ModBrowser):
 

Attachments

  • MoreAccessories.zip
    3.8 KB · Views: 630
Awesome. I'll give it a go and report back if anything goes wrong.

Maybe once tModLoader is a little more fleshed out it'll be possible to add more slots whether that be through the same Nature Heart or more items acquired later down the playthrough.

It might be a cool idea to look into a way to implement the ability for players to configure how many extra slots are given. Of course that won't be plausible until a little further down the line.

Thanks for providing a fix so soon!
 
Awesome. I'll give it a go and report back if anything goes wrong.

Maybe once tModLoader is a little more fleshed out it'll be possible to add more slots whether that be through the same Nature Heart or more items acquired later down the playthrough.

It might be a cool idea to look into a way to implement the ability for players to configure how many extra slots are given. Of course that won't be plausible until a little further down the line.

Thanks for providing a fix so soon!
No probs, customer service all the way ( :p )!

About the ability for players to configure that themselves: that is an option, but might yield weird results in multiplayer (unless that value is manually synched from the server of course). Something to keep in mind for future improvements, that's for sure!
 
Could you possibly make a mod to passively add slots from the get go? I hate having so few slots cause in order to max out my classes I need to get rid of some accessories in favor of others. I've been reading this forum/thread thing and it seems up in the air as to whether or not it is possible.
 
Could you possibly make a mod to passively add slots from the get go? I hate having so few slots cause in order to max out my classes I need to get rid of some accessories in favor of others. I've been reading this forum/thread thing and it seems up in the air as to whether or not it is possible.
Lemme get this straight: You're asking for a mod that gives 2(?) accessory slots right off the bat?
This is possible, just need to figure out a way to make that compatible with the accessory slot gained from the Heart of Nature.

DO NOTE: it's currently not possible to have more than 2 extra accessory slots (something internal, meh)! Also, having these accessory slots may look weird, since I haven't actually implemented any UI for it (no hooks).
 
Back
Top Bottom