Standalone [1.3] tModLoader - A Modding API

Is it possible to make a Town NPC only spawn if you're in hardmode?
[DOUBLEPOST=1453786858,1453786568][/DOUBLEPOST]Also, how do I make an accessory give enemies debuffs?
 
I have a question for sprite sheets. If you are making your own sprite sheet, what are the limits or rules, like how far apart each have to be?
2 blank pixels to the right and 2 blank pixels below usually. Just follow vanilla sprite sheets.

Is it possible to make a Town NPC only spawn if you're in hardmode?
[DOUBLEPOST=1453786858,1453786568][/DOUBLEPOST]Also, how do I make an accessory give enemies debuffs?
use "Main.hardMode" in your logic. Iterate over the NPC array, check distance from player, call the addBuff function on those that are close enough.

Can you help me with a few things... I need the method and code... since im dumb and cant figure it out...

  1. How do I make a boss go through blocks, and face the player (like eoc) but not summon eyes, do the charge and wait thing, or the half health boost?
  2. How do I animate a spritesheet that has 200x200 pixel sections (4 total) for 20 FPS
1. npc.noTileCollide = true will have your npc not collide with tiles. You do all of that other stuff by programming within the AI() hook. There are no easy solutions to this, you have to plan it out and program in all the behavior. Here is something that will show you the general process(it is tAPI, but that doesn't matter too much.): forums.terraria.org/index.php?threads/tutorial-custom-bosses-npc-ai-and-server-syncing.10474/
2. Are you talking npc? projectile?

How do I make a NPC shoot a projectile straight down when its above the player?
Use geometry to determine if you are above player, have the projectile speedX be 0 and speedY be positive.
 
  • Like
Reactions: TMC
What is the maximum size a sprite can be when creating Ingredient materials for item parts?

Will sprites downscale if too large automatically?
 
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace Enderuim.Projectiles
{
    public class Icicle : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Icicle";
            projectile.damage = 70;
            projectile.width = 60;
            projectile.height = 16;
            projectile.hostile = false;
            projectile.friendly = true;
            projectile.magic = true;
            projectile.penetrate = 10;
            projectile.tileCollide = true;
            projectile.alpha = 100;
            projectile.aiStyle = 51;
            projectile.knockBack = 40;
            projectile.light = 0.5f;
            aiType = 51;
          
        }
    }
}
Help My code is supposed to summon a projectile that homes in on monsters (51 is the same ID of lost soul) but it just doesnt work. But when I change AiStyle to 1 it works, but doesnt home. pls help

Try AI type to 297 or 107 i hope it's help but i'm no sure.
[DOUBLEPOST=1453806693,1453806624][/DOUBLEPOST]Not 107 207* sry
 
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace Enderuim.Projectiles
{
    public class Icicle : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Icicle";
            projectile.damage = 70;
            projectile.width = 60;
            projectile.height = 16;
            projectile.hostile = false;
            projectile.friendly = true;
            projectile.magic = true;
            projectile.penetrate = 10;
            projectile.tileCollide = true;
            projectile.alpha = 100;
            projectile.aiStyle = 51;
            projectile.knockBack = 40;
            projectile.light = 0.5f;
            aiType = 51;
          
        }
    }
}
Help My code is supposed to summon a projectile that homes in on monsters (51 is the same ID of lost soul) but it just doesnt work. But when I change AiStyle to 1 it works, but doesnt home. pls help
Do try to give us more info on the 'doesn't work' part. Do you get an error? If not, does the projectile not spawn? If that's not the case, does the projectile not move/home? ;)
 
This is not really the place to ask, but no: If you want to keep track of the progress you should look at the OP of the thread dedicated to the mod.

OK i'm lazy :D
[DOUBLEPOST=1453807892,1453807523][/DOUBLEPOST]And can someone help me with sprites :D But i'm not good at it. YEA

Bad English.
 
What exactly are you looking for? item.pick determines the strength of the pickaxe.
http://terraria.wiki.gg/Mining_speed

