Standalone [1.3] tModLoader - A Modding API

Why would that link claim the 4GB memory patch is already applied if it doesn't actually work?! Seriously, that makes no sense.
I need to know why that is a problem.
And why this of all programs cannot actually use more then 4GB.

Are you seriously telling me this program cannot ever use memory above 4GB no matter what? The entire point of the 4GB patch thing is to allow 32-bit programs to work with more than 4GB!

I really don't understand the problems with this modloader.
Are we serious that it cannot ever use more than 4GB of ram? EVER? Really?
Because I know for a fact people run a ton of mods just fine. So, don't tell me I can't run a few mods!
Seriously, how the heck can this not use more than 4GB ever?!? This modloader should not be limited to 32-bit!

I'm sorry for being upset. I just want to play this game. With mods. I know people have played this game with lots of mods just fine. So it's garbage to tell me that I can't suddenly play with a lot of mods!
 
Last edited:
I have not tried to add items in tModLoader mods previously, but from what I can tell, you have two files which try to add a "RainbowsSword" item (with "RainbowsSword.cs" being the second file to do so). It's possible that you copied the "RainbowsSword.cs" file, renamed it, and forgot to change the name of something within that file.
Thanks a lot! You helped me!
 
I want to apologize. I have Asperger's, and I get really heated sometimes when things don't work for me. I really do not mean to be a crazy person. I just can't figure this out, and it causes me to get upset.
I really am sorry.
 
Why would that link claim the 4GB memory patch is already applied if it doesn't actually work?! -
Didn't you say that tModLoader never uses more than 4 gigabytes of RAM in your previous post? If the 4 gigabyte RAM patch was not applied, tModLoader would never use more than 2 gigabytes of RAM. (The 4 gigabyte RAM patch allows 32-bit programs to use up to 4 gigabytes of RAM, not more than 4 gigabytes.)

- The entire point of the 4GB patch thing is to allow 32-bit programs to work with more than 4GB! -
2 to the power of 32 is 4294967296. If you divide that by 1024 (bytes per kilobyte), you get 4194304 (kilobytes). Divide that by 1024 (kilobytes per megabyte), and you get 4096 (megabytes). Divide that by 1024 (megabytes per gigabyte) one last time, and you get 4. Therefore, with 32 bits (which each have 2 states, thus 2 to the power of 32), you basically can not specify a memory address higher than 4 gigabytes worth of RAM, regardless of what you do. This is probably a gross oversimplification, but it gets the point across.

-And why this of all programs cannot actually use more then 4GB. Are you seriously telling me this program cannot ever use memory above 4GB no matter what? - Are we serious that it cannot ever use more than 4GB of ram? EVER? Really? - Seriously, how the heck can this not use more than 4GB ever?!? This modloader should not be limited to 32-bit! -
Vanilla un-modded Terraria is a 32-bit program (unless you use OSX (not Windows), I believe). That may give complications with making mods 64-bit. Not to mention that as far as I'm aware, 64-bit programs can't load 32-bit DLL files, while all tModLoader mods are stored in (32-bit) DLL files. Edit: To clarify, this last point is an argument for as to why tModLoader probably can't afford switching to being 64-bit.
 
Last edited:
Okay. I misunderstood the issues.
I got it.
I am sorry. I will try to cut down on the list of mods so I can create a medium world.
It shouldn't take me too long. I just can remove like Tremor Mod Remastered, and that should probably cut it down enough.
Hopefully.
I mean, this used to run just fine with Spirit Mod, Calamity, Grealm, and a few others, so I guess that just pushed it over the top. I am sorry for being frustrated.
Having a mental disorder can be an extreme burden when it flares up, and Asperger's Focus happens whenever something challenges what I know, and when games mess up, that is a challenge of things I know.
Again, I am sorry.
On the bright side, everything does load faster on my SSD drive compared to my old HDD.
 
Can anyone help me to get this to work? I have created a new ammo class (3 new ones, specifically), and I have items that use those ammo classes. However, each ammo class has multiple ammo items (like how there are many types of arrows), but I can't get my weapons to shoot whichever ammo of that class is first in my inventory. The other thing is that I want the weapons that use those ammo types to cycle through the three different ammo class on each shot, each shot shooting a different type of ammo. It will shoot a base ammo if there is no ammo for the current class it is shooting, but otherwise it will use the first one in your inventory. Also all the ammo is non-consumable. I can post the code for the items if it will help. Does anyone know how to do this?
 
