Standalone [1.3] tModLoader - A Modding API

error CS0117: 'Terraria.Main' does not contain a definition for 'NormalSpawn'
error CS0117: 'Terraria.Main' does not contain a definition for 'NoZoneAllowWater'
does anyone know what works or does contain a definition for NormalSpawn and NoZoneAllowWater
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;



namespace NicksMod.NPCs
{
    public class KillerWhale : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Killer Whale";
            npc.displayName = "Killer Whale";
            npc.width = 70;
            npc.height = 70;
            npc.damage = 65;
            npc.defense = 15;
            npc.lifeMax = 500;
            npc.HitSound = SoundID.NPCHit1;
            npc.DeathSound = SoundID.NPCDeath1;
            npc.value = 60f;
            npc.knockBackResist = 0.5f;
            npc.aiStyle = 16;
            Main.npcFrameCount[npc.type] = 3;
            aiType = NPCID.Shark;  //npc behavior
            animationType = NPCID.Shark;
    
        }
        public override void FindFrame(int frameHeight)
        {
            npc.frameCounter -= 0.1F; // Determines the animation speed. Higher value = faster animation.
            npc.frameCounter %= Main.npcFrameCount[npc.type];
            int frame = (int)npc.frameCounter;
            npc.frame.Y = frame * frameHeight;
            npc.spriteDirection = npc.direction;
        }
      
        public override void NPCLoot()  //Npc drop
        {
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcaFin"));         
        }

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {     
            int x = spawnInfo.spawnTileX;
            int y = spawnInfo.spawnTileY;
            int tile = (int)Main.tile[x, y].type;
            return (!Main.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && !Main.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250);
        }
    }
}
 
error CS0117: 'Terraria.Main' does not contain a definition for 'NormalSpawn'
error CS0117: 'Terraria.Main' does not contain a definition for 'NoZoneAllowWater'
does anyone know what works or does contain a definition for NormalSpawn and NoZoneAllowWater
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;



namespace NicksMod.NPCs
{
    public class KillerWhale : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Killer Whale";
            npc.displayName = "Killer Whale";
            npc.width = 70;
            npc.height = 70;
            npc.damage = 65;
            npc.defense = 15;
            npc.lifeMax = 500;
            npc.HitSound = SoundID.NPCHit1;
            npc.DeathSound = SoundID.NPCDeath1;
            npc.value = 60f;
            npc.knockBackResist = 0.5f;
            npc.aiStyle = 16;
            Main.npcFrameCount[npc.type] = 3;
            aiType = NPCID.Shark;  //npc behavior
            animationType = NPCID.Shark;
   
        }
        public override void FindFrame(int frameHeight)
        {
            npc.frameCounter -= 0.1F; // Determines the animation speed. Higher value = faster animation.
            npc.frameCounter %= Main.npcFrameCount[npc.type];
            int frame = (int)npc.frameCounter;
            npc.frame.Y = frame * frameHeight;
            npc.spriteDirection = npc.direction;
        }
     
        public override void NPCLoot()  //Npc drop
        {
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcaFin"));        
        }

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {    
            int x = spawnInfo.spawnTileX;
            int y = spawnInfo.spawnTileY;
            int tile = (int)Main.tile[x, y].type;
            return (!Main.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && !Main.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250);
        }
    }
}
Those are helper classes written into ExampleMod. You can copy them over if you'd like to use them
 
how to fix this jopejelly i dont now why this is working beacause this GOG im using tmodloader 0.9.0.2 and its said is this

System.MissingFieldException: Field not found: 'Terraria.Main.rand'.
at BossExpertise.BossExpertise.ModifyTransformMatrix(Matrix transform)
at Terraria.ModLoader.ModHooks.ModifyTransformMatrix(Matrix Transform)
at Terraria.Main.do_Draw(GameTime gameTime)
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args)
 
how to fix this jopejelly i dont now why this is working beacause this GOG im using tmodloader 0.9.0.2 and its said is this

System.MissingFieldException: Field not found: 'Terraria.Main.rand'.
at BossExpertise.BossExpertise.ModifyTransformMatrix(Matrix transform)
at Terraria.ModLoader.ModHooks.ModifyTransformMatrix(Matrix Transform)
at Terraria.Main.do_Draw(GameTime gameTime)
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args)
Basically delete all the tmod files then open tmodloader when you update to 0.9
 
