• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.

GiantEnemyDinosaurPrime

Skeletron Prime
Got this error trying to build mod, any suggestions?

Terraria 1.2.4.1, tAPI Builder r11

========================================
Building mod Dinosauria

Validating Jsons...
Validating ModInfo.json
Compiling code...
BabyDinosaurNPC.cs (32,77)
'Dinosauria.NPCs.BabyDinosaurNPC.SetChatButtonAction(string[], int)': no suitable method found to override
public override Action SetChatButtonAction(string[] buttons, int buttonIndex)
^

Failed to build Dinosauria.

========================================

Built 0 mods.
 

Cryshal

Terrarian
Hey guys, I just looked at tAPI after about two months and I'm really happy with what you've done and extremely happy to see either the documentation has been updated or you added new features. It's a really great tool you've built for the community to use.

P.S. It would be amazing if you focused on the documentation for a while since they are apparently not close to being done or fully accurate.
 

Arkhayla

Terrarian
Got this error trying to build mod, any suggestions?

Terraria 1.2.4.1, tAPI Builder r11

========================================
Building mod Dinosauria

Validating Jsons...
Validating ModInfo.json
Compiling code...
BabyDinosaurNPC.cs (32,77)
'Dinosauria.NPCs.BabyDinosaurNPC.SetChatButtonAction(string[], int)': no suitable method found to override
public override Action SetChatButtonAction(string[] buttons, int buttonIndex)
^

Failed to build Dinosauria.

========================================

Built 0 mods.

I already answered this on the previous page:

These were changed for r11, this should help

Code:
public override void SetChatButtons(ref string[] buttons) { }
//NOTE: Changed how this works because the way it worked before (returning an Action) was idiotic as you can just run the code here,
//so the only reason I even had it was for shops. Changed it to a bool, much cleaner solution. :P
public override void OnChatButtonClicked(string[] buttons, int buttonIndex, ref bool openShop) { }
 

bad_news

Golem
Is there a way to allow items/accessories to grant a status immunity? I looked through the documentation, but nothing I found seems to be it.
 

GiantEnemyDinosaurPrime

Skeletron Prime
I already answered this on the previous page:
Terraria 1.2.4.1, tAPI Builder r11

========================================
Building mod Dinosauria

Validating Jsons...
Compiling code...
BabyDinosaurNPC.cs (9,73)
Invalid token '{' in class, struct, or interface member declaration
{
^
BabyDinosaurNPC.cs (21,74)
Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
buttons[0] = "Shop";
^
BabyDinosaurNPC.cs (24,74)
Invalid token '=' in class, struct, or interface member declaration
buttons[0] = "Shop";
^
BabyDinosaurNPC.cs (21,75)
Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
buttons[1] = "Health";
^
BabyDinosaurNPC.cs (24,75)
Invalid token '=' in class, struct, or interface member declaration
buttons[1] = "Health";
^
BabyDinosaurNPC.cs (25,77)
Expected class, delegate, enum, interface, or struct
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (56,77)
Identifier expected
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (58,77)
Expected class, delegate, enum, interface, or struct
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (63,87)
Expected class, delegate, enum, interface, or struct
Player player = Main.player[Main.myPlayer];
^
BabyDinosaurNPC.cs (13,104)
Type or namespace definition, or end-of-file expected
}
^
BabyDinosaurNPC.cs (13,105)
A namespace cannot directly contain members such as fields or methods
return null;
^
BabyDinosaurNPC.cs (9,106)
Type or namespace definition, or end-of-file expected
}
^
Failed to build Dinosauria.

========================================

Built 0 mods.
Also now the tAPI packer is screwed up, anybody have a tAPI packer for r11?
 

Arkhayla

Terrarian
Terraria 1.2.4.1, tAPI Builder r11

========================================
Building mod Dinosauria

Validating Jsons...
Compiling code...
BabyDinosaurNPC.cs (9,73)
Invalid token '{' in class, struct, or interface member declaration
{
^
BabyDinosaurNPC.cs (21,74)
Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
buttons[0] = "Shop";
^
BabyDinosaurNPC.cs (24,74)
Invalid token '=' in class, struct, or interface member declaration
buttons[0] = "Shop";
^
BabyDinosaurNPC.cs (21,75)
Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
buttons[1] = "Health";
^
BabyDinosaurNPC.cs (24,75)
Invalid token '=' in class, struct, or interface member declaration
buttons[1] = "Health";
^
BabyDinosaurNPC.cs (25,77)
Expected class, delegate, enum, interface, or struct
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (56,77)
Identifier expected
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (58,77)
Expected class, delegate, enum, interface, or struct
public override void SetChatButtons(ref string[] buttons) { }
^
BabyDinosaurNPC.cs (63,87)
Expected class, delegate, enum, interface, or struct
Player player = Main.player[Main.myPlayer];
^
BabyDinosaurNPC.cs (13,104)
Type or namespace definition, or end-of-file expected
}
^
BabyDinosaurNPC.cs (13,105)
A namespace cannot directly contain members such as fields or methods
return null;
^
BabyDinosaurNPC.cs (9,106)
Type or namespace definition, or end-of-file expected
}
^
Failed to build Dinosauria.

