• 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.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • 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.

Arkhayla

Terrarian
How can I create a solution for the clentaminator?
I thought this question might come up, and the answer is definitely not simple. You would need to modify the weapon to use a new ammo. Then you would need to make a new projectile for the gun most likely which changes tiles it interacts with based on your own parameters. This is not a simple undertaking and is probably not immediately supported. If one of the other team members want to weigh in here?

EDIT: Yoraiz0r's description is much better - as expected :happy:
 
Last edited:

Yoraiz0r

Lead Developer
Re-Logic
I thought this question might come up, and the answer is definitely not simple. You would need to modify the weapon to use a new ammo. Then you would need to make a new projectile for the gun most likely which changes tiles it interacts with based on your own parameters. This is not a simple undertaking and is probably not immediately supported. If one of the other team members want to weigh in here?
This is quite a bit more than what he needs to do , the "solution" is quite simple. (hehe)
Items in Terraria (and thus tAPI) use a system where if an item has a 'useAmmo' type, it will be able to use any item of this 'ammo' type.
So for example Bows have useAmmo of 'arrow' type and arrows have an ammo of 'arrow' type, they match so using bows will shoot arrows.
The same system applies for the clentaminator.
You just need to make a new ammo item, and setting "ammo": to that of the clentaminator's (which you can find out via decompiling or whatever other means) , and then make that ammo item shoot a custom clentaminator projectile that converts tiles as you wish it to.
It's all jsons aside the actual solution's visuals and tile conversion , which are also relatively simple if you look at its AI style.

(Also just noting for the other team members here, we need to add tiles "directional" and "safeForSpawn" json properties)
 

TheUnrealMegashark

Official Terrarian
I read up on the difference between code and instancecode on the docs, but I'm curious as to which situation to use which. This of course extends to ModTile vs ModTileType and how globals fit into there. If someone could clarify on this, I'd appreciate it! Thanks
 

Kefke

Steampunker
The mods you are loading may not be updated to this version which is the problem. Does it crash when you run it without any mods?
I am asking where the version that is compatible with the mods that currently exist can be obtained, and so that is entirely irrelevant. Furthermore, I would like to point out that most people would have the sense to maintain links to older versions (and generally list the previous version as recommended) until the majority of modders have had time to update their projects. There being only one link, to a version that only came out yesterday, to which (so far as I can tell) nobody has updated yet, is absurd!
 

Arkhayla

Terrarian
I am asking where the version that is compatible with the mods that currently exist can be obtained, and so that is entirely irrelevant. Furthermore, I would like to point out that most people would have the sense to maintain links to older versions (and generally list the previous version as recommended) until the majority of modders have had time to update their projects. There being only one link, to a version that only came out yesterday, to which (so far as I can tell) nobody has updated yet, is absurd!
We could update the OP with the old links, not sure why they were removed from the TO post. I will ask the team to add links to the old files here. Sorry about that.
 

Arkhayla

Terrarian
Thank you very much. I should apologise for my tone. Just a trifle miffed, is all.
appreciate the apology, we are trying very hard to cover all areas but sometimes we miss things. Yoraiz0r is adding the link to the OP as we speak. So in the future, just let us know the link is missing in a less accusing way and we will fix it :cool:

It has been posted a few pages ago.
http://tapi.axxim.net/releases/r10.exe
Also this: thanks W1K
 

Yoraiz0r

Lead Developer
Re-Logic
I read up on the difference between code and instancecode on the docs, but I'm curious as to which situation to use which. This of course extends to ModTile vs ModTileType and how globals fit into there. If someone could clarify on this, I'd appreciate it! Thanks
I'll keep this short and feel free to ask again if my explanation isn't clear enough.
The difference between ModTile and ModTileType is as the name suggests, ModTileType runs on all the tiles of its type, using only a single (so called 'static') instance of code (which is of that ModTileType class).
Contrary to that, a ModTile will create an instance for every single tile of its type in the world, and is primarily used for when you need per-update things to happen (as it has OnUpdate in its hooks).

An example of a ModTileType would be blocks that glow, or things that can function only based on frames.
An example of a ModTile would be blocks store data in them (for example counting frames from the last time you right-clicked them).

On the note of globals - you may have a global ModTileType , but you may not have a ModTile.
Global ModTileTypes will run their hooks on -every- tile.
 

Bullseye55

Brain of Cthulhu
I'll keep this short and feel free to ask again if my explanation isn't clear enough.
The difference between ModTile and ModTileType is as the name suggests, ModTileType runs on all the tiles of its type, using only a single (so called 'static') instance of code (which is of that ModTileType class).
Contrary to that, a ModTile will create an instance for every single tile of its type in the world, and is primarily used for when you need per-update things to happen (as it has OnUpdate in its hooks).

An example of a ModTileType would be blocks that glow, or things that can function only based on frames.
An example of a ModTile would be blocks store data in them (for example counting frames from the last time you right-clicked them).

On the note of globals - you may have a global ModTileType , but you may not have a ModTile.
Global ModTileTypes will run their hooks on -every- tile.
Just to clarify from a third-person standpoint: ModTileType can be used for spreading biomes/blocks, correct?
 

Yoraiz0r

Lead Developer
Re-Logic
Just to clarify from a third-person standpoint: ModTileType can be used for spreading biomes/blocks, correct?
"Yes".
WE COMPLETELY FORGOT ABOUT IT. :dryadeek:

ModTileType has no Update hook and apparently we forgot to implement ModWorld's hook for this.
Apologies but you can't do it without hackery for now, we will add something to handle it in r12.

Edit:
So I just updated the first post of the thread with a download to r10 and fixed the logo a bit.
That is all.
 
Last edited:

berberborscing

Skeletron Prime
I am trying to make my 1.2.2 mod compatible for 1.2.4.1, so far from other's experiences I've been doing so good so far... but this appeared

What is the new player method for the turtle thorns effect called?
 

Yoraiz0r

Lead Developer
Re-Logic
I am trying to make my 1.2.2 mod compatible for 1.2.4.1, so far from other's experiences I've been doing so good so far... but this appeared

What is the new player method for the turtle thorns effect called?
Its now p.thorns, a float value that is set to 1/3f from thorns potion and to 1f from turtle armor.
Essentially , its "what percentage of the damage taken do you give back to the enemy".
Code:
         p.thorns = Math.Max(p.thorns, 1f);
Should do the trick for you
 
Status
Not open for further replies.
Top Bottom