BlueWaterMelon
Golem
i cant find anything help!
There has been a conversation about this not too long ago. Try looking back a few pages.
Look in NPC.cs for the setdefaults of the NPC you are interested in. You'll see the type and aistyle for that NPC. Then, look for aistyle == (number here) and you should find the ai code for that ai style. Within that block of code there may be if statements to further refine the aistyle due to the type (aka NPCid) of the NPC. You'll need to look through it and attempt to understand the code.
Yeah, the first parameter of the function you're returning determines the animation Speed.Is there a way to increase the speed of the animation when using public override DrawAnimation GetAnimation() for item animations?
Maybe I'm being misled by this example then? I figured the return new was the only one I could use.Yeah, the first parameter of the function you're returning determines the animation Speed.
public override DrawAnimation GetAnimation()
{
return new DrawAnimationVertical(30, 4);
}
I believe the second parameter automatically defines the frame height of each frame by dividing the actual texture height by the amount of frames.Maybe I'm being misled by this example then? I figured the return new was the only one I could use.
Or I guess it would be more appropriate to say, I thought the 30 was the frame height and the 4 was the total frames. So I don't see where I'm able to influence the speed from this example.
Code:public override DrawAnimation GetAnimation() { return new DrawAnimationVertical(30, 4); }
Still invisibleTry this:
Code:public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) { if(npc.hasBuff(mod.BuffType("Frost")) != -1) { Vector2 drawPos = new Vector2(npc.position.X,npc.position.Y); spriteBatch.Draw(mod.GetTexture("Extras/Frozen"), drawPos, null, default(Color), 0f, drawPos, npc.scale * 2 , SpriteEffects.None, 0f); return false; } return true; }
Untested, should (highly) theoretically work. If default(Color) gives an error, just change it to Color.white and that should work.
Still invisible![]()
It needs to be non-transparent?Then I think something's wrong with your texture, although at this point your guess is as good as mine.
It needs to be non-transparent?
Is an overlay.No, that shouldn't be an issue, unless of course it's fully transparent, in which case, yes.
Is your texture a completely new sprite of the NPC or just an overlay/effect?
Is an overlay.
How would I make a custom ore generate in a world?
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Micro Biomes"));
if (ShiniesIndex == -1)
{
// Shinies pass removed by some other mod.
return;
}
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Example Mod Ores", delegate (GenerationProgress progress)
{
progress.Message = "Example Mod Ores";
for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++)
{
WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(2, 6), mod.TileType("ExampleBlock"), false, 0f, 0f, false, true);
}
}));
}
where would i find NPC.csLook in NPC.cs for the setdefaults of the NPC you are interested in. You'll see the type and aistyle for that NPC. Then, look for aistyle == (number here) and you should find the ai code for that ai style. Within that block of code there may be if statements to further refine the aistyle due to the type (aka NPCid) of the NPC. You'll need to look through it and attempt to understand the code.
where would i find NPC.cs