Standalone [1.3] tModLoader - A Modding API

So I started to mod my Terraria to join some friends in a new playthrough, and we noticed that for some reason, the mod browser doesn't show mods at all, even after restarting the game. I'm on OSX, if that helps.
 
Why no V0.8.3.5 yet???
 
Why no V0.8.3.5 yet???
Ever made a mod before? neither have I, so don't rush them, asking about it won't make it come to us faster. :cool:
 
Ask that on the Thorium page

Also, can someone help me with my slime problem?
Main.npcFrameCount[npc.type] = 2; // Amount Of Slides
aiType = NPCID.RedSlime;
animationType = NPCID.RedSlime;

This Should Work. Also, that is a really good sprite
 
Main.npcFrameCount[npc.type] = 2; // Amount Of Slides
aiType = NPCID.RedSlime;
animationType = NPCID.RedSlime;

This Should Work. Also, that is a really good sprite
Thanks, the sprite was made by a guy called Nitromancer though. We are doing a mod along with Sky High and JimboPanda
 
How do i make an npc spawn in a specific biome?
And hardmode?
 
v0.8.3.5
-Updated to Terraria 1.3.3.3
-Added mod packs - ability to enable/disable groups of mods at once
-Added ability to search mod browser by author
-Added ModifyInterfaceLayers hook
-DrawLayers can now modify the DrawInfo parameter
-Added whoAmI parameter to world-drawing hooks for items
-Made Main._drawInterfaceGameTime public
-Fixed bug where custom tile kill check uses liquid placement check
-Added modpath option for dedicated server command line
-Minor fixes and improvements

Note that if you're using the PreDrawInWorld or PostDrawInWorld hook for ModItem or GlobalItem, you will have to update your mod.

Enjoy!

Edit: Also, I'm trying something new with this update. Downloads are hosted through Github instead of Mediafire. Hopefully this circumvents some problems with Mediafire some people have; also hopefully no new problems get created.
 
Last edited:
v0.8.3.5
-Updated to Terraria 1.3.3.3
-Added mod packs - ability to enable/disable groups of mods at once
-Added ability to search mod browser by author

;o
 
I think i may need to wait for the other mods to update. i just downloaded this and tried playing the game. it worked at first, but when i exited the world. my Character got corrupted. also some maps will not load now. Also when i visit the mod browser it says that i need to update this mod to the V 0.8.1 which isn't right at all. that's a much older version of this.
 
Im making an ammo bag that will cycle through and shoot random bullets. When I craft the bag, it only randomly chooses one type of ammo and will only shoot that kind. (Example, ill craft the pouch and it gets Musket shots, it will only shoot musket shots.)

Hints anyone?

Code:
    private static Random rand = new Random();
       
    public int shoot = rand.Next(15);
       
        public override void SetDefaults()
        {
            item.name = "Endless Test Pouch";
            item.damage = 1;
            item.ranged = true;
            item.width = 26;
            item.height = 34;
            item.maxStack = 1;
            item.consumable = false;
            item.knockBack = 1f;
            item.value = 20000;
            item.rare = 4;
            item.shootSpeed = 1f;
            item.ammo = ProjectileID.Bullet;
            if (shoot == 0)
            {
                item.shoot = 14;
                shoot = rand.Next(15);
            }
            if (shoot == 1)
            {
                item.shoot = 36;
                shoot = rand.Next(15);
            }
            if (shoot == 2)
            {
                item.shoot = 89;
                shoot = rand.Next(15);
            }
            if (shoot == 3)
            {
                item.shoot = 104;
                shoot = rand.Next(15);
            }
            if (shoot == 4)
            {
                item.shoot = 207;
                shoot = rand.Next(15);
            }
            if (shoot == 5)
            {
                item.shoot = 242;
                shoot = rand.Next(15);
            }
            if (shoot == 6)
            {
                item.shoot = 279;
                shoot = rand.Next(15);
            }
            if (shoot == 7)
            {
                item.shoot = 207;
                shoot = rand.Next(15);
            }
            if (shoot == 8)
            {
                item.shoot = 283;
                shoot = rand.Next(15);
            }
            if (shoot == 9)
            {
                item.shoot = 284;
                shoot = rand.Next(15);
            }
            if (shoot == 10)
            {
                item.shoot = 285;
                shoot = rand.Next(15);
            }
            if (shoot == 11)
            {
                item.shoot = 286;
                shoot = rand.Next(15);
            }
            if (shoot == 12)
            {
                item.shoot = 242;
                shoot = rand.Next(15);
            }
            if (shoot == 13)
            {
                item.shoot = 287;
                shoot = rand.Next(15);
            }
            if (shoot == 14)
            {
                item.shoot = 638;
                shoot = rand.Next(15);
            }
        }
 
