Standalone [1.3] tModLoader - A Modding API

I don't understand, if you are telling me you did the manual install, then why did you mention anything about java or "Could not find place to install to!", since that's the automatic install.
I'm rlly confused, just like u. Or is it maybe the 1.3.1 ver? I checked the tModLoader thread and it says that it also works for Terraria 1.3.1
I'M NOT BLAMING BlueMagic123 but idk
 
I'm rlly confused, just like u. Or is it maybe the 1.3.1 ver? I checked the tModLoader thread and it says that it also works for Terraria 1.3.1
I'M NOT BLAMING BlueMagic123 but idk
The reason why people are confused is because you're complaining about something that is clearly unimportant from your current situation. Why do you care if the automatic install isn't working if you've already done the manual install?
 
Cuz it doesn't work too D: ;-;
It seems there is a lot of confusion as to what your issue actually is. Many people here are using the newest update without any problems, so it must be something on your end. Please answer these questions:
- What platform are you on (Windows, Linux, Mac)?
- Are you using a non-steam version of Terraria (which won't work)?
- Have you tried both manual and automatic installs?
- What is the error you receive when using the automatic version, can you copy the text of the error here so we can further help you? (please put it in a spoiler)
- If you can open Terraria with tModLoader installed, and it crashes, what is the error? (also put in spoiler please)
 
So I'm working on making Endless Pouch-style items for just about every type of ammo in the game right now and I'm currently on rockets. At first, I could only get the celebration to fire the proper rockets but I realized that's because it converts any projectile it shoots that it classifies as ammo into the fireworks. After looking at the original item code for the Rocket items (they use different projectiles, I was using ProjectileID.RocketI for example) I fixed it working with normal rocket launchers, but I can't get it to work with the Snowman Cannon.

Here's my code for the Rocket IV box, all the others are the same except changed name and stats:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace RandomThings.Items.Ammo
{
    public class EndlessR4Crate : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Endless Rocket IV Crate";
            item.shoot = 9;
            item.damage = 65;
            item.width = 34;
            item.height = 34;
            item.ammo = 771;
            item.knockBack = 6f;
            item.value = Item.sellPrice(0, 2, 0, 0);
            item.ranged = true;
            item.rare = 2;
            item.consumable = false;
            item.toolTip = "Large blast radius. Will destroy tiles";
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.RocketIV, 3996);
            recipe.AddTile(TileID.CrystalBall);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
 
Now that tModLoader is up to speed with 1.3.1.1, have you tried all three frameskip options to see if that makes a difference?

No it still doesn't work. Minor improvement, but it's just that, MINOR. Incredibly minor actually, the lag is still there, all frame skip does is just lower the speed so that you see all the frames, it's not helping the lag issue in the slightest. Nothing is, it's an issue with Mod Loader that needs to be fixed because I'm not the only one with it. It is most definitely not an issue with my computer as Vanilla runs just fine.
 
No it still doesn't work. Minor improvement, but it's just that, MINOR. Incredibly minor actually, the lag is still there, all frame skip does is just lower the speed so that you see all the frames, it's not helping the lag issue in the slightest. Nothing is, it's an issue with Mod Loader that needs to be fixed because I'm not the only one with it. It is most definitely not an issue with my computer as Vanilla runs just fine.
I've had a problem like this before, does it do that with and without mods enabled? I've found that when I had a lot of large mods it lagged like this.
 
I've had a problem like this before, does it do that with and without mods enabled? I've found that when I had a lot of large mods it lagged like this.

Yeah, no matter what I do, I take off all the mods (made sure I reloaded and everything) and no difference, minimum settings and what not. It's not an issue of my computer when I know that it runs at 60 fps whenever I'm not running. This is a strange glitch to say the least.
 
I'm using a few mods, the big ones being Thorium and Calamity. I don't have any of the lag issues the above people do (in fact, it is highly likely that my computer has much worse hardware than said people, so there's that to consider), but I am experiencing odd absences of normally present sound effects. The sounds appear to be random; sometimes I'll never hear the slime death sound, or the ice block hit sound, or the water splash sound. These missing sounds persist until world reload (or maybe only mod reload - I didn't test enough). After removing Calamity, all sound effects have been playing without error. Is this an issue on Calamity's part, or is Terraria running into a memory barrier / too many sounds / ??? ?

EDIT: I think it just happened again (without Calamity)! This time, though, the entire underground music theme disappeared while I was playing the game. Weird.
EDIT2: Oh great, it's really still there. Life Crystal use sound effect is gone too.
EDIT3: And there goes a whole slew of sounds, including surface theme, NPC talk sound, slime death, .... sheesh what in the world is going on here...
EDIT4: I return to the main menu to discover the main menu theme is gone. WHYYY. At least this proves that world reload doesn't do anything.
EDIT5: Main menu theme suddenly returns. I reload my mods with Calamity included. Now playing game with browser closed in the hopes that it was just some strange weirdness regarding that, even though there is plenty of RAM to spare.
EDIT6: It's still happening!
 
Last edited:
This is somewhat unrelated to what you guys are talking about right now but I was wondering if someone could make sprites for my mod. I'm trying to make a mod that adds more rewards for playing in expert mode but am not able to make good sprite myself. My friend is currently making sprite for me but I don't want to make him do too much work so if someone is willing to make sprites for my mod that would be awesome :D Message me/reply if u can :)
 
How can I make an enemy spawn only in the dungeon. I've tried:

spawnInfo.dungeon
spawnInfo.worldDungeon
spawnInfo.Main.dungeon
spawnInfo.Main.Dungeon
etc.
etc.

and nothing seems to work.

I also have a problem when one of my enemy npcs jumps or turns or gets hit its texture becomes a 4 pixel wide grayish tan pillar that is as tall as the frames are and then when the npc hits the ground or starts to move in one direction or isn't being hit, the texture returns to how it's supposed to look.

help me please
 
Last edited:
How do I make a recipe require a certain sized stack of mod items? I can do stacks of vanilla items and a stack of 1 modded item.
 
I'm using a few mods, the big ones being Thorium and Calamity. I don't have any of the lag issues the above people do (in fact, it is highly likely that my computer has much worse hardware than said people, so there's that to consider), but I am experiencing odd absences of normally present sound effects. The sounds appear to be random; sometimes I'll never hear the slime death sound, or the ice block hit sound, or the water splash sound. These missing sounds persist until world reload (or maybe only mod reload - I didn't test enough). After removing Calamity, all sound effects have been playing without error. Is this an issue on Calamity's part, or is Terraria running into a memory barrier / too many sounds / ??? ?

EDIT: I think it just happened again (without Calamity)! This time, though, the entire underground music theme disappeared while I was playing the game. Weird.
EDIT2: Oh great, it's really still there. Life Crystal use sound effect is gone too.
EDIT3: And there goes a whole slew of sounds, including surface theme, NPC talk sound, slime death, .... sheesh what in the world is going on here...
EDIT4: I return to the main menu to discover the main menu theme is gone. WHYYY. At least this proves that world reload doesn't do anything.
EDIT5: Main menu theme suddenly returns. I reload my mods with Calamity included. Now playing game with browser closed in the hopes that it was just some strange weirdness regarding that, even though there is plenty of RAM to spare.
EDIT6: It's still happening!

I've not yet actually had a chance to try the 0.8.1.1 update of tModLoader, but I had this same issue on 0.8 and 0.7.x. It didn't matter which mods I ran--I even tested with no mods and it still happened. Are you on Linux or Mac? I'm on Arch Linux x86_64, and I had managed to narrow down the reason on my machine at least (not the cause, but the reason...if that makes sense). Unfortunately I never had time to figure out more or to make a proper bug report.

Anyway, Terraria (FNA, to be precise) uses OpenAL for sound on Linux, and somehow, tModLoader seems to fill up the audio queues without clearing them. Or at least that was the issue for the most similar problems Google knew about. It fits with my observations, though: if I run Terraria/tModLoader from the command line, every time it exits OpenAL spits out some information about the memory it's freeing up. For plain Terraria, that's 3 lines like this:

Code:
AL lib: (WW) FreeContext: (0x939d3f8) Deleting 2 Source(s)
AL lib: (WW) FreeDevice: (0x93aa3f0) Deleting 39 Buffer(s)
AL lib: (WW) FreeDevice: (0x93aa3f0) Deleting 1 Filter(s)

tModLoader prints the same 3 lines, but everytime I had missing sounds, the first line looked like:

Code:
AL lib: (WW) FreeContext: (0x939d3f8) Deleting 256 Source(s)

Always 256 Sources. Vanilla was never more than 3 or 4. If I only ran tModLoader for a while and quit before the issue started, the number was lower (usually in the 100-200 area). Looks like we're hitting a limit, to me. Oh yeah, but before that, as soon as the sounds start disappearing, it spews hundreds of lines of this message into my terminal:

Code:
WARNING: AL SOURCE WAS NOT AVAILABLE. SKIPPING.

AND I DON'T KNOW WHY IT HAS TO YELL AT ME BUT IT KEEPS DOING IT UNTIL I QUIT THE GAME

Ahem. So yeah, that's as far as I got. I tweaked some audio settings on my system to make sure it wasn't an issue on my end, but nothing helped. And Terraria!Prime works fine. Hopefully some others can chime in if they've had similar problems.
 
How would I make an ore only spawn in ash blocks? Or to just get an ore to spawn in the Underworld layer in general?
 
I've not yet actually had a chance to try the 0.8.1.1 update of tModLoader, but I had this same issue on 0.8 and 0.7.x. It didn't matter which mods I ran--I even tested with no mods and it still happened. Are you on Linux or Mac? I'm on Arch Linux x86_64, and I had managed to narrow down the reason on my machine at least (not the cause, but the reason...if that makes sense). Unfortunately I never had time to figure out more or to make a proper bug report.
I'm on OSX, and I don't doubt that this is the same reason over here. However, how are you launching Terraria from the command line? If I try to run Terraria without Steam, it just closes. Are you using the GoG version (Collector's Edition) or did you patch the game somehow?

Also, I put up an Issue linking to your post on the tModLoader git repo. Hopefully this will raise decent enough awareness of the problem.
 
Last edited:
I'm on OSX, and I don't doubt that this is the same reason over here. However, how are you launching Terraria from the command line? If I try to run Terraria without Steam, it just closes. Are you using the GoG version (Collector's Edition) or did you patch the game somehow?

No, I'm using the Steam version, no patching needed. It still requires Steam to be running (or it closes right away, as you say), but so long as the Steam program is open, I can just cd to the Terraria install folder ("<path-to-Steam-folder>/steamapps/common/Terraria") and its as simple as executing "./Terraria". Note that that's the "Terraria" bash-launcher script provided by Re-Logic rather than "Terraria.exe" which won't launch on its own, although running one of the "Terraria.bin.x86" or "Terraria.bin.x86_64" binary executables works as well. That's pretty much all the script does anyway: checks whether you're on OSX or Linux and chooses one of those two executables to launch. The executables, in turn, will run Terraria.exe through some secret magic (which is why they still work with tModLoader).

But I don't want to fall victim to Works4Me-ism, so I can't guarantee that this will work on the Mac. There's no reason I can see that it shouldn't, though, unless Steam does some sort of mysterious .dylib balancing-act behind the scenes. Which it could, I guess. I dunno. Let us know!

Also, I put up an Issue linking to your post on the tModLoader git repo. Hopefully this will raise decent enough awareness of the problem.

Thanks for that! Yes, hopefully so. I thought I still had some more debugging output saved somewhere, but apparently those bits evaporated from my hard drive. If I do come across it or have the time to regenerate it (and assuming it actually looks useful), I'll add it to the GitHub issue.
 
Hello, I've been fiddling with tModLoader and I've written a couple mods for it, so I'm pretty comfortable with the code base, but I believe I've found a bug with the most recent update for tModLoader (haven't tested in the previous version(s), but the bug didn't ever occur until now, so).

The issue:
When I place a switch down, attach wire, and place my item that triggers the Wiring, the player's vanity set disappears, the wiring does not trigger, and the switch toggles indefinitely (as does the sound effect). Also, the player's speed shoots up to 51mph, although no actual movement occurs. These effects are consistent with ever time I replicate the bug.

EDIT: It actually was my mod, even after I disabled it. This is confusing, but I think the issue is how I'm triggering the wiring. How can we trigger a wire pulse elsewhere on the map? I was using this code:
Code:
Point16 pt;
for(Point16 loc in ourWireLocations)
{
    Wiring.SkipWire((int)loc.X, (int)loc.Y);
    Wiring.SkipWire((int)loc.X, loc.Y - 1); // two tiles tall
  
    pt = new Point16(loc.X, loc.Y);
    Wiring._wireList.PushBack(pt);
    Wiring._toProcess.Add(pt, 4);
}
This code was working prior this most recent update, but now the bug described above is all it causes, and only if the tile that triggers the above code is connected to the switch's wire.
Any ideas on a fix?
It looks like they've added a Wiring._wireDirectionList, and you'll also have to PushBack a 0 to that.
 
Back
Top Bottom