tModLoader MoreAccessories+ v2.0

Discussion in 'Released' started by VVV101, Dec 15, 2016.

  1. orangepecan

    orangepecan Terrarian

    To be honest, from my experience at least, this is normally caused by something like an array out of bounds error that doesn't cause the program to completely crash. Instead, the program will exit the function that caused the error and continue processing the rest of the code. Chances are, there is an "updatePlayer" function or something like that that calculates physics, processes button pushes, etc., but ends up getting completely skipped in all the game loop updates. For whatever reason, the 3rd extra accessory slot seems to be causing those types of symptoms.

    I think Eldrazi found a way to work around it, but nobody has seen him for some time.

    EDIT: From Eldrazi's thread, this seems to confirm what I suspect: https://forums.terraria.org/index.php?attachments/crash_error-jpg.98877/

    Why the game crashes at 3 extra slots and still allows the 2nd extra one is one great mystery. I suspect only the Terraria devs themselves may be able to find out.

    EDIT2: OK here's my best guess. The array that holds the extra accessory slots is hard coded to store 7 records. By setting extraAccessorySlots to 3 or higher, we are forcing that array to attempt to store more values that it is able to hold, and thus the crash. Unless we can actually access that array somehow and modify its size, there is likely no possible way to do anything about this.

    This is, of course, assuming that this is the problem. I am pretty sure that it is though.

    EDIT3: After thinking about it a bit more *and* realizing that the cheat sheet mod is able to add multiple accessory slots beyond the 3rd, I suspect that the bug has to do with the dye and/or vanity slot, and not in fact the accessory slot itself.
     
    Last edited: Dec 18, 2016
    StarRacer likes this.
  2. Sepri

    Sepri Terrarian

    edit: whoops i didnt read a few things

    question though as i havent tried the mod, does it have a 100% drop from planteras expert mode bag at least?
     
  3. VVV101

    VVV101 Spazmatism

    Now Heart of Nature has 10% chance of dropping from Plantera because Heart of Nature effect is too strong to be given so easily as 100% chance.
     
    Sepri likes this.
  4. IDFC

    IDFC Skeletron Prime

    Can we have another item that drops from the moon lord that gives us another accessory slot?
     
  5. orangepecan

    orangepecan Terrarian

    I was actually going to look into this myself. Currently we cannot using the same method for the Heart of Nature because that causes the game to crash. :(
     
  6. IDFC

    IDFC Skeletron Prime

    Yeah the main reason I asked for that is because other mods add insane bosses after the moon lord.
     
  7. VVV101

    VVV101 Spazmatism

    If someone find method to add another accesory slot I can actually add "Moon... Celestial Heart".
    Like in Cheat Sheet... It can add up to 5 more.
     
  8. adaxe

    adaxe Terrarian

    The slots added by Cheat Sheet are actually not "real". You can equip multiple same accessories in them.
     
  9. VVV101

    VVV101 Spazmatism

    Oh... I didn't know that.
    But adding 3rd extra slot somehow cause game to disable all player physics and interactions. It looks like developers actually planned to add 2nd extra slot, but don't do that.
     
  10. Cheezegami

    Cheezegami Pixel Pirate

    Does the heart of nature still only drop from plantera itself, or is it now found in bags in expert mode? If you need any help with the bag code, ask me.
     
  11. VVV101

    VVV101 Spazmatism

    Now HoN drops straight from Plantera, not from bag.
    I don't think there would be the problem with placing Heart of Nature to the bag.
    But I don't think that this is necessary.
     
  12. Cheezegami

    Cheezegami Pixel Pirate

    In single player it shouldn't be much of a problem.
    I think it kinda is when you're playing on a server with 5+ people and everyone wants a heart :p (also prevents people over fighting of who gets the heart)
    Anyway, here's the code.
    Code:
    Public class BossBags : GlobalItem
            {
                public override void OpenVanillaBag(string context, Player player, int arg)
                {
                    if (context == "bossBag" && arg == ItemID.PlanteraBossBag)
                    {
                        if (Main.rand.Next(10) == 0)
                        {
                            player.QuickSpawnItem(mod.ItemType("HeartOfNature");
                        }
                    }
                 }
             }
    
    Also, you can disable the normal drop in expert mode by:
    putting an
    Code:
    if (Main.expertMode == false)
    
    In the NPC Loot method.
     
  13. VVV101

    VVV101 Spazmatism

    Thank you, Cheezegami. Except some syntaxis, all was right. So v1.5 is uploaded.
    v1.5 - Separeted looting rules of HoN in normal & expert mode.
    All tested and work.
     
  14. orangepecan

    orangepecan Terrarian

    @VVV101 Meteor Heads stop dropping money in hard mode. I don't know if this mod is the cause but they drop money in pre-hardmode. Is this the way it's supposed to be?
     
  15. VVV101

    VVV101 Spazmatism

    I don't know. I have the same thing about. In hardmode there is no money loot from Meteor Head.
    Maybe it is a vanilla thing? To prevent farming biome keys with MH?
     
  16. IDFC

    IDFC Skeletron Prime

    Maybe you could contact the developers.
     
  17. tankedup13

    tankedup13 Plantera

    that is a vanilla feature, both to stop money farming them since they are very easy to kill in HM, and to stop you from being able to farm meteorite from them.
     
    VVV101 likes this.
  18. orangepecan

    orangepecan Terrarian

    That's so weird. Once you get a banner they are extremely easy to kill in pre-HM too.
     
  19. EternalDragon98

    EternalDragon98 Terrarian

    when i used the heart on nature the slot only stayed for about a second then dissapeared i tried to cheat one in with cheat sheet and it still doesnt work
     
  20. VVV101

    VVV101 Spazmatism

    Tested right now on both types of world. All works fine.
    I guess some other mod cause this problem.
    You are not playing mp? I didn't test it multiplayer.