tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
Everytime I try to load my mod I get this error, But it has no errors when I build the mod:

TAPI.Mods+LoadException: Project Unity.tapi: TAPI.Mods+LoadException: Town NPC "Project Unity:ExampleTownNPC" is missing a code instance! Town NPCs require code instances!
at TAPI.ModJsonHandler.HandleNPC(ModBase modBase, JsonData j, String fname)
at TAPI.ModJsonHandler.Handle(ModBase modBase)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()
at TAPI.Mods.Load()

The mod is attached to this reply
 

Attachments

  • ProjectUnity.zip
    3.5 KB · Views: 143
And how do you get an NPC to spawn in a specific place? i.e: Hell? I'm using CS to write the code for my Hell Eater to spawn but I want him to spawn, well, in hell obviously. And how do I do that? I've already done the override event, but how to I make him spawn in underworld or any specific place?

player.zone["Hell"] works for the Underworld, most npcs checks the player's zones for it's biome requirement.

I Found a very annoying bug it's like where zombie it's coming he's sound is like 100%
Second bug is when raining sound stutters.

@Edit And one another bug is when i chop down tree is little frame lag
On vanilla i don't have it.

Zombie yelling volume appears to be a bug and will be fixed.
 
help! im trying to make a mod and it has this error
JsonException: ModInfo Error: The given key was not present in the dictionary. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()
--- End of inner exception stack trace ---
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()

Edit: Never mind. I fixed it, i forgot i had to save the .json file first.

Edit2 : now im getting this error
TAPI.Mods+LoadException: mod.tapi: System.BadImageFormatException: Could not load file or assembly '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.BadImageFormatException: Bad IL format.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()


at TAPI.Mods.Load()

Edit3: How do i do spoilers?
 
Last edited:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at TAPI.Mods.SaveModState()
at TAPI.Mods.Load()

not sure what to do don't have any mods right now
That is a bug. Try deleting and reinstalling tapi. That fixed it for me.[DOUBLEPOST=1414270299][/DOUBLEPOST]
help! im trying to make a mod and it has this error
JsonException: ModInfo Error: The given key was not present in the dictionary. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()
--- End of inner exception stack trace ---
at tAPI_Builder.MainWindow.<>c__DisplayClass8.<BtnBuild_Click>b__0()

Edit: Never mind. I fixed it, i forgot i had to save the .json file first.

Edit2 : now im getting this error
TAPI.Mods+LoadException: mod.tapi: System.BadImageFormatException: Could not load file or assembly '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.BadImageFormatException: Bad IL format.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()


at TAPI.Mods.Load()

Edit3: How do i do spoilers?
Use tAPI r11, r12 doesn't work, that's why you got that error.
 
