TheTinyDiamond
Official Terrarian
There is a way to make vanilla NPCs say new things right?
this mod decrease spawn ratio?
my underworld's max enemies are change to 5
To me too is decreased, in the blood moon normally 40-50 monsters spawn, but in my three last blood moons only 10
You're joking, right?
My vanilla game must have the same bug then. I only get 5 monsters in vanilla blood moons.
Also another vanilla bug is that I can't get all the cellphone parts.
maybe can be the halloween event bug
Are you making your own AI?How can I make an NPC walk left\right (without falling the floor or something like that)? I have a sprite sheet that animates walking.
Thanks!
I think you can just modify this (randomly of course): https://github.com/bluemagic123/tMo...c-virtual-void-getchatnpc-npc-ref-string-chatThere is a way to make vanilla NPCs say new things right?
Hmm, wonder why that's happening, I see that too.By the way, when I try to download the example mod from Mediafire, I get a "Permission Denied" error.
It's literally just bad luck. What happens is that the people who get unlucky mention it, while the people who get lucky or who get normal luck have no reason to say anything. Thus it looks like everyone's getting no spawns, while in reality it's just a few people getting unlucky. I'm personally always getting swarmed with monsters whenever I try to test things like modded tiles or items, never get monsters when I just happen to want to test NPCs, and get no monsters in vanilla when I'm hunting for banners. Like I said, it's all luck. (I can't believe people actually think this might be some sort of bug, haha )The same happens to me. I don't know if it's a vanilla bug or if it comes from this mod though.
By the way, when I try to download the example mod from Mediafire, I get a "Permission Denied" error.
That's pretty weird, since I'm able to download it normally.Hmm, wonder why that's happening, I see that too.
Got the same error, but it worked when I closed the tab and opened a new one via the same link in the OP...By the way, when I try to download the example mod from Mediafire, I get a "Permission Denied" error.
Where do I put the code exactlyI think you can just modify this (randomly of course): https://github.com/bluemagic123/tMo...c-virtual-void-getchatnpc-npc-ref-string-chat
I've confirmed this bug. Thanks for reporting! It will be fixed in the next update.I may have found a bug; apparently you can put modtiles through the extractinator, but I tested it with other mods' tiles and it happens too. I tested mine because I know I didn't put such properties in them.
Scroll up, the page I linked you to is the reference to GlobalNPC. So make your own class that extends that.Where do I put the code exactly
public class BeigeTorchTile : ModTile
{
public override void SetDefaults()
{
Main.tileFlame[Type] = true;
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
Main.tileSolid[Type] = false;
Main.tileNoAttach[Type] = true;
//Main.tileNoFail[Type] = true;
Main.tileWaterDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.StyleTorch);
TileObjectData.newTile.CoordinateHeights = new int[] { 20 };
TileObjectData.addTile(Type);
drop = mod.ItemType("BeigeTorch");
soundStyle = 1;
mineResist = 0.1f;
dustType = mod.DustType("QuartzBoltDust");
AddMapEntry(new Color((int)(255 * 0.7255f), (int)(255 * 0.7020f), (int)(255 * 0.6667f)));
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
adjTiles = new int[]{TileID.Torches};
}
}
You can use the following:How do I get a projectile to create dust on impact with a tile?
public override bool OnTileCollide(Vector2 oldVelocity)
{
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
return true;
}
It looks like you need to add alternates for your TileObjectData, each one representing an orientation the torch can be placed in. Here's the code for the vanilla torch and its alternates:How would you go about creating a torch tile? I've tinkered around with TileObjectData by trying to adapt the code in the ExampleMod's workbench, bed etc. to apply to a torch, but the current behavior is not quite right. Here's what I've got:
Code:public class BeigeTorchTile : ModTile { public override void SetDefaults() { Main.tileFlame[Type] = true; Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileSolid[Type] = false; Main.tileNoAttach[Type] = true; //Main.tileNoFail[Type] = true; Main.tileWaterDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newTile.CoordinateHeights = new int[] { 20 }; TileObjectData.addTile(Type); drop = mod.ItemType("BeigeTorch"); soundStyle = 1; mineResist = 0.1f; dustType = mod.DustType("QuartzBoltDust"); AddMapEntry(new Color((int)(255 * 0.7255f), (int)(255 * 0.7020f), (int)(255 * 0.6667f))); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); adjTiles = new int[]{TileID.Torches}; } }
With that code, torches break instantly when they're placed. At one point I got it to place, but it could be placed on any side (including the underside of a block) and the sprite wasn't right. Speaking of which, my sprite image looks like this:
It would also be nice if you could add the torch item to the list of things that the player can hold when you press shift, but I can't figure that one out either.
TileObjectData.newTile.CopyFrom(TileObjectData.StyleTorch);
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); //the default torch orientation is on the ground
TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch);
TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); //torch with wall on left
TileObjectData.newAlternate.AnchorAlternateTiles = new int[]
{
124 //allows placement on wooden beams
};
TileObjectData.addAlternate(1);
TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch);
TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); //torch with wall on right
TileObjectData.newAlternate.AnchorAlternateTiles = new int[]
{
124 //allows placement on wooden beams
};
TileObjectData.addAlternate(2);
TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch);
TileObjectData.newAlternate.AnchorWall = true; //torch on wall
TileObjectData.addAlternate(0);
ya. but how can I tell the animation to change? I can get the NPC to move but I can't get it to animate. I'd rather not upload the sprite sheet, it's a secretHmm, I'm getting normal amouts in the underworld:
Are you making your own AI?
You can look at the Abomination for an "example". The Abomination doesn't have a walking animation, but it shows you how you can change the NPC's frame. What you'll need to do is look at the y-velocity to see whether the NPC is falling/jumping, or whether it's on the ground. If it's on the ground, you can look at the x-velocity to tell how fast it's going, and increment frameCounter by a certain amount. frameCounter is a field in NPC dedicated to timing the animations. Once frameCounter reaches a certain value, you can set it to 0 then change your NPC's frame.ya. but how can I tell the animation to change? I can get the NPC to move but I can't get it to animate. I'd rather not upload the sprite sheet, it's a secret
npc.direction = npc.velocity.X > 0 ? -1 : 1;
npc.spriteDirection = npc.direction;
frameHeight = 52;
if (running)
{
npc.frameCounter += 1;
npc.frameCounter %= Main.npcFrameCount[npc.type];
npc.frame.Y = (int)((npc.frameCounter) * frameHeight);
}
if (standing)
{
npc.frame.Y = 0;
}
You shouldn't need to set frameHeight yourself; the parameter will already be set to the correct value for you.should this work?:
running and standing are defined in the AI() and they work.Code:npc.direction = npc.velocity.X > 0 ? -1 : 1; npc.spriteDirection = npc.direction; frameHeight = 52; if (running) { npc.frameCounter += 1; npc.frameCounter %= Main.npcFrameCount[npc.type]; npc.frame.Y = (int)((npc.frameCounter) * frameHeight); } if (standing) { npc.frame.Y = 0; }
public override void Update(Player player, ref int buffIndex)
{
player.statDefense += 5;
player.moveSpeed -= 0.2F;
}