" Mining speed (also known as "tool speed") is an invisible statistic that determines how fast the player can mine (or break walls, or chop down trees/cacti). Its value shows the time per hit in 60ths of second. "

" In particular, a tool's mining speed is independent of how quickly it swings, which is the speed you can see in the in-game tooltip (e.g. "Copper Pickaxe—Fast Speed"). That statistic is properly called "use time." Speed-modifying prefixes affect both mining speed and use time, potentially leading to the misconception that "melee speed" bonuses improve mining speed. In truth, melee speed bonuses affect only use time. "

For example: if the axe had 10 speed and 20 Mining speed it would be just as fast as 20 Speed & 40 Mining Speed.

Or is this a final calculation made? I just got to the 'Mining Speed' part of the wiki and got completely confused.

Is useTime = Tool Speed?
 
First of all, just want to say thanks - mods like these are boon to every game they're made for.

It'd be really nice if there was an easy way to disable this mod though. For example, when I'm playing on my own I use this to load Helpful Hotkeys and tWiki, but when I play with my friend in multiplayer I obviously have to use vanilla Terraria, since multiplayer doesn't work with tML as of yet - however switching between the two executables first of all requires me to swap them around, and secondly seems to somehow break bits of Helpful Hotkeys and rebinding mod controls for either tWiki or HH.
 
First of all, just want to say thanks - mods like these are boon to every game they're made for.

It'd be really nice if there was an easy way to disable this mod though. For example, when I'm playing on my own I use this to load Helpful Hotkeys and tWiki, but when I play with my friend in multiplayer I obviously have to use vanilla Terraria, since multiplayer doesn't work with tML as of yet - however switching between the two executables first of all requires me to swap them around, and secondly seems to somehow break bits of Helpful Hotkeys and rebinding mod controls for either tWiki or HH.
You could use Game Launcher to have multiple different Terraria .exe's without switching them around. I don't know how to fix the Mod Controls issue though.
http://terraria.wiki.gg/Mining_speed

" Mining speed (also known as "tool speed") is an invisible statistic that determines how fast the player can mine (or break walls, or chop down trees/cacti). Its value shows the time per hit in 60ths of second. "

" In particular, a tool's mining speed is independent of how quickly it swings, which is the speed you can see in the in-game tooltip (e.g. "Copper Pickaxe—Fast Speed"). That statistic is properly called "use time." Speed-modifying prefixes affect both mining speed and use time, potentially leading to the misconception that "melee speed" bonuses improve mining speed. In truth, melee speed bonuses affect only use time. "

For example: if the axe had 10 speed and 20 Mining speed it would be just as fast as 20 Speed & 40 Mining Speed.

Or is this a final calculation made? I just got to the 'Mining Speed' part of the wiki and got completely confused.

Is useTime = Tool Speed?
After a quick look through this I've noticed that "useTime" is what determines the Mining Speed, and "useAnimation" is what determines the in-game tooltip and the swing animation speed. Most of the time they have the same value, but they're different for tools and blocks. (blocks have useAnimation = 15 and useTime = 10)
Also for some reason the "useAnimation" is always increased by 1 in the code. For example, Iron Pickaxe's "useAnimation" is 20, but the Wiki says it's 19.
 
Do try to give us more info on the 'doesn't work' part. Do you get an error? If not, does the projectile not spawn? If that's not the case, does the projectile not move/home? ;)
Doesnt spawn
[DOUBLEPOST=1453817035,1453816846][/DOUBLEPOST]
Try AI type to 297 or 107 i hope it's help but i'm no sure.
[DOUBLEPOST=1453806693,1453806624][/DOUBLEPOST]Not 107 207* sry
Thanks that worked
 
You could use Game Launcher to have multiple different Terraria .exe's without switching them around. I don't know how to fix the Mod Controls issue though.

That's regrettable. Another inconvenience is that tModLauncher reads World and Player files from its own location in /My Games/Terraria - I presume to fix compatibility issues, but it'd be nice if there was a way around this since I know my files will be compatible since the mods I'm using don't change these files. Anyway - it looks like Game Launcher isn't supported in 1.3.
 
Back
Top Bottom