That is a bug. Try deleting and reinstalling tapi. That fixed it for me.[DOUBLEPOST=1414270299][/DOUBLEPOST]
Use tAPI r11, r12 doesn't work, that's why you got that error.
What?
First off, I already said in a previous post that bug can be ignored, it has nothing to do with reinstalling tAPI. It's a known issue and we will fix it in the next release.
Secondly, tAPI r12 works just fine for making a mod, and has nothing to do with his error. Also, as you can see he fixed the error. Please don't tell people something isn't working without knowing all the facts.
 
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace MrBlockMod.NPC
{
public class HellEater : ModNPC
{
public HellEater(MobBase modBase, NPC n): base(mBase, n){ }

public override bool CanSpawn(int x, int y, int type, Player spawnOn)
{
player.zone["Hell"]
}

Is this cs code good to spawn Hell Eater? Also I had issues of how TAPI.ModNPC will only take 1 argument.
 
Last edited:
tAPI crashed for me and deleted my player data ;-;

This also seemed to happen to me as well. Was sitting there and the Traveling Merchant just showed up. A few seconds later the game locked up then a small window popped up saying tAPI had crashed. Got back in-game and my character was gone. Went to look in the tAPI folder under characters and the backup version of the character was there, but the actual character file was gone.
 
I've been porting my mod from r10 tp r11, and with the help of Visual Studio Express, I've found it fairly easy. At least until I tried to load some textures. I spent hours on this, but I couldn't for the life of me work out why I kept on getting key not found exceptions. But it was simple as removing the .png from the end of the texture string. XD! How come this was changed from r10?

While on the topic of loading textures, I'd like to know if the way I'm doing it is bad practice. I have several different accessories that, when equipped, replace the textures of the player with my own. Currently I'm loading the textures directly into the accessories class in it's .cs file. Is it better practice to load it into my MBase.cs file with the OnLoad hook?

A few more things. I tried my mod out in multiplayer and found that a field that I wanted to be unique for each player was common across all players. How do I attach a custom field to each player in a world running my mod? Also, I'd like to replace the 'MapHead' texture that's used on the map for my player while my accessory is equipped.

Finally, I noticed something odd about the OnEquip and OnUnEquip hooks. When you equip any equippable item, the OnUnEquip hook is called. Likewise when the same item is un-equiped, the OnEquip hook is called. Is there a reason why they are swapped over? I used the following code to test this:

Code:
        public override void OnEquip(Player p, TAPI.UIKit.ItemSlot slot)
        {
            Main.NewText("Equipped!");
        }
        public override void OnUnEquip(Player p, TAPI.UIKit.ItemSlot slot)
        {
            Main.NewText("Un-Equipped!");
        }

Anyway, thanks for your commitment to this project.
 
after a while of trying to figure it out i still get this
TAPI.Mods+LoadException: Project S.tapi: System.BadImageFormatException: Could not load file or assembly '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.BadImageFormatException: Bad IL format.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()


at TAPI.Mods.Load()
edit: It also doesn't load the mod
 
after a while of trying to figure it out i still get this
TAPI.Mods+LoadException: Project S.tapi: System.BadImageFormatException: Could not load file or assembly '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: '0 bytes loaded from tAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.BadImageFormatException: Bad IL format.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at TAPI.Mod.<Load>b__0(BinBuffer bb)
at TAPI.Mods.HandleTapiModFile(FPath path, Action`1 action)
at TAPI.Mods.HandleModFile(FPath path, Action`1 action)
at TAPI.Mod.Load()
at TAPI.Mods.Load()


at TAPI.Mods.Load()
edit: It also doesn't load the mod
I had that error to in r12. I'm using r11 and it works. Get an expert to help you like shockta.
 
I had that error to in r12. I'm using r11 and it works. Get an expert to help you like shockta.
ok, thanks,
but wouldn't i have to update it. if so, how? im a noob at making mods.

Edit: For some reason i can't craft the stuff
 
Last edited:
I think there is a probelm with tapi. The problem is, that i cannot craft any vanilla wall back to their the material from wich those are crafted. Example: i made tons of wooden walls, and there is no way to craft them back into wood.
 
I think there is a probelm with tapi. The problem is, that i cannot craft any vanilla wall back to their the material from wich those are crafted. Example: i made tons of wooden walls, and there is no way to craft them back into wood.
I'll look in to this later, thanks
 
Does anyone have the same problem I'm having right now? My problem is that whenever i load tapi it says that mod is loaded, but whenever I try to find the items that I can craft it doesn't appear, I already made sure, if I have the items I need (mostly just a dirt block), there are no errors appearing, so obviously there maybe something new that I'm not entirely aware of, I already tried reloading my mods, and uninstalling and re-installing game launcher and tapi (got the currently latest version r12), and already tried deleting my old tapi folder and doing all the process I've mentioned, so please guys help me... oh yeah, here's my mod so you guys can try it and if I'm doing something wrong... sorry for the long post...
 

Attachments

  • Breaker Mod.zip
    41.4 KB · Views: 175
Status
Not open for further replies.
Back
Top Bottom