========================================

Built 0 mods.
Also now the tAPI packer is screwed up, anybody have a tAPI packer for r11?
tAPI packer has been sunset (out moded? obsoleted? eclipsed?... it's dead jim!)... use tAPI Builder, should have been installed with tAPI
 

Yoraiz0r

Lead Developer
Re-Logic
Is there a way to allow items/accessories to grant a status immunity? I looked through the documentation, but nothing I found seems to be it.
You will indeed not find this in the documentation, its a feature you can use without requiring tAPI specifically.
Players have a field called 'buffImmune' which is an array of booleans (true/false), in an item's or a buff's method, you can set
Code:
player.buffImmune[buffType] = true; //you can get the buffType by using BuffDefs.ByName["modName:buff name"]
to make the player immune to that buff.
 

SolaR

Golem
how do you uninstall it? I want to play vanilla terraria but it always opens tapi even through the steam client
 

TheUnrealMegashark

Official Terrarian
how do you uninstall it? I want to play vanilla terraria but it always opens tapi even through the steam client
Well, instead of uninstalling it you could always install GameLauncher and use that, or you could navigate to your Terraria steam folder and swap out the names for terraria.exe and your terraria original.exe (or whatever the latter is called, can't recall exactly atm). The reason it does that is because steam always looks for the file terraria.exe in that specific directory and runs it.

If you still wish to uninstall it, it should be under your control panel->uninstall programs.
 

Yoraiz0r

Lead Developer
Re-Logic
Well, instead of uninstalling it you could always install GameLauncher and use that, or you could navigate to your Terraria steam folder and swap out the names for terraria.exe and your terraria original.exe (or whatever the latter is called, can't recall exactly atm). The reason it does that is because steam always looks for the file terraria.exe in that specific directory and runs it.

If you still wish to uninstall it, it should be under your control panel->uninstall programs.
Simply clearing local game content on steam / verify cache should work as well, rest assured that this does nothing to your terraria saves.
 

Bullseye55

Brain of Cthulhu
Just want to submit a bug report here. Tested with Main.NewText.

public override bool CanSpawn(int x, int y, int type, Player p)

This hook doesn't seem to be triggering when it should, or at all. I have not seen any of my custom NPCs spawn naturally since the R11 pre-release to me. Using updated code for R11.

Can anyone else confirm this on their side?
 

Ridley

Terrarian
Bug:
The current r10 link under download archives is actually r11. (the direct download link is okay)

I didn't see this anywhere in the thread via forum search.
 

Arkhayla

Terrarian
Yesterday we found a bug where mod settings are not being saved properly. For now, you can change a mod's settings, click back, then play single player with the changed settings but if you leave the game or go back in to mod settings they are NOT saved. This means you also have no way of using your edited settings in multi player.

This issue will be resolved in r12, but for now there is no way around it. Our apologies for any inconvenience!

Please keep reporting those bugs! We would like to squash as many as we can for the r12 release.

Thanks everyone, keep up the good work and keep those mods coming!

public override bool CanSpawn(int x, int y, int type, Player p)
This hook doesn't seem to be triggering when it should, or at all.
I'll look in to this Bullseye55, thanks for pointing it out. I'll reply later with my findings or you can ask for an update in the IRC :)

Bug:
The current r10 link under download archives is actually r11. (the direct download link is okay)

I didn't see this anywhere in the thread via forum search.
Thanks, we'll double check the links

Well, can you help me with the error?
That's actually... a LOT of errors - You should join the IRC channel (linked in OP) and ask for help there, going through all of those on here is a bit tedious. On a side note, it should tell you exactly where to find the error right in that log. If you are unfamiliar with C#, here is a great tutorial http://rbwhitaker.wikidot.com/xna-tutorials.

If I am mistaken, and you are familiar with C#, please stop by the IRC channel and let us help you in real time.
 
Last edited:
Status
Not open for further replies.
Top Bottom