tModLoader Even More Modifiers Relaunch Beta

Hi, how is possible to lock a single effect? i have tried that with sealing cube, but lock every modifier.

  • Lock entire modifier (cannot re-roll with reforging)
  • Lock a single effect (cannot re-roll with reforging)
  • Re-roll 1/2/3/4 effect(s)
  • Re-roll everything, you're luckier rolling higher magnitudes
  • Re-roll everything, choose what to keep 1/2/3/4 effect (between old AND new)
  • And then also:
    • Reroll magnitudes
      • 1 line
      • 2 lines
      • 3 line
      • everything
    • And more...
You cant. thats a planned feature
 
You need to compile in c#6. Why are you tinkering?

I actually had the old version of this mod on my server I played with friends. When I found this new one with added docs to make my own modifiers I had to try and make my own. There are a few ideas going through my head but I'm still new to terraria modding so I just wanna see where I can go with it.

Thanks for the help.

EDIT: The mod compiles fine now, however if I try to rebuild it I get a loading error.
Failed to resolve assembly: 'Loot_1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters)
at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute)
at Mono.Cecil.CustomAttribute.<Resolve>b__34_0(CustomAttribute attribute, MetadataReader reader)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.CustomAttribute.Resolve()
at Mono.Cecil.CustomAttribute.get_ConstructorArguments()
at Mono.Cecil.ImmediateModuleReader.ReadCustomAttributes(ICustomAttributeProvider provider)
at Mono.Cecil.ImmediateModuleReader.ReadMethods(TypeDefinition type)
at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Terraria.ModLoader.AssemblyManager.LoadedMod.EncapsulateReferences(Byte[] code)
at Terraria.ModLoader.AssemblyManager.LoadedMod.LoadAssemblies()
at Terraria.ModLoader.AssemblyManager.<>c__DisplayClass7_1.<InstantiateMods>b__1(LoadedMod mod)
at System.Threading.Tasks.Parallel.<>c__DisplayClass31_0`2.<ForEachWorker>b__0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

Here's my build.txt incase it might be of importance.
author = Coinpurse
version = 0.1
displayName = Example Mod
languageVersion = 6
hideCode = false
hideResources = false
includeSource = true
buildIgnore = *.csproj, *.user, obj\*, bin\*, .vs\*
includePDB = false
modReferences = Loot
 
Last edited:
The second part you linked will need additional logic, since the base mod does not go by consuming multiple cubes. You'll have to calculate if the stack isn't big enough, and see if there's another stack that can take the remainder.

Thanks for the help, looks like I may have figured out one solution for it.


Code:
                bool checkMouse = true;
                int remainder = 0;
                // Remove stack from player's inventory
                // .Take 58 because 59th slot is MouseItem for some reason.
                foreach (Item item in Main.LocalPlayer.inventory.Take(58))
                {
                    if (item.type == _cubePanel.item.type && item.stack >= nCube)
                    {
                        checkMouse = false;
                        //item.stack--; original
                        item.stack -= (nCube - remainder);
                        break;
                    }
                    else if (item.type == _cubePanel.item.type && item.stack < nCube)
                    {
                        remainder += item.stack;
                        item.TurnToAir();
                    }
                }

                    if (checkMouse)
                    {
                        // This check should be redundant; otherwise we should never have reached this point
                        //if (Main.mouseItem?.type == _cubePanel.item.type)
                        // I don't need to check for anything else here?
                        Main.mouseItem.stack -= nCube;

                        if (Main.mouseItem.stack <= 0)
                        {
                            Main.mouseItem.TurnToAir();
                        }
                    }

                    _cubePanel.RecalculateStack();

I do find it weird how the cube panel doesn't actually insert the cube into a slot but rather an image of the total number of cubes while the sword slot will actually use the slot.
 
I do find it weird how the cube panel doesn't actually insert the cube into a slot but rather an image of the total number of cubes while the sword slot will actually use the slot.
I actually intended to make a scrollable list below the UI where you just click a cube available in your inventory, so it'd probably make more sense then.
[doublepost=1543147332,1543147148][/doublepost]
I actually had the old version of this mod on my server I played with friends. When I found this new one with added docs to make my own modifiers I had to try and make my own. There are a few ideas going through my head but I'm still new to terraria modding so I just wanna see where I can go with it.

Thanks for the help.

EDIT: The mod compiles fine now, however if I try to rebuild it I get a loading error.
Failed to resolve assembly: 'Loot_1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(TypeReference type)
at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters)
at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute)
at Mono.Cecil.CustomAttribute.<Resolve>b__34_0(CustomAttribute attribute, MetadataReader reader)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.CustomAttribute.Resolve()
at Mono.Cecil.CustomAttribute.get_ConstructorArguments()
at Mono.Cecil.ImmediateModuleReader.ReadCustomAttributes(ICustomAttributeProvider provider)
at Mono.Cecil.ImmediateModuleReader.ReadMethods(TypeDefinition type)
at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Terraria.ModLoader.AssemblyManager.LoadedMod.EncapsulateReferences(Byte[] code)
at Terraria.ModLoader.AssemblyManager.LoadedMod.LoadAssemblies()
at Terraria.ModLoader.AssemblyManager.<>c__DisplayClass7_1.<InstantiateMods>b__1(LoadedMod mod)
at System.Threading.Tasks.Parallel.<>c__DisplayClass31_0`2.<ForEachWorker>b__0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

