Well, "Color(255, 255, 255, 200)" is basically a white, slightly transparent colour. The four numbers correspond to Red, Blue, Green and Alpha (transparency). If you want a reddish colour, you'd want to have the red value higher that the blue and green values. E.g. 255, 64, 64, 200.Ah I feel dumb for missing that. Thank you. The flickering is completely fixed now, it's a solid color all the time. Any idea how I would go about giving it the red glow? It's still a white projectile but in game when fired from the sword it glows in that nice red color.
It's fairly simple. Just put something like the following in your NPC's GetChat hook.How would I get my town NPC to say the name of another town NPC, for example, when the Demolitionist says: "Even [Name of Arms Dealer] wants what I'm selling!"
if (NPC.AnyNPCs(NPCID.Merchant)) //if the merchant is found
{
int merchantInd= NPC.FindFirstNPC(NPCID.Merchant); //Find the Merchant's Index
return "I need to have a word with " + Main.npc[merchantInd].displayName + " about stuff.";
}
Ok, but how would I do that with this code?It's fairly simple. Just put something like the following in your NPC's GetChat hook.
Code:if (NPC.AnyNPCs(NPCID.Merchant)) //if the merchant is found { int merchantInd= NPC.FindFirstNPC(NPCID.Merchant); //Find the Merchant's Index return "I need to have a word with " + Main.npc[merchantInd].displayName + " about stuff."; }
public override string GetChat()
{
switch (Main.rand.Next(3))
{
case 0:
return "Everyone else looks at me in a weird way, but [Name of Cyborg] seems to be fine with me.";
case 1:
return "Hello.";
default:
return "Why am I here?";
}
}
Just implement it into your own code like this:Ok, but how would I do that with this code?
Code:public override string GetChat() { switch (Main.rand.Next(3)) { case 0: return "Everyone else looks at me in a weird way, but [Name of Cyborg] seems to be fine with me."; case 1: return "Hello."; default: return "Why am I here?"; } }
public override string GetChat()
{
switch (Main.rand.Next(3))
{
case 0:
int cyborgID= NPC.FindFirstNPC(NPCID.Cyborg);
return "Everyone else looks at me in a weird way, but " + Main.npc[cyborgID].displayName +" seems to be fine with me.";
case 1:
return "Hello.";
default:
return "Why am I here?";
}
}
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace KillGun.Projectiles
{
public class IceBlast : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "IceBlast";
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.timeLeft = 360;
projectile.extraUpdates = 100;
projectile.ignoreWater = true;
}
public override void AI()
{
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > 2f)
{
for (int num562 = 0; num562 < 3; num562++)
{
projectile.alpha = 255;
int num563 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y - projectile.height/4), projectile.width + 4, projectile.height + 4, 15, 0f, 0f, 0, default(Color), 0.75f);
Main.dust[num563].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[num563].velocity *= 0.2f;
Main.dust[num563].noGravity = true;
}
}
}
}
}
Last Prism uses actual images, rather than dust to form the laser.I'm trying to make my projectile work as a beam. I have a method that works but doesn't work well. I was hoping for it to work similarly to the Last Prism but I just can't figure it out. If anyone could help it would be greatly appreciated. Here's the frankencode I have so far:
Code:using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace KillGun.Projectiles { public class IceBlast : ModProjectile { public override void SetDefaults() { projectile.name = "IceBlast"; projectile.width = 30; projectile.height = 30; projectile.friendly = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 360; projectile.extraUpdates = 100; projectile.ignoreWater = true; } public override void AI() { projectile.localAI[0] += 1f; if (projectile.localAI[0] > 2f) { for (int num562 = 0; num562 < 3; num562++) { projectile.alpha = 255; int num563 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y - projectile.height/4), projectile.width + 4, projectile.height + 4, 15, 0f, 0f, 0, default(Color), 0.75f); Main.dust[num563].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num563].velocity *= 0.2f; Main.dust[num563].noGravity = true; } } } } }
Last Prism uses actual images, rather than dust to form the laser.
So do I make it one long image file as the projectile?
Any1 knows how to remove 100% of the players defense with a debuff?
public override void Update(Player player, ref int buffIndex)
{
player.statDefense = 0;
}
Probably this in the debuff file
Code:public override void Update(Player player, ref int buffIndex) { player.statDefense = 0; }
This will only work with a throwing weapon that isn't consumable, because you cannot reforge items that stack. You could makea throwing weapon that consumes ammo, but is still reforgable (like how bows and guns work)How to make a throwing weapon can be reforged at goblin tinkerer?
I'm making some mod focus on throwing class, however I can not pass this step.
This could help you ^^
c:\Users\Maxim\Documents\My Games\Terraria\ModLoader\Mod Sources\FirstMod\NPCs\BS\BSHead.cs(32,17) : error CS1061: 'Terraria.NPC' does not contain a definition for 'soundKilled' and no extension method 'soundKilled' accepting a first argument of type 'Terraria.NPC' could be found (are you missing a using directive or an assembly reference?)
c:\Users\Maxim\Documents\My Games\Terraria\ModLoader\Mod Sources\FirstMod\NPCs\BS\BSHead.cs(37,25) : error CS1061: 'Terraria.ModLoader.Mod' does not contain a definition for 'GetMusicSlot' and no extension method 'GetMusicSlot' accepting a first argument of type 'Terraria.ModLoader.Mod' could be found (are you missing a using directive or an assembly reference?)
c:\Users\Maxim\Documents\My Games\Terraria\ModLoader\Mod Sources\FirstMod\NPCs\BS\BSTail.cs(27,17) : error CS1061: 'Terraria.NPC' does not contain a definition for 'soundHit' and no extension method 'soundHit' accepting a first argument of type 'Terraria.NPC' could be found (are you missing a using directive or an assembly reference?)
Thanks, ill try that.It should be "HitSound" and "DeathSound". As for the music slot thing... I don't know anything about Terraria's music so I can't comment much but I don't think that's part of an NPC.
Next time you post code please do it inside a code tag, under the insert option where spoiler is also.
As for the code, I haven't worked on a multipart boss. I'd make sure that the head texture files are in place because I had some weirdness earlier due to that being missing. It may be some problem in the BS class rather than in the item.
Edit: re head textures, not textures for the head portion of the boss but the "_Head_Boss" textures used in the minimap.