tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
My server crashes anytime someone destroys a minecart track. I am running on a x64 win8 machine. I am running Thorium mod+ and tAPI r15. I get the following error messages;


Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object.
at Terraria.Minecart.GetTrackItem(Tile trackCache) in d:\Repo\git\tAPI\tAPI\Terraria\Minecart.cs:line 1630
at Terraria.WorldGen.KillTileLogic(Int32 i, Int32 j, Boolean& cont, Boolean fail, Boolean effectOnly, Boolean noItem) in d:\Repo\git\tAPI\tAPI\Terraria\WorldGen_Gen.cs:line 29544
at Terraria.WorldGen.KillTile(Int32 i, Int32 j, Boolean fail, Boolean effectOnly, Boolean noItem) in d:\Repo\git\tAPI\tAPI\Terraria\WorldGen_Gen.cs:line 26890
at Terraria.MessageBuffer.GetData(Int32 start, Int32 length) in d:\Repo\git\tAPI\tAPI\Terraria\MessageBuffer.cs:line 701
at Terraria.NetMessage.CheckBytes(Int32 i) in d:\Repo\git\tAPI\tAPI\Terraria\NetMessage.cs:line 1763
at Terraria.Netplay.ServerLoop(Object threadContext) in d:\Repo\git\tAPI\tAPI\Terraria\Netplay.cs:line 423
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
 
what would the code be for when a debuff ends and another one begins?
This code will trigger a new buff once the current one runs out. I think that's what you were asking for.
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

using TAPI;
using Terraria;

namespace YourMod.Buffs
{
    public class YourBuff : TAPI.ModBuff
    {
        public override void End(Player p, int index)
        {
            p.AddBuff ("YourMod:nextBuff", 300, true); //300 = 5 seconds
        }
    }
}
 
This code will trigger a new buff once the current one runs out. I think that's what you were asking for.
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

using TAPI;
using Terraria;

namespace YourMod.Buffs
{
    public class YourBuff : TAPI.ModBuff
    {
        public override void End(Player p, int index)
        {
            p.AddBuff ("YourMod:nextBuff", 300, true); //300 = 5 seconds
        }
    }
}
Thank you :D
 
Whenever I kill the Wall of Flesh in my world, the game crashes (No report, just "tAPI has stopped working")
Mods:
Pumpking's Mod
GRealm
Thorium Mod+
Some of Shockah's mods

Anyone know a fix?
 
Whenever I kill the Wall of Flesh in my world, the game crashes (No report, just "tAPI has stopped working")
Mods:
Pumpking's Mod
GRealm
Thorium Mod+
Some of Shockah's mods

Anyone know a fix?
Check the mod sources, look in the ModWorld CS file, see if any of them have -
public override WorldGenModifyHardmodeTaskList()
Since that is what gets called when defeating the Wall of Flesh the first time.

If the error is happening while the world is already in Hardmode. I'd check for a global ModNPC file to see if any of those mods added a loot rule or modified the NPC loot functions for the Wall of Flesh.
 
Check the mod sources, look in the ModWorld CS file, see if any of them have -
public override WorldGenModifyHardmodeTaskList()
Since that is what gets called when defeating the Wall of Flesh the first time.

If the error is happening while the world is already in Hardmode. I'd check for a global ModNPC file to see if any of those mods added a loot rule or modified the NPC loot functions for the Wall of Flesh.
Thanks! All I could find was this:
Code:
public override void WorldGenModifyTaskList(List<WorldGenTask> list)
        {
            if (Generate == null) Generate = new GenOres(modBase);
            list.Add(Generate);
        }
 
I'm not sure if this is where this should go:(, but currently my Tapi compiler (Builder) wont open it simply "Stops working" as windows puts it. Please help


-Mant1s
 
Thanks! All I could find was this:
Code:
public override void WorldGenModifyTaskList(List<WorldGenTask> list)
        {
            if (Generate == null) Generate = new GenOres(modBase);
            list.Add(Generate);
        }
Unfortunately that only modifies the World Generation task list and isn't called again after the world has been generated. So it shouldn't be the cause to your problem. I suppose the next step would be to kill the Wall of Flesh with only 1 mod on at a time.

To make things faster, do this.
  • Make sure the Dev Console is enabled
    • Just in case...
    • It's activated from the Main Menu -> Mods
    • In the lower left corner is the option to enable/disable
  • Copy this code
    Code:
    for (int i = 0; i < 200; i++) { if (!Main.npc[i].active) { continue; } if (Main.npc[i].type != 113) { continue; } Main.npc[i].life = 0; Main.npc[i].checkDead(); }
  • Summon the Wall of Flesh
  • Open the Dev console. (Default key is '~' )
  • Paste that line of code and press enter

I'm not sure if this is where this should go:(, but currently my Tapi compiler (Builder) wont open it simply "Stops working" as windows puts it. Please help

-Mant1s
Make a copy of Terraria.exe in the same folder it's found in. Rename the copy to tapi.exe.
 
Whenever I have 4 worlds, I cannot scroll down to add a 5th one, all I can do is import a vanilla world. Also whenever you import a vanilla world all of your Town NPC's are killed. Thanks for reading, hope this gets fixed soon.

EDIT:

Also there is a bug with music, sometimes when entering a underground snow biome Boss 1 music plays.
 
Last edited:
Would anybody know how to change the scale of the game? My friend has a big screen and he cant see anything when he plays because everything is too small.
 
In case you haven't found out yet you could add this in the json.
Code:
    "holdoutOffset": [-1, 0],
You can change the numbers to your liking too.

Thanks! Now, as I can change the position of the projectile before firing?

PS: Sorry for my english.
 
I dont know if im just blind or something, but I have no idea, and request help, on making a server. NOT hosting one [google thinks this]. Making one, for a mod. tAPI or not.

Edit: Nevermind, I was trying to merge the source code of various tAPI mods with non tAPI mods and only now realized that its literally impossible, or would take more time then its worth.
 
Last edited:
Is it possbible to make changes to the ai style for flamethrower without rewriting the entire ai? The ai style is 23 and as you know the flametrower shoots flames. I want black flames, so it it just the dust that should be changed. I don't think it is possible to change that but I am asking anyway.
 
Status
Not open for further replies.
Back
Top Bottom