Here's my build.txt incase it might be of importance.
author = Coinpurse
version = 0.1
displayName = Example Mod
languageVersion = 6
hideCode = false
hideResources = false
includeSource = true
buildIgnore = *.csproj, *.user, obj\*, bin\*, .vs\*
includePDB = false
modReferences = Loot
So are you sure you have Loot enabled (my mod). The error seems like my mod is missing, though the error would probably be different. Can you try it as weakReferences ?
 
So are you sure you have Loot enabled (my mod). The error seems like my mod is missing, though the error would probably be different. Can you try it as weakReferences ?

Gives me the same error when Loot is changed to weakReferences. If it gives you a clue my test mod compiles and reloads without errors when I comment out this part of code.
Code:
        [DelegationPrioritization(DelegationPrioritization.Late, 999)]
 
Last edited:
Gives me the same error when Loot is changed to weakReferences. If it gives you a clue my test mod compiles and reloads without errors when I comment out this part of code.
Code:
        [DelegationPrioritization(DelegationPrioritization.Late, 999)]
Thanks, I'll have to look at what's wrong (I think I know what's going bad)
 
Love this mod, but I've found a conflict with another mod, not sure who's side has the easiest fix, both of these mods are pretty early on in development so it's to be expected, but I'd really love to use both so if you could look into what's causing it I'd love it.

It's called ItemMagnet+ (https://forums.terraria.org/index.php?threads/itemmagnetplus-customizable-item-magnet.74425/)

If I use both mods at the same time, the moment I try to use the magnet the game's controls lock up (interestingly, items will move towards me, but they'll never go in my inventory, as if my inventory is full). I can't move, or act, or even open the menu without forcing it open with mods. Critters still move, so it's definitely not a hard freeze. Persists until I disable one of the mods no matter if I restart or anything.

At the moment I'm using this mod over the other one since this one has a little bit more fun involved wheras the other one is just a huge convenience.

EDIT: The mod author has fixed the bug on his end (about to test it) so you can probably ignore this.
 
Last edited:
Hey again Jofairden, I know you're not exactly up to personal endeavors but was wondering how to increase % stats while preserving the same modifiers?

I've added a feature that allows players to upgrade their existing modifiers but requires an extra copy of the item


I was thinking I'd just use the foreach (var modifiers in EMMItem.GetActivePool(_rerollItemPanel.item)) and directly edit the modded values but although I can change Magnitude and a few others I'm unable to update RoundedPower (tooltip numbers).

