Standalone [1.3] tModLoader - A Modding API

Thanks! This is exactly what I was looking for. Is the full frame displayed or is there a border/buffer between frames?

- Aerlock
There's no buffer between frames. The row of dots in each frame is the very bottom of that frame. The row below that is the very top of the next frame.

Other people may find this useful, but it's already disappeared behind several pages in less than a day. I wonder if there's somewhere this could be uploaded for people to find easily?
 

Attachments

  • Player Frame Template.png
    Player Frame Template.png
    6.5 KB · Views: 166
Several of our clients have been asking us to support this mod loader for our Terraria Hosting solution, so along with Tshock, we are now providing a one click solution, if you are looking for a possible host that supports tModloader, please consider us, we have a forum thread here
 
There's no buffer between frames. The row of dots in each frame is the very bottom of that frame. The row below that is the very top of the next frame.

Other people may find this useful, but it's already disappeared behind several pages in less than a day. I wonder if there's somewhere this could be uploaded for people to find easily?
Maybe we could ask bluemagic123 to include it in the example mod?

- Aerlock
 
If I could get some quick assistance with this, it would be much appreciated... I have a 1x3 tile that's a lamp. I have it producing light when it has no wire active on it, and I have it so it stops producing light when its activated by a wire; So it functions just like vanilla lamps. But the issue is each individual segment of the lamp can be turned on and off. Can I be informed about what I'm missing in my code in order to make all segments of the lamp react to wire power?
Code:
public override void HitWire(int i, int j)
        {
            Tile tile = Main.tile[i, j];
            int x = i - (Main.tile[i, j].frameX / 16) % 1;
            int y = j - (Main.tile[i, j].frameY / 18) % 3;
            if (Wiring.running)
            {
                tile.frameX += 18;
            }
            if (tile.frameX >= 36)
            {
                tile.frameX -= 36;
            }
        }
 
How would you change the type of damage a vanilla weapon does. Like change a boomerangs damage from melee to thrown.
Like this, only changing the melee to false and thrown to true: https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/Items/CopperShortsword.cs#L11

If I could get some quick assistance with this, it would be much appreciated... I have a 1x3 tile that's a lamp. I have it producing light when it has no wire active on it, and I have it so it stops producing light when its activated by a wire; So it functions just like vanilla lamps. But the issue is each individual segment of the lamp can be turned on and off. Can I be informed about what I'm missing in my code in order to make all segments of the lamp react to wire power?
Code:
public override void HitWire(int i, int j)
        {
            Tile tile = Main.tile[i, j];
            int x = i - (Main.tile[i, j].frameX / 16) % 1;
            int y = j - (Main.tile[i, j].frameY / 18) % 3;
            if (Wiring.running)
            {
                tile.frameX += 18;
            }
            if (tile.frameX >= 36)
            {
                tile.frameX -= 36;
            }
        }
You sure you want that to be 18? Anyway, you need to loop through the tiles, change all the frames, and set skip wire. The code you have currently only finds the coordinates of the top left tile.

https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/Tiles/VoidMonolith.cs#L90
 
Thanks but when i did i got this error.

Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)

I think I did it right.

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items
{
public class WoodenBoomerang : GlobalItem
{
public override void SetDefaults(Item item)
{
if (item.type == ItemID.WoodenBoomerang)
{
item.melee = false;
item.thrown = true;
}
}
}
}
 
Last edited:
Thanks but when i did i got this error.

Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)

I think I did it right.

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items
{
public class WoodenBoomerang : GlobalItem
{
public override void SetDefaults(Item item)
{
if (item.type == ItemID.WoodenBoomerang)
{
item.melee = false;
item.thrown = true;
}
}
}
}
Every mod needs a Mod class.

Code:
using Terraria.ModLoader;

namespace a
{
    class a : Mod
    {
        public a()
        {
            Properties = new ModProperties()
            {
                Autoload = true,
                AutoloadGores = true,
                AutoloadSounds = true
            };
        }
    }
}
 
So at last I got everything ready for the increased max life, using an item that can be eaten, using SaveCustomData.
Yet just now I noticed. I used the item that pass the value to the counter and my max life get increased just right and it's permanent. However, I got a glimpse at the character select UI and, in surprise, it remains 500 unchanged. But this doesn't influence the gaming experience.
Since I'm some perfectionist, so I was wandering whether there is any solution for this?
 
So at last I got everything ready for the increased max life, using an item that can be eaten, using SaveCustomData.
Yet just now I noticed. I used the item that pass the value to the counter and my max life get increased just right and it's permanent. However, I got a glimpse at the character select UI and, in surprise, it remains 500 unchanged. But this doesn't influence the gaming experience.
Since I'm some perfectionist, so I was wandering whether there is any solution for this?
The way i suggested works that way, but blue told you another way to prevent other conflicts. So....not really.
 
