• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone [1.3] tModLoader - A Modding API

jopojelly

Retinazer
Hey there, long time no see! So, I've got a problem: When I try to insert code into the SetDefaults(NPC npc) override on a GlobalNPC class, it breaks mods like Calamity and Tremor giving me this message:

"
Object reference not defined for an instance of an object.
in Dmode.DModeNPC.SetDefaults(NPC npc)
in Terraria.ModLoader.NPCLoader.SetDefaults(NPC npc, Boolean createModNPC)
in Terraria.ModLoader.Mod.SetupContent()
in Terraria.ModLoader.ModLoader.doLoad(Object threadContext)
"

Details: This showed up from nowhere, before, I was able to run both mods together with no problems.


And this one also shows up when I use any kind of user interface.
My guess is you are trying to use Main.rand in SetDefaults, which is a bad idea. Also, come to discord, you'll get live help there: discord.me/tModloader
 
So 1.3.6 is coming soon (if not 2096) and looking to the added features and with my medium modding experi I can tell that the mods needs to add a frame for all armors and vanity when sitting but one question if a mod is adding a biome will he need to add the wind effects or the update tmodloader will handle it ? Also I'm trying to make a custom shader for my mod but I don't know what shape the sprite should be (example shader is compressed to xnb and I can't extract it) and I want to know the shape of an animated one too
 

Yvori

Terrarian
So 1.3.6 is coming soon (if not 2096) and looking to the added features and with my medium modding experi I can tell that the mods needs to add a frame for all armors and vanity when sitting but one question if a mod is adding a biome will he need to add the wind effects or the update tmodloader will handle it ? Also I'm trying to make a custom shader for my mod but I don't know what shape the sprite should be (example shader is compressed to xnb and I can't extract it) and I want to know the shape of an animated one too
They won't need to add frames, actually. If I recall, the whole reason for them being amazed they managed to add sitting is because it *didn't* require a new frame, and presumably uses some sprite piece rendering trickery like the Crouch, Crawl, and Roll mod, or Terraria Overhaul.

The wind may be a tad more difficult however.
 

HyperSniper

Terrarian
Hi everybody! I just figured out how to download this after triumphantly finding my steam folder after several months! Don't worry, I have it working properly, but it just recommended to me that I download the latest version (v0.10.1.5). I can't seem to find anything on this site that allows me to download it, so if someone can show me to the new version, I'd appreciate it greatly! Thanks!
 

Yvori

Terrarian
Hi everybody! I just figured out how to download this after triumphantly finding my steam folder after several months! Don't worry, I have it working properly, but it just recommended to me that I download the latest version (v0.10.1.5). I can't seem to find anything on this site that allows me to download it, so if someone can show me to the new version, I'd appreciate it greatly! Thanks!
First post in this thread, near the bottom. I'd direct link but I don't know what platform you're on.
upload_2018-12-28_18-24-46.png
 

Generic Name

Terrarian
Hey, know I'm kinda late to this forum, but I was an idiot and decided to enable every single mod I have ever downloaded. It loads up to the point where it says Setting Up, then freezes and closes. Can anyone help me with this?
 

direwolf420

Terrarian
Hey, know I'm kinda late to this forum, but I was an idiot and decided to enable every single mod I have ever downloaded. It loads up to the point where it says Setting Up, then freezes and closes. Can anyone help me with this?
inside your Mod folder, there is a enabled.json file
set half or all of them to false and then try again
 

Chapface

Terrarian
So, in a mod im making I added a minion. Everything works except I cant un-summon it. I can replace it with another minion but the minion doesn't go away after canceling the buff, would this problem be in the buff itself? or would it be in the Projectile? That way I know what code to post for the problem searching.
 
Last edited:

direwolf420

Terrarian
So, in a mod im making I added a minion. Everything works except I cant un-summon it. I can replace it with another minion but the minion doesn't go away after canceling the buff, would this problem be in the buff itself? or would it be in the Projectile? That way I know what code to post for the problem searching.
did you set a projectile.timeLeft correctly?
like here: https://github.com/blushiemagic/tModLoader/blob/master/ExampleMod/Projectiles/Minions/PurityWisp.cs#L34
 
Last edited:

Chapface

Terrarian
did you set a projectile.timeout correctly?
I dont actually think I put "projectile.timeout" in it. I have "projectile.timeLeft" in it though.

Here is the code just in case:

Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace BATIM.Projectiles.Minions
{
    public class BabyBlob : ModProjectile
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Baby Blob");
            Main.projFrames[projectile.type] = 6;
            ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
            ProjectileID.Sets.Homing[projectile.type] = true;
            ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
        }
          
        public override void SetDefaults()
        {
            projectile.CloneDefaults(ProjectileID.BabySlime);
            aiType = ProjectileID.BabySlime;
            projectile.friendly = true;
            projectile.minion = true;
            projectile.minionSlots = 1;
            projectile.tileCollide = true;
            projectile.ignoreWater = true;
            projectile.alpha = 0;
            projectile.width = 30;
            projectile.height = 28;
            projectile.penetrate = -1;
            projectile.timeLeft = 18000;
        }

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

        public override void AI()
        {
            Player player = Main.player[projectile.owner];
            BATIMPlayer modPlayer = player.GetModPlayer<BATIMPlayer>(mod);
            if (player.dead)
            {
                modPlayer.BabyBlob = false;
            }
            if (modPlayer.BabyBlob)
            {
                projectile.timeLeft = 2;
            }
        }
      
      
        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            if (projectile.penetrate == 0)
            {
                projectile.Kill();
            }
            return false;
            }
    }
}
Edit: I didn't notice the link before, from the looks of it however I did do it correctly
(I could be entirely wrong though)
 

