Actually, that sounds hilarious, I love it how my tutorial is being used like this!Wut do u mean? I pretty much made a sprite dats 1x1 and had it spawn paladins hammers (The friendly kind) every frame and the game thinks the player threw the paladins hammers so they flew 2 my character
I use Fraps trial version to record (there's probably something better out there) and then use Photoshop to make the GIF.Just imagine 5000 paladins hammers flying toward your character all at once. And how do i take screen shots/make gifs of me doing these things?
ive played terraria for so long yet still havent bothered to find out
I found this one from someone's signature, I thought it was quite helpful, maybe the same one as the one you saw.Gimp is great for making sprite transparent. Do you know who posted that really good spriting tut? i cant find it any more![]()
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TAPI;
using Terraria;
namespace MPT.Projectiles
{
public class ExampleProjectileB : ModProjectile
{
public override void AI()
{
projectile.light = 0.9f; //Glow just enough for it to cover the projectile
projectile.alpha = 128; //Makes it semi-transparent
projectile.rotation += (float)projectile.direction * 0.8f; - Makes the projectile spin
int DustID = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width + 4, projectile.height + 4, 36, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 120, default(Color), 0.75f); //Create Dust
Main.dust[DustID].noGravity = true; //Makes the Dust not fall into the ground
}
}
}
When I try to use this code, my compiler says that color and Vector2 aren't valid assemblies.
You can adjust where the item is held when used with this peice of code within your item's JSON file.Is it possible to create weapons that don't look awkward when using them? What I mean is, when you hold out a gun shouldn't you be holding on it's handle? Or if you want to create a Rapier like sword that has a handguard and you want your character to actually hold it on it's handle? Thank's for creating the tutorial though, appreciate it.
"holdoutOffset": [x,y], //How far away or close to the player you want the item to be in terms of pixels.
You cannot override AI Styles, only add to them. However, you can edit the vanilla code and adjust it to your means, you would just need to have the vanilla code, which I have included within this tutorial. Just look for a specific AI style, and copy and paste the vanilla AIStyle and then edit it. All you need to do is replcae "this" with "projectile".Sin Costan How Would I Overwrite particles from an Ai style. When i give my weapons an Ai style of 9 it shows blue and white particles
Thank YouYou cannot override AI Styles, only add to them. However, you can edit the vanilla code and adjust it to your means, you would just need to have the vanilla code, which I have included within this tutorial. Just look for a specific AI style, and copy and paste the vanilla AIStyle and then edit it. All you need to do is replcae "this" with "projectile".
Do you know whether you could make a projectile deal extra damage to specific enemy?
public override void AI()
{
foreach NPC N in Main.NPC
{
Rectangle MB = new Rectangle((int)projectile.position.X + (int)projectile.velocity.X, (int)projectile.position.Y + (int)projectile.velocity.Y, projectile.width, projectile.height); //Variable sets up projectile's hitbox
Rectangle NB = new Rectangle((int)N.position.X, (int)N.position.Y, N.width, N.height); //Variable sets up NPC's hitbox
if (MB.Intersects(NB))
{
int weakNPCs = INT; //Input IDs of desired NPCs here
float damageMult = FLOAT; //Input desired damage multiplier here
if (N.type == weakNPCs)
{
projectile.damage *= damageMult;
}
}
}
}
In the projectile's CS fileCode:public override void AI() { foreach NPC N in Main.NPC { Rectangle MB = new Rectangle((int)projectile.position.X + (int)projectile.velocity.X, (int)projectile.position.Y + (int)projectile.velocity.Y, projectile.width, projectile.height); //Variable sets up projectile's hitbox Rectangle NB = new Rectangle((int)N.position.X, (int)N.position.Y, N.width, N.height); //Variable sets up NPC's hitbox if (MB.Intersects(NB)) { int weakNPCs = INT; //Input IDs of desired NPCs here float damageMult = FLOAT; //Input desired damage multiplier here if (N.type == weakNPCs) { projectile.damage *= damageMult; } } } }
int[] weakNPCs = { NPCDef.byName["InternalModName:NPCName"].type, int ID, .... }; //dots to show that it may continue off of it.
NPCDef.byName["InternalModName:NPCName"].type //Finding the ID of a mod NPC
int ID //The integer ID of a Vanilla NPC
for(int i = 0; i < 5; i++)
{
if(weakNPCs[i] == NPC.type)
{
projectile.damage *= dmgMult;
}
}