The way i suggested works that way, but blue told you another way to prevent other conflicts. So....not really.
Well, then I guess I'd better leave it alone. Things that are too complex will make my head suffer.
By the way, I actually got an idea recently - adding aura into Terraria.
So basically make something like Dryad's nature power. Only I want to make it on a player. In a way... let's say someone equipped something and in a particular range, all his teammates and him get the aura buff?
I guess The Wall of Flesh has the same function. Since I've searching in source code and found nothing. Maybe I can get some wise tips from ya?
 
Could someone possibly help me with this recipe? I keep getting errors about expected parenthesis in odd places..

Code:
public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient((ItemID.BeeWax, 15) && (ItemID.SpiderFang, 20) && (ItemID.SpookyWood, 500) && (ItemID.SummonerEmblem) && (ItemID.PygmyNecklace) && (ItemID.PapyrusScarab) && (ItemID.BlackLens, 5) && (ItemID.SuspiciousLookingTentacle));
            recipe.AddTile(null, "Tinkerer's Workshop");
            recipe.SetResult(this);
            recipe.AddRecipe();

I'm a complete rookie I know
 
Last edited:
Could someone possibly help me with this recipe? I keep getting errors about expected parenthesis in odd places..

Code:
public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient((ItemID.BeeWax, 15) && (ItemID.SpiderFang, 20) && (ItemID.SpookyWood, 500) && (ItemID.SummonerEmblem) && (ItemID.PygmyNecklace) && (ItemID.PapyrusScarab) && (ItemID.BlackLens, 5) && (ItemID.SuspiciousLookingTentacle));
            recipe.AddTile(null, "Tinkerer's Workshop");
            recipe.SetResult(this);
            recipe.AddRecipe();

I'm a complete rookie I know

The && operator (Conditional-AND) is used to check if multiple conditions are all satisfied in for instance an if statement. It can't be used to add more parameters. You have to call AddIngredient for every single ingredient individually.
Code:
public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.BeeWax, 15);;
            recipe.AddIngredient(ItemID.SpiderFang, 20);
            recipe.AddIngredient(ItemID.SpookyWood, 500);
            recipe.AddIngredient(ItemID.SummonerEmblem);
            recipe.AddIngredient(ItemID.PygmyNecklace);
            recipe.AddIngredient(ItemID.PapyrusScarab);
            recipe.AddIngredient(ItemID.BlackLens, 5);
            recipe.AddIngredient(ItemID.SuspiciousLookingTentacle);
            recipe.AddTile(null, "Tinkerer's Workshop");
            recipe.SetResult(this);
            recipe.AddRecipe();
}
 
I found the problem on my mods, its the adventurer mod is what causing the sarcophagus to spawn at night, is there a way to remove the sarcophagus?
and the mod doesnt have any thread here :(
I wouldn't really recommend using a mod if you don't know what it does, especially if it doesn't have any informational page.

When my friend trys to upload his mod it says An error ocurred while compiling a mod. error CS1703: An assembly with the same identity 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' has already been imported, Try removing one of the duplicate references.
You need to delete Newtonsoft.Json.dll from your Terraria Steam folder.

So at last I got everything ready for the increased max life, using an item that can be eaten, using SaveCustomData.
Yet just now I noticed. I used the item that pass the value to the counter and my max life get increased just right and it's permanent. However, I got a glimpse at the character select UI and, in surprise, it remains 500 unchanged. But this doesn't influence the gaming experience.
Since I'm some perfectionist, so I was wandering whether there is any solution for this?
Hm, we can probably do something about that in the next update.
 
1) Happens with ALL players
2) No,it still happens.
3) It doesn't happen,vanilla works fine.
4) Yes
5) He has a very good PC.
6) Nothing much,just skype sometimes and steam.
Perhaps try starting over from scratch with tModLoader. By that I mean:
delete/rename your existing Terraria and save game folders
then reinstall vanilla Terraria
Confirm no problems with medium and large worlds in vanilla
Install tModLoader with no mods
Check again with medium and large worlds and see if the error appears.

If that doesn't work then I hope someone else has an idea because I'm about tapped out.

- Aerlock
 
Since there has been a long time from last time I'd been always engaging with Terraria's mods, tModLoader has updated 2 versions.
So am I able to modify settings about Worldgen now? In particular it's that question I asked long long ago, when blue, your answer is you don't like to write a hook that severs too narrowly.
It's just - can I remove the dispersion of crimson or corrupt blocks? Or can I remove (better modify) the generation of the big "V" blocks when hardmode is activated?
I don't yet sure whether this has something to do with the Worldgen... I simply think it's about the world and I guess bla bla bla...
 
Back
Top Bottom