direwolf420

Terrarian
I dont actually think I put "projectile.timeout" in it. I have "projectile.timeLeft" in it though.
Edit: I didn't notice the link before, from the looks of it however I did do it correctly
(I could be entirely wrong though)
you need to reset modPlayer.BabyBlob in ResetEffects() in your player class
 

Chapface

Terrarian
I think I did that already, is this right:

Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.GameInput;

namespace BATIM
{
    public class BATIMPlayer : ModPlayer
    {
        public bool FlyingInkBlot = false;
        public bool BabyBlob = false;
    }
}
Ok, I added the reset thing, but now it says the following message:

Code:
c:\Users:owner\Documents\My Games\ Terraria\Modloader\Mod Sources\BATIM\ BatimPlayer.cs(26,1) : error CS1513:
} expected
this would be an easy fix but I did it properly from my understanding

Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.GameInput;

namespace BATIM
{
    public class BATIMPlayer : ModPlayer
    {
        public bool FlyingInkBlot = false;
        public bool BabyBlob = false;
      
        public override void ResetEffects()
        {
            public bool FlyingInkBlot = false;
            public bool BabyBlob = false;
        }

    }
}
Edit: I found my obvious mistake and fixed it. thanks for the previous help
 
Last edited:

Yvori

Terrarian
Hey, know I'm kinda late to this forum, but I was an idiot and decided to enable every single mod I have ever downloaded. It loads up to the point where it says Setting Up, then freezes and closes. Can anyone help me with this?
An easy way to deal with this is to hold Shift before it gets to the mod loading. It will then automatically not load in your mods, just tModLoader, so you'll be able to disable them from the mods menu. Generally, too many mods will overload Terraria due to its nature as a 32 bit program, and therefore its 4GB memory limit.
As has already been stated by others, you can also manually edit the enabled.json, or if you really want to, you can delete the .tmod files from your Mods folder to entirely uninstall them (usually Documents\My Games\Terraria\ModLoader\Mods, which if I recall, is also where enabled.json is located.)
 
Top Bottom