Possessed Inkie Shark
Terrarian
How would I find the players current health and mana? I want to make an accessory that heals the player while their heath and mana are at certain values
I would probably just do the value check in the effects of the accessories, sort of something like this.How would I find the players current health and mana? I want to make an accessory that heals the player while their heath and mana are at certain values
public override void Effects(Player player)
{
if(player.statLife < 200 && player.statMana < 200)
{
//Does something.
}
}
public override string PostSetChat(string chat) //called after chat has been set.
{
Main.NewText("Type: " + npc.type);
return "Hello World";
}
Sounds like you might need to verify your games cache.This probably doesn't belong here, but i can't get tAPI to even run anymore
It crashes with no message before it even opens up
I found some sort of crash log that says:
Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Images\CraftButton". File not found.
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(System.String assetName)
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset(System.String assetName, System.Action`1[[System.IDisposable, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load(System.String assetName)
at Terraria.Main.LoadContent()
at Microsoft.Xna.Framework.Game.Initialize()
at Terraria.Main.Initialize()
at Microsoft.Xna.Framework.Game.RunGame(System.Boolean useBlockingRun)
at Terraria.Program.Main(System.String[] args)
System.IO.FileNotFoundException: Error loading "Content\Images\CraftButton.xnb". File not found.
at Microsoft.Xna.Framework.TitleContainer.OpenStream(System.String name)
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(System.String assetName)
I did that like five times.Sounds like you might need to verify your games cache.
Terraria 1.2.4.1 and earlier had a file named 'CraftButton.xnb' in the folder 'SteamApps\common\Terraria\Content\Images'.Am i seriously the only person in existence that can't launch tAPI?
This probably doesn't belong here, but i can't get tAPI to even run anymore
It crashes with no message before it even opens up
I found some sort of crash log that says:
Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Images\CraftButton". File not found.
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(System.String assetName)
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset(System.String assetName, System.Action`1[[System.IDisposable, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load(System.String assetName)
at Terraria.Main.LoadContent()
at Microsoft.Xna.Framework.Game.Initialize()
at Terraria.Main.Initialize()
at Microsoft.Xna.Framework.Game.RunGame(System.Boolean useBlockingRun)
at Terraria.Program.Main(System.String[] args)
System.IO.FileNotFoundException: Error loading "Content\Images\CraftButton.xnb". File not found.
at Microsoft.Xna.Framework.TitleContainer.OpenStream(System.String name)
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(System.String assetName)
Terraria 1.2.4.1 and earlier had a file named 'CraftButton.xnb' in the folder 'SteamApps\common\Terraria\Content\Images'.
Terraria 1.3 and newer have files named 'Craft_Toggle_0.xnb' through 'Craft_Toggle_3.xnb' in the folder 'SteamApps\common\Terraria\Content\Images\UI'.
tAPI is made for Terraria 1.2.4.1, and thus uses the images Terraria 1.2.4.1 uses.
It seems as though you updated Terraria to 1.3, which deletes the old CraftButton file, and creates the 4 new Craft_Toggle buttons. And now you're trying to run tAPI and it can't find the CraftButton file. If you were to get this file, and any other files the 1.3 update may have deleted, you should be able to run tAPI again. Just ask around in the forums for someone that hasn't updated yet to share that file with you. And make sure to put it in the folder I mentioned above.
Edit:
I used a file recovery program to undelete the file. I'll post it here. If it violates some rule to post it, I'll remove the link.
The error message indicates where the problem occurs:Tried to make an invasion event, made an NPC to test it with, got this error right here
How would i solve this?