Can anyone help me to get this to work? I have created a new ammo class (3 new ones, specifically), and I have items that use those ammo classes. However, each ammo class has multiple ammo items (like how there are many types of arrows), but I can't get my weapons to shoot whichever ammo of that class is first in my inventory. The other thing is that I want the weapons that use those ammo types to cycle through the three different ammo class on each shot, each shot shooting a different type of ammo. It will shoot a base ammo if there is no ammo for the current class it is shooting, but otherwise it will use the first one in your inventory. Also all the ammo is non-consumable. I can post the code for the items if it will help. Does anyone know how to do this?
Will this be good? I have done this in slime biome mod, here is a limited version of v2.1 code.
 

Attachments

  • Slime Biome V2.1 Code.zip
    558.8 KB · Views: 116
Anyone having this insane damage problem with weapons? I'm thinking it has something to do with the even more modifiers mod but I'm not sure.
 
Last edited:
No, i was just doing a normal playthrough everything was fine and then they started doing 10,000 damage out of nowhere when they are suppose to do 10.
Oh, check EVERYTHING equipted, even armor, then check to see if anything happened since, then if not anything, list ALL of your mods that you are using
 
Oh, check EVERYTHING equipted, even armor, then check to see if anything happened since, then if not anything, list ALL of your mods that you are using
I checked everything equipped there seems to be nothing wrong. I'm guessing it has something to do with the even more modifiers and the damage to a class or vs max life enemies. That would be my only explanation. All the other mods i have installed are just furniture and decorating mods so they wouldn't affect the damage at all.
 
I don't know, but I don't think it's working. It just always shoots the base projectile without taking into account any ammo I have in my inventory.
[doublepost=1538354937,1538354847][/doublepost]Here's the code:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using HackerClass;

namespace HackerClass.Items.Weapons
{
    public class HackingComputer : MalwareItem.HackerItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Hacker's Laptop");
            Tooltip.SetDefault("Alternates between shooting viruses, worms, and trojans");
        }
        public override void SetDefaults()
        {
            item.damage = 9;
            item.noMelee = true;
            item.width = 40;
            item.height = 40;
            item.useTime = 20;
            item.useAnimation = 20;
            item.useStyle = 5;
            item.knockBack = 2f;
            item.value = 1000;
            item.rare = 0;
            item.UseSound = SoundID.Item1;
            item.autoReuse = false;
            item.shootSpeed = 4f;
            item.noUseGraphic = true;
            if (malwareType == 1)
            {
                item.shoot = mod.ProjectileType("BaseVirus");
                item.useAmmo = mod.ItemType("Virus");
            }
            if (malwareType == 2)
            {
                item.shoot = mod.ProjectileType("BaseWorm");
                item.useAmmo = mod.ItemType("Worm");
            }
            if (malwareType == 3)
            {
                item.shoot = mod.ProjectileType("BaseTrojan");
                item.useAmmo = mod.ItemType("Trojan");
            }
        }

        public override bool UseItem (Player player)
        {
            if (malwareType == 3)
            {
                malwareType = 1;
            }
            else
            {
                malwareType = malwareType + 1;
            }
            return true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
What am I doing wrong?
 
What is your code. (it cant be as strange as drugged worlds (me))

WOW posted simultaneously
[doublepost=1538355121,1538354942][/doublepost]
I don't know, but I don't think it's working. It just always shoots the base projectile without taking into account any ammo I have in my inventory.
[doublepost=1538354937,1538354847][/doublepost]Here's the code:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using HackerClass;

namespace HackerClass.Items.Weapons
{
    public class HackingComputer : MalwareItem.HackerItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Hacker's Laptop");
            Tooltip.SetDefault("Alternates between shooting viruses, worms, and trojans");
        }
        public override void SetDefaults()
        {
            item.damage = 9;
            item.noMelee = true;
            item.width = 40;
            item.height = 40;
            item.useTime = 20;
            item.useAnimation = 20;
            item.useStyle = 5;
            item.knockBack = 2f;
            item.value = 1000;
            item.rare = 0;
            item.UseSound = SoundID.Item1;
            item.autoReuse = false;
            item.shootSpeed = 4f;
            item.noUseGraphic = true;
            if (malwareType == 1)
            {
                item.shoot = mod.ProjectileType("BaseVirus");
                item.useAmmo = mod.ItemType("Virus");
            }
            if (malwareType == 2)
            {
                item.shoot = mod.ProjectileType("BaseWorm");
                item.useAmmo = mod.ItemType("Worm");
            }
            if (malwareType == 3)
            {
                item.shoot = mod.ProjectileType("BaseTrojan");
                item.useAmmo = mod.ItemType("Trojan");
            }
        }

        public override bool UseItem (Player player)
        {
            if (malwareType == 3)
            {
                malwareType = 1;
            }
            else
            {
                malwareType = malwareType + 1;
            }
            return true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
What am I doing wrong?
malwareType, view that code. also view the ammo code (I would recommend zip file to not spam)
 
I checked everything equipped there seems to be nothing wrong. I'm guessing it has something to do with the even more modifiers and the damage to a class or vs max life enemies. That would be my only explanation. All the other mods i have installed are just furniture and decorating mods so they wouldn't affect the damage at all.
There was a bug in EMM that caused this. It should be fixed. Have you updated the mod?
 
Heheh CONSARN IT SOMETHING HAPPENED AGAIN WHAT THE FLIP.

lol the errors because i have to lol.

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,25) : error CS0118: 'Terraria.ID.ItemID' is a 'type' but is used like a 'variable
'
c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,4) : error CS1502: The best overloaded method match for 'Terraria.ModLoader.ModRecipe.AddIngredient(Terraria.ModLoader.Mod, string, int)' has some invalid arguments

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,25) : error CS1503: Argument 1: cannot convert from 'Terraria.ID.ItemID' to 'Terraria.ModLoader.Mod'

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,19) : error CS0118: 'Terraria.ID.TileID' is a 'type' but is used like a 'variable'

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,4) : error CS1502: The best overloaded method match for 'Terraria.ModLoader.ModRecipe.AddTile(Terraria.ModLoader.Mod, string)' has some invalid arguments

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,19) : error CS1503: Argument 1: cannot convert from 'Terraria.ID.TileID' to 'Terraria.ModLoader.Mod'

