1. Encountering issues with the Localization/Translations with 1.3.5? Please report them via the section linked below so that we can account for all of them and have them addressed. Thanks! Localization Bugs & Issues Section

tAPI [Discontinued] tAPI - A Mod To Make Mods

Discussion in 'Released' started by Yoraiz0r, Oct 14, 2014.

Thread Status:
Not open for further replies.
Thread was lock by: Tunnel King
Reason: discontinued prior to 1.3 release
Lock date: 20:26 04-08-2016
  1. Arkhayla

    Arkhayla Quality Director Re-Logic

    The enthusiasm is welcome! But for your own protection, one word posts can get you in trouble so be careful :joy:
     
    Ersatz likes this.
  2. zadum4ivii

    zadum4ivii Official Terrarian

    How can I create a solution for the clentaminator?
     
  3. Arkhayla

    Arkhayla Quality Director 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?

    EDIT: Yoraiz0r's description is much better - as expected :happy:
     
    Last edited: Oct 15, 2014
    Grox The Great and Bullseye55 like this.
  4. Yoraiz0r

    Yoraiz0r Lead Developer Re-Logic

    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)
     
  5. TheUnrealMegashark

    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
     
    Grox The Great likes this.
  6. Kefke

    Kefke Steampunker

    Where is the version that doesn't crash when I dare to actually try loading mods with it?
     
  7. Arkhayla

    Arkhayla Quality Director Re-Logic

    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?
     
    Bullseye55 likes this.
  8. Kefke

    Kefke Steampunker

    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!
     
  9. Arkhayla

    Arkhayla Quality Director Re-Logic

    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.
     
    Kefke and Bullseye55 like this.
  10. Kefke

    Kefke Steampunker

    Thank you very much. I should apologise for my tone. Just a trifle miffed, is all.
     
    Arkhayla likes this.
  11. Arkhayla

    Arkhayla Quality Director Re-Logic

    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:

    Also this: thanks W1K
     
    Grox The Great, Bullseye55 and Kefke like this.
  12. W1K

    W1K Witch

  13. Yoraiz0r

    Yoraiz0r Lead Developer Re-Logic

    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.
     
  14. Bullseye55

    Bullseye55 Brain of Cthulhu

    Just to clarify from a third-person standpoint: ModTileType can be used for spreading biomes/blocks, correct?
     
  15. Yoraiz0r

    Yoraiz0r Lead Developer Re-Logic

    "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: Oct 15, 2014
  16. Eikester

    Eikester Official Terrarian

    so uhm i have this in my tiles json:
    Code:
    "placementConditions": ["wall"]
    but gives the following error
    Code:
    Validating Jsons...
    Key "placementConditions" is missing or is not a String!
    but it is listed here http://tapi.axxim.net/docs/?mode=properties&doc=tile
     
    Bullseye55 likes this.
  17. TheUnrealMegashark

    TheUnrealMegashark Official Terrarian

    For some reason it is not accepting a value of string[], try doing this maybe?

    "placementConditions": "wall"
     
    Nopezal and Arkhayla like this.
  18. Eikester

    Eikester Official Terrarian

    yes this works
     
  19. berberborscing

    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[​IMG]
    What is the new player method for the turtle thorns effect called?
     
  20. Yoraiz0r

    Yoraiz0r Lead Developer Re-Logic

    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
     
Thread Status:
Not open for further replies.