Standalone [1.3] tModLoader - A Modding API

I encountered an issue while trying to create a mod.

When I first load up the game, interfaces created like coin counter in ExampleMod don't respond to mouse clicks when they first appear. After 20-40 seconds (it varies) the buttons/OnClick begin to respond. With ExampleMod I type /coin and it appears, the coin count shows and updates but I can't move, close, or reset the panel until ~20 seconds pass.

To further confuse matters this is happening on a small world that I just created for testing. On an old world where I already have a lot of equipment and NPCs I don't see this error. The delay also doesn't show again if I just exit to the menu and re-enter a world. It only happens after reloading the mods (or exiting Terraria). It sometimes doesn't occur if it is left visible on the screen ever after reloading.

This problem also doesn't seem occur with CheatSheet.

It's perhaps not a big thing but does anyone have any ideas?
 
Since I never got an answer, I'll kindly ask again (Please I'm not trying to round like a douche)
I've had some funky things happening when I updated to 1.3.4.4
First, Gore from modded enemies just stayed there, while normal ones disappear
Second, Any projectile, it being Trowing, magic, ranged, sword beams, enemy projectiles, pets and summons
And maybe, just maybe screwd up drops (or not, not sure about this one)
 
Can someone explain player.Hurt(), it changed a lot.
It's actually very similar to how it was. 'string deathText' was replaced with 'Terraria.DataStructures.PlayerDeathReason.ByPlayer' and moved to the start of player.Hurt(). You can replace .ByPlayer with several other things including .ByCustomReason(string) which lets you type in your own reason.

You can also use player.HurtOld() to do it the old way. The following are essentally the same.
Code:
player.Hurt(Terraria.DataStructures.PlayerDeathReason.ByCustomReason("Stupidity"), 1234, 0, false, true, false, -1);
player.HurtOld(1234, 0, false, true, "Stupidity", false, -1);
 
First, Gore from modded enemies just stayed there, while normal ones disappear
I mentioned that this bug is noted.
Second, Any projectile, it being Trowing, magic, ranged, sword beams, enemy projectiles, pets and summons
This isn't a sentence.
And maybe, just maybe screwd up drops (or not, not sure about this one)
Haven't seen anyone else metion it

What the heck with this blocks?
First time I've seen this.
When I first load up the game, interfaces created like coin counter in ExampleMod don't respond to mouse clicks when they first appear. After 20-40 seconds (it varies) the buttons/OnClick begin to respond. With ExampleMod I type /coin and it appears, the coin count shows and updates but I can't move, close, or reset the panel until ~20 seconds pass.
I just tried to verify this, but the coin panel seemed fine.
 
Screenshot_1.png


Uhm...Help please?
 
PROBLEM!!!! everytime i pickup a drop (e.g wood apple acorn) it stops my player and i cant move!! oh!!! THE HUMANITY but srsly please help ok thank you!!!
 
Could you PLZ repair the mod browser! Now u must download every mod from there and for me it shows: Mod Browser OFFLINE (Unknown) When i go to the mod browser. Im on mac, 1.3.4.4, 0.9.0.2.
 
(I'm assuming you are asking about making recipes from multiple input options. I realize others have answered already, but I was already typing, so this should be useful for someone.) There is the simple way and the "better" way.

The simple way is to just create two different recipes.
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MagicMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();

recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.IceMirror);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
The better way is to use craft groups. For example, there is a vanilla Craft group called Wood, which allows recipes to use any type of wood:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddCraftGroup(CraftGroup.Wood, 2);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
If you want to make your own craft groups, do the following in your "mod" class:
Code:
public override void AddCraftGroups()
{
AddCraftGroup("MagicMirrors", Lang.misc[37] + " " + "Magic Mirror", ItemID.IceMirror,ItemID.MagicMirror);
}
Then make recipes like this:
Code:
ModRecipe recipe = new ModRecipe(mod);
recipe.AddCraftGroup(mod, "MagicMirrors");
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Chairs);
recipe.AddTile(TileID.Tables);
recipe.SetResult(this);
recipe.AddRecipe();
The main advantage to using craft groups is avoiding mistakes and writing clearer code. There are 8 types of wood in the Wood craftgroup. If you make 8 recipes, and later decide to change the recipe amounts needed, chances are you will mistype and problems will arise.

Also, make sure to include "using Terraria.ID;" at the top. It really makes everything clearer and looks better. "ItemID.Gel" is much better than "Terraria.ID.ItemID.Gel"

I was wondering, is there a way to use the craft group but add an exception? Say for example I want to make a mod where any wood can be turned into the normal wood, you wouldn't want normal wood to be on that list, so is there a way to have the game skip over that ingredient?
 
Can someone tell me what this does?
Please, make it simple to understand.
eg. (red value,blue value,green value,)
Code:
private int[] dusts = {160, 600, 64, 61, 50, 60, 590};
 
Back
Top Bottom