Standalone [1.3] tModLoader - A Modding API

Hi, I have a problem that needs to be solver! :D
I am creating my own npc, but when i load game it doesn't have her head on minimap and i also cant move her to house, because the option isnt here!
+ If you could write me the sounds from woman npcs so i can give it to her xd
Code(the drop thing and buy thing are not completedxddd)
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace tristanajanna.NPCs.TownNPC
{
    public class themermaid : ModNPC
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("The Mermaid");    
        }    
        public override void SetDefaults()
        {        
            npc.townNPC = true;
            npc.friendly = true;
            npc.width = 18;
            npc.height = 56;
            npc.aiStyle = 7;
            npc.damage = 25;
            npc.defense = 25;
            npc.lifeMax = 250;
            npc.HitSound = SoundID.NPCHit1;
            npc.DeathSound = SoundID.NPCDeath1;
            npc.knockBackResist = 0.5f;
            Main.npcFrameCount[npc.type] = 23;        
            animationType = NPCID.Stylist;
        }

        public override bool CanTownNPCSpawn(int numTownNPCs, int money) ///spawnuje se kdyz je vytvoren v inventari mod item Mermaid's Lost Pearl
        {
            for (int k = 0; k < 255; k++)
            {
                Player player = Main.player[k];
                if (player.active)
                {
                    for (int j = 0; j < player.inventory.Length; j++)
                    {
                        if (player.inventory[j].type == mod.ItemType("starfishamulet"))
                        {
                            return true;
                        }
                    }
                }
            }
            return false;
        }



        public override string TownNPCName()
        {                                        //NPC names
            switch (WorldGen.genRand.Next(11))
            {
                case 0:
                    return "Ariel";
                case 1:
                    return "Tetra";
                case 2:
                    return "Ava";
                case 3:
                    return "Khoii";
                case 4:
                    return "Coralia";
                case 5:
                    return "Watery";
                case 6:
                    return "Leaf";
                case 7:
                    return "Lorelei";
                case 8:
                    return "Melody";
                case 9:
                    return "Marina";            
                default:
                    return "Nami";
            }
        }




        public override string GetChat()
        {                                             //npc chat
      
            switch (Main.rand.Next(5))
            {
                case 0:
                    return "People and their air...";
                case 1:
                    return "I decide what the tide will bring!";
                case 2:
                    return "Swim at your own risk!";
                case 3:
                    return "Afraid to get your feet wet?";                
                default:
                    return "Thanks a lot for bringing me my lost pearl!";
            }
        }

        public override void SetChatButtons(ref string button, ref string button2)
        {
            button = "Treasure Shop";
        }

        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (firstButton)
            {
                shop = true;
            }
        }

        public override void SetupShop(Chest shop, ref int nextSlot)
        {
            shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet")); //items that sells
            nextSlot++;
            shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet"));
            nextSlot++;
            if (Main.hardMode == true) //Checks if the world is hardmode
            shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet"));
            nextSlot++;
        }

        public override void NPCLoot()
        {
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("starfishamulet"));
        }

        public override bool UsesPartyHat()
        {
            return false;
        }    
    }
}
Had the same problem. You need to use an AutoLoad.Head thingy. I can post what you're missing, if i'll get to my pc tomorrow. Or check example mod, ExamplePerson
 
Why is it doing this I have Terraria version 1.3.5.2 and my TModLoader version is 0.10.1.1

Like why and how can I fix it?
 

Attachments

  • 50C8B381-E384-45ED-BE1E-5DF708557373.jpeg
    50C8B381-E384-45ED-BE1E-5DF708557373.jpeg
    3.9 MB · Views: 211
  • 63E0FFF4-69D4-48C1-A073-FA3C2C437E14.jpeg
    63E0FFF4-69D4-48C1-A073-FA3C2C437E14.jpeg
    4.1 MB · Views: 200
Hey so I'm having an error when using a mod and the devs don't know how to fix it. Any ideas?
 

Attachments

  • help me.jpg
    help me.jpg
    183.8 KB · Views: 192
This is perfect and i love it! it is just that errors keep happening like for example when if my pc is dying and the message shows up, it gives me a long error message. It is annoying when it happens. It works until the message pops up. I can relaunch it but it just keeps happening. :(
 
So if my steam (and so, Terraria) is not on disc C: , am i still able to install tModLoader? Cus im not sure
Sure, read readme

Hey so I'm having an error when using a mod and the devs don't know how to fix it. Any ideas?
I see this a lot with people trying to use Main.rand in intializers.

Why is it doing this I have Terraria version 1.3.5.2 and my TModLoader version is 0.10.1.1

Like why and how can I fix it?
This happens when the tmodloader exe isn't named Terraria.exe
 
For some reason my mods will occasionally not work and crash the game or just simply disable it self even thou they have been working for a good amount time.
 
Last edited:
Ik this is not the kind of question you don't answer often, but you know if there is a hook that is constantly running and that can draw on menu? So far I found that updateMusic(int ref music) was really early and running constantly but won't make it show du to how early it is. I tried to draw from Load (wich of course worked, but is activated 1 time so kinda useless). This is what I'm trying to achieve outside of the load function:
Gz150iC.png
 
I just installed tmodloader, but I can't get the Mod Browser to show anything. It just says getting data and nothing else. Does it take a really long time the first time you bring it up, or is something wrong with my game/pc/install.
upload_2017-12-31_19-40-21.png
 

Attachments

  • upload_2017-12-31_19-40-10.png
    upload_2017-12-31_19-40-10.png
    294.1 KB · Views: 161
I'm getting a problem with file stuff idk. Have a look and tell me how to fix it (If you know)
 

Attachments

  • How To Fix.PNG
    How To Fix.PNG
    490.1 KB · Views: 241
Hello, I've been getting an issue that has made me unable to play online. Whenever I try to join my friend's game it starts downloading the mods and it always gets stuck at some certain point when downloading Calamity.
 
Question. On Windows 10, where would the Steam folder be? I only know Documents>My Games>Terraria. I need help please. :)
 
I was playing terraria with few mods but my world has become unloadable. It just says: Load failed! No backup found. I was playing with: Boss Checklist, Kalciphoz's RPG Mod, imkSushi's Mod, Calamity Mod, Recipe Browser, Which Mod Is This From?, Infinity - Endless Items, MaxStackPlus. The only thing I did before the world became unloadable was instalation of Wing Slot and updating Boss Checklist to the newer version. Any way to fix this problem or should I create new world and start everything over? (I spent 20+ hours on this world, really don't want to make new one...)
 
Back
Top Bottom