Standalone [1.3] tModLoader - A Modding API

Correct me if I'm wrong, but minions have been added in the 0.7 update...
hey! I love the mod launcher you've created to help us experience terraria as it was meant to be played: with a million mods installed at once :p...that being said..there's 1 thing you still need to add......if you don't add in minion support within the next 2 years..preferably sooner..you're gonna have a Bad Time~


sans_512.jpg
Minions were already possible in 0.6, although you had to 'override' the old minions for that.
Now with v0.7 out (and player hooks), minions are able to be fully integrated so yeah, possible.
 
Minions were already possible in 0.6, although you had to 'override' the old minions for that.
Now with v0.7 out (and player hooks), minions are able to be fully integrated so yeah, possible.
!!..really?..well....time to tell zadum and pumpking about this~
 
First of all, why are you looping through all recipes if you know which index you want?
Second, why are you resetting the WHOLE Main.recipe array?
Then which recipe are you trying to access? You'll probably want to modify the recipe at the given index, right?
All things together, this ain't gonna work. I'm currently not behind my own PC, so I can't look at the source of Terraria, but you'll probably want to start with the following: get the recipe via 'Main.recipe[3509]'. Then modify the ingredients and tiles needed for the recipe (look into the source to see how to do that). The ingredients and tiles needed are both being kept in an array, so you're probably looking for two integer arrays.
When i use Main.recipe[3509] it gives error. Do i right search recipe? For example, ID of CopperPickaxe 3509. Maybe I'm looking for is not it?
 
Hey, does anyone know how to make an item that displays everything the way Cell Phone does?
[DOUBLEPOST=1453042477,1453042180][/DOUBLEPOST]Second question:
I made a pet and it works and everything BUT, its buff doesn't display. I tried everything, I copied a lot of code from my other working buff and it still doesn't display anything. Most of the rest is copied off of the ExamplePet.

Code:
namespace EnthusiastMod
{
    public class ModdedPlayer : ModPlayer
    {
        public bool babyPanda = false;
    }
}
Code:
namespace EnthusiastMod.Projectiles
{
    public class BabyPanda_Pet : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.CloneDefaults(ProjectileID.PetLizard);
            projectile.name = "Baby panda";
            aiType = ProjectileID.PetLizard;
            Main.projFrames[projectile.type] = 10;
            projectile.width = 48;
            projectile.height = 42;
            Main.projPet[projectile.type] = true;
            projectile.tileCollide = true;
            projectile.penetrate = -1;
            projectile.ignoreWater = false;
        }

        public override bool PreAI()
        {
            Player player = Main.player[projectile.owner];
            player.lizard = false;
            return true;
        }

        public override void AI()
        {
            if (projectile.rotation < -0.25f) projectile.rotation = -0.25f;
            if (projectile.rotation > 0.25f) projectile.rotation = 0.25f;
            Player player = Main.player[projectile.owner];
            ModdedPlayer modPlayer = (ModdedPlayer)player.GetModPlayer(mod, "ModdedPlayer");
            if (player.dead)
            {
                modPlayer.babyPanda = false;
            }
            if (modPlayer.babyPanda)
            {
                projectile.timeLeft = 2;
            }
        }
    }
}
Code:
namespace EnthusiastMod.Buffs
{
    public class BabyPanda_Buff : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffName[this.Type] = "Baby panda pet";
            Main.buffTip[this.Type] = "Baby panda is following you!";
            Main.buffNoTimeDisplay[Type] = true;
            Main.vanityPet[Type] = true;
            Main.buffNoSave[Type] = true;
        }

        public override void Update(Player player, ref int buffIndex)
        {
            player.buffTime[buffIndex] = 18000;
            ((ModdedPlayer)player.GetModPlayer(mod, "ModdedPlayer")).babyPanda = true;
            bool petProjectileNotSpawned = true;
            if (player.ownedProjectileCounts[mod.ProjectileType("babyPanda")] > 0)
            {
                petProjectileNotSpawned = false;
            }
            if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
            {
                Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("babyPanda"), 0, 0f, player.whoAmI, 0f, 0f);
            }
        }
    }
}

As it turns out, the ExamplePet doesn't display buff either... :D
 
When i use Main.recipe[3509] it gives error. Do i right search recipe? For example, ID of CopperPickaxe 3509. Maybe I'm looking for is not it?
Try to see if you can find the recipe you're looking for in the Recipe.cs code.
Also, not all items have a recipe, so they're not indexed on their item type (I think). You'll just have to know the index of the item, OR indeed loop through Main.recipe and check if the recipe at the given index yields the item you're looking for as the recipe result.
 
I think you're missing these (?)
Code:
public override bool CanTownNPCSpawn(int numTownNPCs, int money)
        {
            return true;
        }

        public override bool CheckConditions(int left, int right, int top, int bottom)
        {
            return true;
        }