Frick. what do i do? This is the second time a error happened.
 
Heheh CONSARN IT SOMETHING HAPPENED AGAIN WHAT THE FLIP.

lol the errors because i have to lol.

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,25) : error CS0118: 'Terraria.ID.ItemID' is a 'type' but is used like a 'variable
'
c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,4) : error CS1502: The best overloaded method match for 'Terraria.ModLoader.ModRecipe.AddIngredient(Terraria.ModLoader.Mod, string, int)' has some invalid arguments

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(36,25) : error CS1503: Argument 1: cannot convert from 'Terraria.ID.ItemID' to 'Terraria.ModLoader.Mod'

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,19) : error CS0118: 'Terraria.ID.TileID' is a 'type' but is used like a 'variable'

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,4) : error CS1502: The best overloaded method match for 'Terraria.ModLoader.ModRecipe.AddTile(Terraria.ModLoader.Mod, string)' has some invalid arguments

c:\Users\Owner\Documents\My Games\Terraria\Modloader\Mod Sources\RainbowsPack\Items\WorldDestroyer.cs(37,19) : error CS1503: Argument 1: cannot convert from 'Terraria.ID.TileID' to 'Terraria.ModLoader.Mod'

Frick. what do i do? This is the second time a error happened.
Looks like you need to read https://github.com/blushiemagic/tModLoader/wiki/Basic-Recipes and pay close attention to . and ,

WorldDestroyer.cs(36,25) means line 36 has the bug.




As a reminder to everyone asking code questions here, you'll find the most help if you ask in our Discord chat as no one monitors the forum for programming questions: discord.me/tModloader
 
well i was chatting stupid things in the discord server and i was sure i didn't break any of the server's rules but now i am banned can i get unbanned please ?
TNTerrarian#8293
 
Due to the way Terraria's programmed, each town NPC can only have up to 2 functional buttons. So you can have both Shop and Quest, but you won't be able to have anything else.


It's already possible. It just requires more programming experience than with Windows; and if you're making a mod, you should already have programming experience anyways.


In general that's done by checking the phase of the moon.
After your semi colon, you shouldn't have an "and". The semicolon makes the sentence a compound sentence, so "and" should not be the starting word.
 
I know this may have been said in the past but I would really love to see the ability to create mod folders to better clean up mods. When you have 30+ mods you may not want to scroll in a giant list. I know you can have modpacks and look at enabled but i would like to see a separate feature just for this. Just a suggestion. ;)
 
Back
Top Bottom