Annoying, very annoying...

Why do update after update there is an update, why not make one big update instead of pieces by pieces?
I mean if there is an update please make it all up there, i hate it when that happens.

Still it's so wonderful and to be mentioned i'm not a hater.
 
I installed 9.0.3 and now whenever i open it it tells me something is wrong with some mods so i click okay then it closes and shows me a bunch of coding (i think its coding???). So what i want to know is if i get rid of all my mods and redownload them once im able to open the game, will everything be as it was before or will it ruin my worlds and characters?
 
I installed 9.0.3 and now whenever i open it it tells me something is wrong with some mods so i click okay then it closes and shows me a bunch of coding (i think its coding???). So what i want to know is if i get rid of all my mods and redownload them once im able to open the game, will everything be as it was before or will it ruin my worlds and characters?
Delete the mods from the mod folder, go in game and download the mods you had before that are now updated. It should be fine
 
Hi guys there seems to be an issue with hard mode generation where the hallow and crimson/corruption always go in the same direction regardless of how many times you generate the biomes after killing WoF. Seems to be a bug that 1.3.4 created. Is there anything that can be done using TML to fix this at all?

To be specific, the hallow always seems to go to the left (west). In the 1.3.4 thread in the general forums, there are a few other people who are experiencing the same issue as me.
 
im soooooooooo confused about whats going on with my killer whale npc
does anyone know a simple way just to make em spawn in ocean?
heres code
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;



namespace NicksMod.NPCs
{
    public class KillerWhale : ModNPC
    {
        public override void SetDefaults()
        {
            npc.name = "Killer Whale";
            npc.displayName = "Killer Whale";
            npc.width = 70;
            npc.height = 70;
            npc.damage = 65;
            npc.defense = 15;
            npc.lifeMax = 500;
            npc.HitSound = SoundID.NPCHit1;
            npc.DeathSound = SoundID.NPCDeath1;
            npc.value = 60f;
            npc.knockBackResist = 0.5f;
            npc.aiStyle = 16;
            Main.npcFrameCount[npc.type] = 3;
            aiType = NPCID.Shark;  //npc behavior
            animationType = NPCID.Shark;
    
        }
        public override void FindFrame(int frameHeight)
        {
            npc.frameCounter -= 0.1F; // Determines the animation speed. Higher value = faster animation.
            npc.frameCounter %= Main.npcFrameCount[npc.type];
            int frame = (int)npc.frameCounter;
            npc.frame.Y = frame * frameHeight;
            npc.spriteDirection = npc.direction;
        }
      
        public override void NPCLoot()  //Npc drop
        {
            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcaFin"));         
        }

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {     
            int x = spawnInfo.spawnTileX;
            int y = spawnInfo.spawnTileY;
            int tile = (int)Main.tile[x, y].type;
            return (ExampleMod.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && ExampleMod.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250);
        }
    }
}
 
Hello, I managed to stop Terraria from crashing when I host a modded server, but now when I get to the point where the world's tile data is received it just says "Receiving tile data: Complete!". I do not know if this phase is completely indefinite or just very long. I have waited for over 15 minutes and not had anything change multiple times though. The cancel button still works and I am able to get back to the main menu. Could you help me figure out what is going wrong this time? Also, thank you for he help last time jopojelly.
 
I had a problem when i open the Terraria with this version of tmodloader the mods are not updated i think thats normal, later when i open the mod browser it was empty and finally i try to enter to singleplayer and it crashes and show me this:
Error.png
 
Umm hi, i have another problem, itswith my world i create a new one but it says that its crashed

Método no encontrado: 'Int32 Terraria.Player.HasBuff(Int32)'.
en MoonLordNerf.BiteNerf.PostUpdateBuffs()
en Terraria.ModLoader.PlayerHooks.PostUpdateBuffs(Player player)
en Terraria.Player.Update(Int32 i)
en Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
en Terraria.WorldGen.playWorldCallBack(Object threadContext)
 
I downloaded a mod because i wanted to use it but it now crashes my game every time i try to open the game it gets to where it is loading the mods then it says Terraria stopped working trying to find solutions then it closes the game how do i fix it
 
Back
Top Bottom