Code:
            if (MatchesRerollRequirements())
            {
                if (upgradeInstead)
                {
                    foreach (var modifiers in EMMItem.GetActivePool(_rerollItemPanel.item))
                    {
                        modifiers.Properties.Magnitude += 0.1f;
                        //modifiers.Properties.RoundedPower
                    }
                    _upgradeItemPanel.item.TurnToAir();
                }
                else // Just reroll
                {

I was thinking if the OverrideRollModifierPool or ForceModifierPool would work and if so how do you use it? Would it be simpler to just add it within the RerollModifierPool function?
 
Hey again Jofairden, I know you're not exactly up to personal endeavors but was wondering how to increase % stats while preserving the same modifiers?

I've added a feature that allows players to upgrade their existing modifiers but requires an extra copy of the item


I was thinking I'd just use the foreach (var modifiers in EMMItem.GetActivePool(_rerollItemPanel.item)) and directly edit the modded values but although I can change Magnitude and a few others I'm unable to update RoundedPower (tooltip numbers).

Code:
            if (MatchesRerollRequirements())
            {
                if (upgradeInstead)
                {
                    foreach (var modifiers in EMMItem.GetActivePool(_rerollItemPanel.item))
                    {
                        modifiers.Properties.Magnitude += 0.1f;
                        //modifiers.Properties.RoundedPower
                    }
                    _upgradeItemPanel.item.TurnToAir();
                }
                else // Just reroll
                {

I was thinking if the OverrideRollModifierPool or ForceModifierPool would work and if so how do you use it? Would it be simpler to just add it within the RerollModifierPool function?
What you want to do means changing the power of modifiers
This is stored in the ModifierProperties
Specifically Power and Magnitude are important, since they make up the actual power of the item. RoundedPower is simply that power but as a rounded number. You never set RoundedPower directly, look at the setter of Power.
In your case, look into the RollMagnitudeAndPower() method. You'll want to make an UpgradePower() method that rerolls the power until it reaches a higher number than previously acquired (and then call this in your upgradeInstead part)
 
I have a problem. I downloaded the mod source and tried to compile it and failed.
Here is the crash log:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Terraria.ModLoader.ModCompile.RoslynCompile(CompilerParameters compileOptions, String[] files)
at Terraria.ModLoader.ModCompile.CompileMod(BuildingMod mod, List`1 refMods, Boolean forWindows, Byte[]& dll, Byte[]& pdb)
at Terraria.ModLoader.ModCompile.Build(BuildingMod mod, IBuildStatus status)
at Terraria.ModLoader.ModCompile.Build(String modFolder, IBuildStatus status)
at Terraria.ModLoader.ModLoader.<>c.<BuildMod>b__74_0(Object _)

Inner Exception:
Could not load file or assembly 'System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Terraria.ModLoader.RoslynWrapper.Compile(CompilerParameters args, String[] files)
Is there anything I can do?
 
I have a problem. I downloaded the mod source and tried to compile it and failed.
Here is the crash log:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Terraria.ModLoader.ModCompile.RoslynCompile(CompilerParameters compileOptions, String[] files)
at Terraria.ModLoader.ModCompile.CompileMod(BuildingMod mod, List`1 refMods, Boolean forWindows, Byte[]& dll, Byte[]& pdb)
at Terraria.ModLoader.ModCompile.Build(BuildingMod mod, IBuildStatus status)
at Terraria.ModLoader.ModCompile.Build(String modFolder, IBuildStatus status)
at Terraria.ModLoader.ModLoader.<>c.<BuildMod>b__74_0(Object _)

Inner Exception:
Could not load file or assembly 'System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Terraria.ModLoader.RoslynWrapper.Compile(CompilerParameters args, String[] files)
Is there anything I can do?
You need to be setup to compile with C#6
 
Thank you for the answer, but sadly, I don't understand it.
I have no knowledge of creating or even compiling mods, I just wanted to have fun tweaking some modifiers. I just tried to compile it using the built-in compiler in the tModLoader client.
Could you perhaps give me a step by step guide on how to do it or maybe link me to one? Or maybe tell me what does it mean to be setup?
 
Thank you for the answer, but sadly, I don't understand it.
I have no knowledge of creating or even compiling mods, I just wanted to have fun tweaking some modifiers. I just tried to compile it using the built-in compiler in the tModLoader client.
Could you perhaps give me a step by step guide on how to do it or maybe link me to one? Or maybe tell me what does it mean to be setup?

In your mods folder, which should be in mod sources (\Documents\My Games\Terraria\ModLoader\Mod Sources\TestMod) there is a build.txt file. To compile with c#6 you have to insert this line into the file, languageVersion = 6.
 
I almost don't even want to play the game without this mod but I also have to report the problem with the "Cursed" modifier, nearly 70% of the weapons and tools my friends and I craft have it. I don't even have a weapon that isn't cursed, I burned through all of my platinum and crimtane early game last night and everything I crafted had the same problem. Hopefully it's an easy fix!
 
Can you enable the ability to save individual slots? So I can just keep rerolling while keeping the good bits?
[doublepost=1544299362,1544299225][/doublepost]
I almost don't even want to play the game without this mod but I also have to report the problem with the "Cursed" modifier, nearly 70% of the weapons and tools my friends and I craft have it. I don't even have a weapon that isn't cursed, I burned through all of my platinum and crimtane early game last night and everything I crafted had the same problem. Hopefully it's an easy fix!
I have the same problem. I wish there was a better cube - maybe one for ranged/melee/thrown/summoned/minion/magic damage (separate cubes for each), one for pure damage, a cursed cube with higher stats, or a 'pure' cube with MUCH lower chances of negatives.
 
Thank you for the answer, but sadly, I don't understand it.
I have no knowledge of creating or even compiling mods, I just wanted to have fun tweaking some modifiers. I just tried to compile it using the built-in compiler in the tModLoader client.
Could you perhaps give me a step by step guide on how to do it or maybe link me to one? Or maybe tell me what does it mean to be setup?
The problem is it's quite a bit of hassle to setup, due to tModLoader isuse. However, they have all been resolved in the next release. I advise you to either wait for the next tML release, but if you really want to work on it now you should join the tML discord and ask for help in the #help-with-code channel.
[doublepost=1544547626,1544547581][/doublepost]
I almost don't even want to play the game without this mod but I also have to report the problem with the "Cursed" modifier, nearly 70% of the weapons and tools my friends and I craft have it. I don't even have a weapon that isn't cursed, I burned through all of my platinum and crimtane early game last night and everything I crafted had the same problem. Hopefully it's an easy fix!
Hmm that sound odd, it should not occur _that_ much. Does this also happen with just this mod enabled?
 
Where do i get the cubes (other then cheating them in of course) because all the items i have even though i already had the mod installed before generating any new items, i think, had no extra prefixes to them, unless starting items just dont have them, i really dont know for sure
 
Hi, I'm having an issue with the mod, playing on a server hosted by me with two other people and I cannot get prefixes on armor or reforge armor at the tinkerer, but they both get prefixes and can reforge as normal. The issue seems to happen in single player worlds also, any advice?
 
Back
Top Bottom