No matter how long I wait he doesn't spawn. So maybe there is a problem with the code?
 
I'm really sorry for bothering y'all, but when I try to run Tmod I am having a big problem. The title screen and all that is running fine, but when I play I can't really get through the unbeliavable lag. I am getting solid 1 FPS. Is this something to do with tmodloader or the ammount of mods I have loaded? I am leaning towards the latter. If so, deleting some mods will do the job?
 
I'm really sorry for bothering y'all, but when I try to run Tmod I am having a big problem. The title screen and all that is running fine, but when I play I can't really get through the unbeliavable lag. I am getting solid 1 FPS. Is this something to do with tmodloader or the ammount of mods I have loaded? I am leaning towards the latter. If so, deleting some mods will do the job?
1 FPS is EXTREME in this case. How many mods do you currently have installed? And while on the subject which?
 
how do i install 0.7 version of the tModLoader be couse i cant can someone make a tutorial please i just dont know how to install the 0.7 version
:(
Okay, i got it, but how will i uninstall modloader when i dont need it?
Thanks, for tutorial btw!
 
12 mods as of now, 11 enabled. Helpful hotkeys, Faster Potions, Creative Mode Mod(disabled), true eternity, the luggage, quality of life, energy mod, battlehardened npcs, summoner's association, gmod, maxstack plus and Tremor mods. Pardon me for this inconvenience.
 
WuxufCK.png
MediaFire won't let me download ExampleMod because of copyrighted music in the mod. Can you please use something royalty-free for the "music replacement" example instead?
 
Last edited:
Okay, i got it, but how will i uninstall modloader when i dont need it?
Thanks, for tutorial btw!
You don't need to 'uninstall' it. If all's well, you should have a 'Terraria.exe' file and a 'Terrariav1.3.somethingElse.exe' in your steam folder. If you just rename the 'Terraria.exe' to something like 'Terraria_ModLoader.exe' and the other .exe file to 'Terraria.exe' you're ready to play the vanilla version. If you wanna go back to the tModLoader version, just change the names again ;)
12 mods as of now, 11 enabled. Helpful hotkeys, Faster Potions, Creative Mode Mod(disabled), true eternity, the luggage, quality of life, energy mod, battlehardened npcs, summoner's association, gmod, maxstack plus and Tremor mods. Pardon me for this inconvenience.
Hmm, I would try disabling them all first. If the lag persists it should be something else. If not, re-activate them one by one and see when the lag kicks in, then come back here! :D
 
1 FPS is EXTREME in this case. How many mods do you currently have installed? And while on the subject which?
I can't do it anymore. I've done about 20 codes, but neither works.
It's code from Terraria.Recipe:
yrGOY1h.png

Help me please, it's last problem which i can't decide
 
I can't do it anymore. I've done about 20 codes, but neither works.
It's code from Terraria.Recipe:
yrGOY1h.png

Help me please, it's last problem which i can't decide
Code:
for(int i = 0; i < Main.recipe.Length; ++i)
{
    if(Main.recipe[i].createItem.type == 3509)
    {
        // Here you can use the same functions you see in the code snippet you gave when accessing Main.recipe[i].
    }
}
 
The culprit seems to be the MaxStack plus mod, as soon as I enabled it the lag kicked in full force. I might do some tests with only that mod enabled to failsafe it. Edit: it hugely seems to be the case. With only it enabled, I top my FPS at 8 and get a solid 5 FPS most of the time.
 
Code:
for(int i = 0; i < Main.recipe.Length; ++i)
{
    if(Main.recipe[i].createItem.type == 3509)
    {
        // Here you can use the same functions you see in the code snippet you gave when accessing Main.recipe[i].
    }
}
Code:
for(int i = 0; i < Main.recipe.Length; ++i)
{
    if(Main.recipe[i].createItem.type == 3509)
    {
        // Here you can use the same functions you see in the code snippet you gave when accessing Main.recipe[i].
    }
}
YEAH, IT'S WORKS! I went to jump off the roof, thank you!!!
 
YEAH, IT'S WORKS! I went to jump off the roof, thank you!!!
Oh dear, I hope you survived that...
The culprit seems to be the MaxStack plus mod, as soon as I enabled it the lag kicked in full force. I might do some tests with only that mod enabled to failsafe it. Edit: it hugely seems to be the case. With only it enabled, I top my FPS at 8 and get a solid 5 FPS most of the time.
Hmm, then it'd possibly be viable to take this question over there, to see if the creator/other people are also affected. If that's the case, it has something to do with the mod ;)
 
When opening Terraria with tmodloader installed, I recieve errors for every mod, and tmodloader disables them. I am using Linux, and it appears others who've gotten this error also are using Linux.

