Standalone [1.3] tModLoader - A Modding API

Can we create some kind of "placeholder" recipe, that can be used with any item?For example, crafting Night's Edge or any other with Modded Item of True Powah gives weapon +5 dmg or 2x sell value, you got the idea?


Also, can set bonus of armor mimic an accessory?So that if player equips a set, he have a wings?
 
Can we create some kind of "placeholder" recipe, that can be used with any item?For example, crafting Night's Edge or any other with Modded Item of True Powah gives weapon +5 dmg or 2x sell value, you got the idea?


Also, can set bonus of armor mimic an accessory?So that if player equips a set, he have a wings?

I guess boht of these are possible, but they would be difficult to implement. For the placeholder recipe, you would probably have to iterate through all of the recipes in Main.recipe, and then probably get all of the components through requiredItem[] and requiredTile[] (iterate through these also after each entry in Main.recipe) and then add your placeholder recipe. But then again, this may result in more than 4000 recipes for the game, so you can probably check the items in the recipe with createItem. So you should probably do this in ModRecipe or the Mod file on load. I may try and make this but I don;t know if it will work.

You can probably mimic an accessory effect like wings using ModPlayer, since the items themselves do not give the effects. For example, for wings you could probably set a value for the wings variable for player to use a vanilla wing, however I don't know if it will use the wing texture for it when you change the wings variable. You would need to check in the ModPlayer updates hook to see if the player is wearing the set and then set the variable in there for example, you could set player.carpet = true.
 
I guess boht of these are possible, but they would be difficult to implement. For the placeholder recipe, you would probably have to iterate through all of the recipes in Main.recipe, and then probably get all of the components through requiredItem[] and requiredTile[] (iterate through these also after each entry in Main.recipe) and then add your placeholder recipe. But then again, this may result in more than 4000 recipes for the game, so you can probably check the items in the recipe with createItem. So you should probably do this in ModRecipe or the Mod file on load. I may try and make this but I don;t know if it will work.

You can probably mimic an accessory effect like wings using ModPlayer, since the items themselves do not give the effects. For example, for wings you could probably set a value for the wings variable for player to use a vanilla wing, however I don't know if it will use the wing texture for it when you change the wings variable. You would need to check in the ModPlayer updates hook to see if the player is wearing the set and then set the variable in there for example, you could set player.carpet = true.

Okay, thanks for information! :)
 
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:
Back
Top Bottom