Standalone [1.3] tModLoader - A Modding API

I am making a King Slime-type boss called Queen Slime and I need it to be able to teleport can someone help? (and no, I'm not just talking about KS's default AI)
 
So, next problems, happens oftne when im talking to npcs, buying something from them

Playing on multiplayer, we have spomething around 30 mods, he doesn't have this problem.
gQ0cFIv.png
 
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.
So, next problems, happens oftne when im talking to npcs, buying something from them

Playing on multiplayer, we have spomething around 30 mods, he doesn't have this problem.
gQ0cFIv.png

And this one also shows up when I use any kind of user interface.
 
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
 
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.
 
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!
 
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
 
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?
 
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
 
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:
Last edited:
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)
 
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
 
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:
Back
Top Bottom