MINECRAFTlegos59
Terrarian
There still there but there's no sprite and there unplayableYou mean there are characters with no pictures and they can't be played, or that are no characters at all, or something else?
[DOUBLEPOST=1457287791,1457287629][/DOUBLEPOST]
I have tried that but thank you for the effortI think you have to make a new charactor if it is not created in the modded version. If it is i dont know...
Endershot355
Steampunker
2 things: How do you edit the loottables of randomly generated chests (like pyridmid chests) and 2: how to do ore generation (on world creation)
Keashi
Steampunker
I've had this problem - first make sure you have the latest tModLoader and then go to your ModLoader/Players folder and remove the .tplr files of the faulty characters. (that will probably somewhat hurt their inventory, but the characters should work afterwards).There still there but there's no sprite and there unplayable
[DOUBLEPOST=1457287791,1457287629][/DOUBLEPOST]
I have tried that but thank you for the effort
You can try just moving the files to your desktop or somewhere, if you don't want to delete them. But if the characters work afterwards, they will create new .tplr files for themselves, so the old files will be useless for you.
The Shifting Cultist
Dungeon Spirit
i think notis HUD modding supported yet?
Endershot355
Steampunker
Help pls2 things: How do you edit the loottables of randomly generated chests (like pyridmid chests) and 2: how to do ore generation (on world creation)
MINECRAFTlegos59
Terrarian
? is there a file location dor this?I've had this problem - first make sure you have the latest tModLoader and then go to your ModLoader/Players folder and remove the .tplr files of the faulty characters. (that will probably somewhat hurt their inventory, but the characters should work afterwards).
You can try just moving the files to your desktop or somewhere, if you don't want to delete them. But if the characters work afterwards, they will create new .tplr files for themselves, so the old files will be useless for you.
Keashi
Steampunker
C:\Users\[USER]\Documents\My Games\Terraria\ModLoader\Players I believe? is there a file location dor this?
Maybe, but no one has tried yet.Oh and can we make Minecarts yet. There is no example. Im guessing its some kind of mount.
1. In probably postworldgen, iterate through chests, find a spot in the item array that is empty, call Setdefaults on the item.2 things: How do you edit the loottables of randomly generated chests (like pyridmid chests) and 2: how to do ore generation (on world creation)
Code:
for (int i = 0; i < 1000; i++)
{
Chest chest = Main.chest[i];
other code....
2. Like this:
Code:
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", 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);
}
}));
}
Endershot355
Steampunker
what do I have to edit to make it work with EnderuimOre? And where (Im assuming the ore cs). Im sorry im new to world genningMaybe, but no one has tried yet.
1. In probably postworldgen, iterate through chests, find a spot in the item array that is empty, call Setdefaults on the item.
Code:for (int i = 0; i < 1000; i++) { Chest chest = Main.chest[i]; other code....
2. Like this:
Code:public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight) { int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", 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); } })); }
The Shifting Cultist
Dungeon Spirit
tremor has tried the mounts and made 1 (i think only one by now) so minecrats are possible i thinkMaybe, but no one has tried yet.
1. In probably postworldgen, iterate through chests, find a spot in the item array that is empty, call Setdefaults on the item.
Code:for (int i = 0; i < 1000; i++) { Chest chest = Main.chest[i]; other code....
2. Like this:
Code:public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight) { int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", 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); } })); }
Change mod.TileType("ExampleBlock")what do I have to edit to make it work with EnderuimOre? And where (Im assuming the ore cs). Im sorry im new to world genning
[DOUBLEPOST=1457298568,1457298505][/DOUBLEPOST]
I know mounts are possible, just not sure how to specifically make a Minecraft mount.tremor has tried the mounts and made 1 (i think only one by now) so minecrats are possible i think
Endershot355
Steampunker
Do I change the numbers to define the rarity?
DivermanSam
Empress of Light
How would I go about making vanilla enemies immune to modded debuffs?
Edit - Welp, never mind. I think I figured it out...![Sigh :sigh: :sigh:](/assets/emoticons/guide/sigh.gif)
Edit - Welp, never mind. I think I figured it out...
![Sigh :sigh: :sigh:](/assets/emoticons/guide/sigh.gif)
Last edited:
The only way to conditionally change the texture reliably would be to manually draw the NPC in the PreDraw hook. However, if lighting is the only problem then you can use the drawColor parameter instead of Color.White.So as it turns out, it was a Missing Texture exception... needless to say, it was caused by my dumb mistake :/
Anyway it draws now. After some time of trial of error it even draws in the right place but:
(The border of the sleeve is [supposed to be] the same color as the rest of the borders)
- It seems that the sprite isn't affected by light, so at night it's much brighter than the rest of the clothes, even though it's the same color
- When my character (for example) jumps, the sprite sometimes "doesn't keep up" and is drawn elsewhere than the character...
Code:public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) { if (winter) { try { if (npc.direction == -1) { spriteBatch.Draw(mod.GetTexture("NPCs/Enthusiast_Shirt"), npc.Center - Main.screenPosition, new Rectangle(0, npc.frame.Y, 40, 60), Color.White, 0f, new Vector2(20, 30), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(mod.GetTexture("NPCs/Enthusiast_Shirt"), npc.Center - Main.screenPosition, new Rectangle(0, npc.frame.Y, 40, 60), Color.White, 0f, new Vector2(20, 30), 1f, SpriteEffects.FlipHorizontally, 0f); } } catch (Exception e) { Main.NewText(e + ""); } } }
Is there a way to completely change which texture is used for the NPC itself? Like - instead of drawing a collar in front of it, I'd make it draw from a spritesheet that already has the shirt. I tried to figure it out, but didn't succeed.
...SetDefaults...Do I change the numbers to define the rarity?
Endershot355
Steampunker
rarity as in spawningThe only way to conditionally change the texture reliably would be to manually draw the NPC in the PreDraw hook. However, if lighting is the only problem then you can use the drawColor parameter instead of Color.White.
...SetDefaults...
Endershot355
Steampunker
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Tiles\ExampleBlock.cs(32,57) : error CS0246: The type or namespace name 'GenPass' could not be found (are you missing a using directive or an assembly reference?)
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Tiles\ExampleBlock.cs(32,52) : error CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
Code that I edited
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ExampleMod.Tiles
{
public class ExampleBlock : ModTile
{
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileLighted[Type] = true;
dustType = mod.DustType("Sparkle");
AddMapEntry(new Color(200, 200, 200));
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.5f;
g = 0.5f;
b = 0.5f;
}
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", delegate (GenerationProgress progress)
{
progress.Message = "Growing Enderuim Crystals...";
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);
}
}));
}
}
}
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Tiles\ExampleBlock.cs(32,52) : error CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
Code that I edited
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ExampleMod.Tiles
{
public class ExampleBlock : ModTile
{
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileLighted[Type] = true;
dustType = mod.DustType("Sparkle");
AddMapEntry(new Color(200, 200, 200));
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.5f;
g = 0.5f;
b = 0.5f;
}
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", delegate (GenerationProgress progress)
{
progress.Message = "Growing Enderuim Crystals...";
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);
}
}));
}
}
}
Iroh The Dragon
Terrarian
How would i go about Generating Ore onto new maps ?
Solo-Ion
Dungeon Spirit
So as it turns out, it was a Missing Texture exception... needless to say, it was caused by my dumb mistake :/
Anyway it draws now. After some time of trial of error it even draws in the right place but:
(The border of the sleeve is [supposed to be] the same color as the rest of the borders)
- It seems that the sprite isn't affected by light, so at night it's much brighter than the rest of the clothes, even though it's the same color
- When my character (for example) jumps, the sprite sometimes "doesn't keep up" and is drawn elsewhere than the character...
Code:public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) { if (winter) { try { if (npc.direction == -1) { spriteBatch.Draw(mod.GetTexture("NPCs/Enthusiast_Shirt"), npc.Center - Main.screenPosition, new Rectangle(0, npc.frame.Y, 40, 60), Color.White, 0f, new Vector2(20, 30), 1f, SpriteEffects.None, 0f); } else { spriteBatch.Draw(mod.GetTexture("NPCs/Enthusiast_Shirt"), npc.Center - Main.screenPosition, new Rectangle(0, npc.frame.Y, 40, 60), Color.White, 0f, new Vector2(20, 30), 1f, SpriteEffects.FlipHorizontally, 0f); } } catch (Exception e) { Main.NewText(e + ""); } } }
Is there a way to completely change which texture is used for the NPC itself? Like - instead of drawing a collar in front of it, I'd make it draw from a spritesheet that already has the shirt. I tried to figure it out, but didn't succeed.
Like BlueMagic said, you simply need to replace Color.White with the colour at the location of your NPC. To save you some time, this is what you use 'Lighting.GetColor((int)npc.Center.X / 16, (int)npc.Center.Y / 16)'.
You could also simplify your code by doing away with the npc.direction check and instead use 'npc.spriteDirection > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally' for the sprite direction.
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Tiles\ExampleBlock.cs(32,57) : error CS0246: The type or namespace name 'GenPass' could not be found (are you missing a using directive or an assembly reference?)
c:\Users\Devin\Documents\My Games\Terraria\ModLoader\Mod Sources\Enderuim\Tiles\ExampleBlock.cs(32,52) : error CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
Code that I edited
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ExampleMod.Tiles
{
public class ExampleBlock : ModTile
{
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileLighted[Type] = true;
dustType = mod.DustType("Sparkle");
AddMapEntry(new Color(200, 200, 200));
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.5f;
g = 0.5f;
b = 0.5f;
}
public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
tasks.Insert(ShiniesIndex + 1, new PassLegacy("Crazy Ore", delegate (GenerationProgress progress)
{
progress.Message = "Growing Enderuim Crystals...";
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);
}
}));
}
}
}
Add
Code:
using System.Collections.Generic;
using Terraria.World.Generation;
Similar threads
- Replies
- 39
- Views
- 21K
- Replies
- 5
- Views
- 1K
- Replies
- 893
- Views
- 889K
- Replies
- 0
- Views
- 460
- Sticky
- Replies
- 270
- Views
- 258K
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.