Standalone [1.3] tModLoader - A Modding API

I don't know if this problem has been solved or not [Can't be bothered to read through 368 pages :l] When I create a new world, any world, it gives me the error after loading "Load Failed No Backup Found"
error.png
 
Hey, could anyone tell me if and how I can make a TownNPC have "two skins"? I have created two different spritesheets that I want to use in different situations.
What I tried:
  1. Put one above the other into one image → Well.. didn't work at all
  2. Put then beside each other, making a wide spritesheet → Works drawing-wise, but my NPC is not "virtually" twice as wide. As in, it draws correctly, but when I move my cursor next to the character, it acts as if it was much wider than it is (I can click it, even though I'm several block away from it with my cursor)
  3. Switch the source image mid-game → Didn't figure it out, didn't work at all, nothing changed...

Another option would be to code it in PostDraw somehow (I created an equally sized spritesheet as the original one, with only the "modifications" to be drawn in front of the NPC) but I don't know how, at all :/

Does anyone have any experience with this kinda stuff?
 
I believe it's only TrueEternity that does this, as Lolkat said. I have every mod on the mod browser enabled [Except TrueEternity and a few 'cheaty' mods like the faster potion one, creative mode, easyterraria, etc.] And I can play just fine [with the exception of some lag because my laptop is a potato with a circuit board inside]

EDIT: And I must say, it is absolute chaos.
 
Hey guys!
How can i store information?
like: i have a variable and i want it to stay the same every time i run the game.
i have did a sword that stores information of 3 variables: Lvl , exp and MaxExp.
but every time i run the game, this information resets to the default.
there 's some way i can store this numbers forever?
 
Hey guys!
How can i store information?
like: i have a variable and i want it to stay the same every time i run the game.
i have did a sword that stores information of 3 variables: Lvl , exp and MaxExp.
but every time i run the game, this information resets to the default.
there 's some way i can store this numbers forever?
This function to save and this to load back.
 
Ok. Show me pls?
Allright, so I'll take your earlier post as reference:
Code:
// This will be inside your ModItem
int level;
int experience;
int maxExperience;

public override void SaveCustomData(System.IO.BinaryWriter writer)
{
    writer.Write(level);
    writer.Write(experience);   
    writer.Write(maxExperience);
}
public override void LoadCustomData(System.IO.BinaryReader reader)
{
    level= reader.ReadInt32();
    experience= reader.ReadInt32();   
    maxExperience= reader.ReadInt32();
}
This is some very basic saving and loading. NOTE: you'll need to save and load in the same order, so if you save 'level' first, you'll also want to load that back as the first variable.
 
Wow, I'm a idiot.
1. I forgot to write the word "enabled" in my reply.
2. I thought that I had it disabled, but I disable my ersion mod instead :p
So...everything is alright.



(well this is awkward, ain't it?)

EDIT: Still doesn't work, and I did disable the right mod this time.
 
Last edited:
I can confirm npc disapering in multiplayer. It makes npcloot() not getting called and also the DeadCheck is only called on the killer side since the npc disapear in the client.
 
Does anyone know how to Animate the chests to open and close, i have the chests in my mod fully working with the animation pictures in the same chest picture. Although i dont know how to write the code to animate the opening or closing please help ?
 
When certain conditions are met, I want to draw a frame from my spritesheet in front of my TownNPC. Instead, the NPC isn't drawn at all / disappears (doesn't even appear in housing list).

Code:
        public override void PostDraw(SpriteBatch spriteBatch, Color drawColor)
        {
            if(winter) spriteBatch.Draw(mod.GetTexture("NPCs/Enthusiast/Enthusiast_Shirt"), npc.Center - Main.screenPosition, new Rectangle(0, npc.frame.Y, 40, 60), Color.White);
        }

What am I doing wrong?
 

Attachments

  • Enthusiast.png
    Enthusiast.png
    6.6 KB · Views: 211
  • Enthusiast_Shirt.png
    Enthusiast_Shirt.png
    2.2 KB · Views: 209
Back
Top Bottom