INTERNAL configuration error: failed to get configuration 'system.diagnostics'
at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceImpl.InitOnce () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceImpl.get_Listeners () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceImpl.get_ListenersSyncRoot () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceImpl.WriteLine (System.String message, System.String category) [0x00000] in <filename unknown>:0
at System.Diagnostics.Trace.WriteLine (System.String message, System.String category) [0x00000] in <filename unknown>:0
at MP3Sharp.Decoding.Bitstream.isSyncMark (Int32 headerstring, Int32 syncmode, Int32 word) [0x00000] in <filename unknown>:0
at MP3Sharp.Decoding.Bitstream.syncHeader (SByte syncmode) [0x00000] in <filename unknown>:0
at MP3Sharp.Decoding.Header.read_header (MP3Sharp.Decoding.Bitstream stream, MP3Sharp.Decoding.Crc16[] crcp) [0x00000] in <filename unknown>:0
at MP3Sharp.Decoding.Bitstream.readNextFrame () [0x00000] in <filename unknown>:0
at MP3Sharp.Decoding.Bitstream.readFrame () [0x00000] in <filename unknown>:0
at MP3Sharp.MP3Stream.ReadFrame () [0x00000] in <filename unknown>:0
at MP3Sharp.MP3Stream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at System.IO.Stream.CopyTo (System.IO.Stream destination, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.Stream.CopyTo (System.IO.Stream destination) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Stream:CopyTo (System.IO.Stream)
at Terraria.ModLoader.ModLoader.LoadMod (Terraria.ModLoader.IO.TmodFile modFile, Terraria.ModLoader.BuildProperties properties) [0x00000] in <filename unknown>:0
at Terraria.ModLoader.ModLoader.LoadMods () [0x00000] in <filename unknown>:0

The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Terraria.ModLoader.ModLoader.LoadMod (Terraria.ModLoader.IO.TmodFile modFile, Terraria.ModLoader.BuildProperties properties) [0x00000] in <filename unknown>:0
at Terraria.ModLoader.ModLoader.LoadMods () [0x00000] in <filename unknown>:0

Because I'm recieving an error that says "filename unknown" in both mods, I believe this is an issue with tmodloader.

Bumping this so it doesn't get missed. I've tested some more out and it seems that every feature is broken in some way, making this loader unusuable on Linux.

http://javid.ddns.net/tmodloader/listmods.php
at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0
at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0
at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in <filename unknown>:0
at Terraria.ModLoader.IO.UploadFile.UploadFiles (System.String address, IEnumerable`1 files, System.Collections.Specialized.NameValueCollection values) [0x00000] in <filename unknown>:0
at Terraria.ModLoader.UI.UIModBrowser.OnActivate () [0x00000] in <filename unknown>:0

The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
at Terraria.ModLoader.ModLoader.LoadMod (Terraria.ModLoader.IO.TmodFile modFile, Terraria.ModLoader.BuildProperties properties) [0x00000] in <filename unknown>:0
at Terraria.ModLoader.ModLoader.LoadMods () [0x00000] in <filename unknown>:0

(0,0) : error : ERROR: ld.so: object '/home/USERNAME/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
(0,0) : error : ERROR: ld.so: object '/home/USERNAME/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
(0,0) : error : Native stacktrace:
(0,0) : error : /usr/bin/mono() [0x4a0cff]
(0,0) : error : /usr/lib/libpthread.so.0(+0x10d60) [0x7fd72ccf6d60]
(0,0) : error : /usr/lib/libc.so.6(gsignal+0x38) [0x7fd72c9715f8]
(0,0) : error : /usr/lib/libc.so.6(abort+0x16a) [0x7fd72c972a7a]
(0,0) : error : /usr/bin/mono() [0x631349]
(0,0) : error : /usr/bin/mono() [0x6315dc]
(0,0) : error : /usr/bin/mono() [0x631773]
(0,0) : error : /usr/bin/mono() [0x5a455e]
(0,0) : error : /usr/bin/mono() [0x4286ae]
(0,0) : error : /usr/bin/mono(mono_main+0x2cb) [0x47688b]
(0,0) : error : /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7fd72c95e610]
(0,0) : error : /usr/bin/mono(_start+0x29) [0x4236e9]
(0,0) : error : Debug info from gdb:
(0,0) : error : =================================================================
(0,0) : error : Got a SIGABRT while executing native code. This usually indicates
(0,0) : error : a fatal error in the mono runtime or one of the native libraries
(0,0) : error : used by your application.
(0,0) : error : =================================================================
This one is different than the others, instead of saying "filename unknown" it seems to be having problems with Mono.

Has anybody else recieved these errors recently?
 
Back
Top Bottom