I think i may need to wait for the other mods to update. i just downloaded this and tried playing the game. it worked at first, but when i exited the world. my Character got corrupted. also some maps will not load now. Also when i visit the mod browser it says that i need to update this mod to the V 0.8.1 which isn't right at all. that's a much older version of this.
Yeah I had the same problem..not with the corrupted character or anything because I didn't make a world, but it asked me to "update" to 0.8.1 :confused:
 
Yeah I had the same problem..not with the corrupted character or anything because I didn't make a world, but it asked me to "update" to 0.8.1 :confused:

@bluemagic123
V3sORok.png
 
Hey guys, been having trouble on the browser (Pre 0.8) where my characters are being automatically deleted after about 2 hours of play. This wasn't happening for a bit, so I thought it was fixed, but my most recent character disappeared once I got to Chlorophyte. (~ 6 hours of play)
I believe the problem may be related to the .Tplr extension, but even then I have no idea how to prevent it.
 
so how can i get random stuff from trees like change some of the drops to something els

it wont allow main.rand.Next(0, 10)

error CS0103: The name 'Main' does not exist in the current context

why does it say this or is there some other way to get random numbers?


int f = main.rand.Next(0, 100);
if(f >= 0 && f <= 74)
{
return mod.ItemType("ITEM NAME");
}
else if(f >= 75 && f <= 99)
{
return mod.ItemType("ITEM NAME");
}


this also gives another error to

error CS0161: MODs NAME.Tiles.trees.ITEM NAME.DropWood ()': not all code paths return a value
 
Last edited:
Im making an ammo bag that will cycle through and shoot random bullets. When I craft the bag, it only randomly chooses one type of ammo and will only shoot that kind. (Example, ill craft the pouch and it gets Musket shots, it will only shoot musket shots.)

Hints anyone?

Code:
    private static Random rand = new Random();
      
    public int shoot = rand.Next(15);
      
        public override void SetDefaults()
        {
            item.name = "Endless Test Pouch";
            item.damage = 1;
            item.ranged = true;
            item.width = 26;
            item.height = 34;
            item.maxStack = 1;
            item.consumable = false;
            item.knockBack = 1f;
            item.value = 20000;
            item.rare = 4;
            item.shootSpeed = 1f;
            item.ammo = ProjectileID.Bullet;
            if (shoot == 0)
            {
                item.shoot = 14;
                shoot = rand.Next(15);
            }
            if (shoot == 1)
            {
                item.shoot = 36;
                shoot = rand.Next(15);
            }
            if (shoot == 2)
            {
                item.shoot = 89;
                shoot = rand.Next(15);
            }
            if (shoot == 3)
            {
                item.shoot = 104;
                shoot = rand.Next(15);
            }
            if (shoot == 4)
            {
                item.shoot = 207;
                shoot = rand.Next(15);
            }
            if (shoot == 5)
            {
                item.shoot = 242;
                shoot = rand.Next(15);
            }
            if (shoot == 6)
            {
                item.shoot = 279;
                shoot = rand.Next(15);
            }
            if (shoot == 7)
            {
                item.shoot = 207;
                shoot = rand.Next(15);
            }
            if (shoot == 8)
            {
                item.shoot = 283;
                shoot = rand.Next(15);
            }
            if (shoot == 9)
            {
                item.shoot = 284;
                shoot = rand.Next(15);
            }
            if (shoot == 10)
            {
                item.shoot = 285;
                shoot = rand.Next(15);
            }
            if (shoot == 11)
            {
                item.shoot = 286;
                shoot = rand.Next(15);
            }
            if (shoot == 12)
            {
                item.shoot = 242;
                shoot = rand.Next(15);
            }
            if (shoot == 13)
            {
                item.shoot = 287;
                shoot = rand.Next(15);
            }
            if (shoot == 14)
            {
                item.shoot = 638;
                shoot = rand.Next(15);
            }
        }

maybe do the random thing befor the bullets

try this (not tested)


if (0 == 0)
{
shoot = rand.Next(15);
}
if (shoot == 0)
{
item.shoot = 14;
}
if (shoot == 0)
{
item.shoot = 36;
}
so on

again (not tested)
 
so how can i get random stuff from trees like change some of the drops to something els

it wont allow main.rand.Next(0, 10)

error CS0103: The name 'Main' does not exist in the current context

why does it say this or is there some other way to get random numbers?


int f = main.rand.Next(0, 100);
if(f >= 0 && f <= 74)
{
return mod.ItemType("ITEM NAME");
}
else if(f >= 75 && f <= 99)
{
return mod.ItemType("ITEM NAME");
}


this also gives another error to

error CS0161: MODs NAME.Tiles.trees.ITEM NAME.DropWood ()': not all code paths return a value
That error means that the compiler thinks it's possible for the game to get through all of the code without returning a value. Fix this by replacing the last 'else if (condition)' with 'else'. You don't really need it anyway because either it won't be reached or it will always return true.
 
Back
Top Bottom