tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
To make it consume rockets, add this line to the weapon's code:
Code:
"useAmmo": 771,
To make it shoot rockets, IDK.
Thank you very much!
If rockets work the same way as bullets do, I think this should make it shoot rockets as well:
Code:
"shoot":771,
 
I'm not sure how the game deals with explosive weapons bullets as every weapon seems to have its own projectile with difference being whether they destroy tiles or not along with the damage. Rockets seem to use the projectile number 134. Json parameter would be
Code:
"shoot": 134,
 
I'm not sure how the game deals with explosive weapons bullets as every weapon seems to have its own projectile with difference being whether they destroy tiles or not along with the damage. Rockets seem to use the projectile number 134. Json parameter would be
Code:
"shoot": 134,
I tried that. It shoots Hallow Spray. :merchanttongue:
 
I tried that. It shoots Hallow Spray. :merchanttongue:
The specific projectile seems to be called "Rocket" in the sources, and the projectiles right after are Proximity Mine and Grenade. It sounds pretty weird. Altho the rockets seem to use weird values for projectiles ("Rocket I" being id 0 which does not exist, "Rocket IV" being Sunfury).
 
The specific projectile seems to be called "Rocket" in the sources, and the projectiles right after are Proximity Mine and Grenade. It sounds pretty weird. Altho the rockets seem to use weird values for projectiles ("Rocket I" being id 0 which does not exist, "Rocket IV" being Sunfury).
Yep, this works! Thank you very much!
See, this is how every single projectile should be named. No silly numbers, but instead civilized words!
 
I know how to use music, but I don't know in what folder they should go. I tried using a wav file in an "Audios" folder, along with trying throwing it in the "Sounds" folder, none worked.
Seriously, what to call the folder? I tried "musics" is also not working =(.
[DOUBLEPOST=1421440467][/DOUBLEPOST]And still the music of the original boss plays.
 
Now I want to make it so the weapon shoots rockets but uses up a different item as ammo. For example, I want it to shoot Rocket Is but use up grenades.
Unfortunately, it doesn't seem to work. It still uses rockets even if I set it to grenades.
Seriously, what to call the folder? I tried "musics" is also not working =(.
[DOUBLEPOST=1421440467][/DOUBLEPOST]And still the music of the original boss plays.
I don't think "Musics" is the correct word anyway.
Try "Music".
 
Now I want to make it so the weapon shoots rockets but uses up a different item as ammo. For example, I want it to shoot Rocket Is but use up grenades.
Unfortunately, it doesn't seem to work. It still uses rockets even if I set it to grenades.

I don't think "Musics" is the correct word anyway.
Try "Music".
Oh.. does not work =(
 
Oh.. does not work =(
I would suggest to not use the json music parameter as it has been discovered broken a few days ago. It would be good to edit the var yourself (npc.music, which is a string) in the .cs code of the npc (using Initialize or any other method that runs pretty early).
 
Want to ask one question. Is it possible to tapi to change the sprites of the original items and monsters of terraria? If you can, help me :red2:. I would be very grateful!:)
You can yes, I suggest decompiling tAPI and looking in Main.cs, there is a bunch of Texture variables, you would just change them to be what you want from your mods loaded textures.

I do this in my mod Future Dance to replace the timer textures, this is how it works:
Code:
// Replace vanilla Timer textures
if(!Main.dedServ) {
    Main.tileTexture[144] = textures["Vanilla/Tile_Timers"];
    Main.itemTexture[583] = textures["Vanilla/Item_Timer_1"];
    Main.itemTexture[584] = textures["Vanilla/Item_Timer_3"];
    Main.itemTexture[585] = textures["Vanilla/Item_Timer_5"];
}

This is done in ModBase.OnAllModsLoaded, btw.

I've been considering texture packs for tAPI, but I'm not sure exactly how to do it or really have the time to work on it much :dryadtongue:

Yea i thought about that but I thought it was ok. At least I made the sprite sheet of it myself. Here are a better picture
View attachment 21555
As you should see now, the left part of the hat stands out too much. it isn't like that in the sprite or spritesheet.
Are you 100% certain it isn't the texture? I can't think of what could cause that. Try using a 0% tolerance pick colour selection on the transparency, and see if there's some pixels to the side of the hat that you didnt notice.

So, asking once again as these questions went unanswered, how would I go for making custom music a thing, as of where do I need to put the file and in what format, also how can I edit a vanilla NPC's drop table adding my own drops to it as old tConfig did lazily let us replace vanilla defs with ini files but doubt that's a thing here.
Looking into the code for this, (never did music myself either) I think I found the answer.

You need to make a soundbank (.xsb) with your music and put it in the Wavebanks directory.

Then you need to make a Wavebanks.json, which has a single property "tracks", which is an array of music names.

Code:
{
     "tracks": [
        "Track1",
        "Track2",
        "Track3"
    ]
}

Then you do what you already know to use them :dryadsmile:

Random note, you can have 1 .xsb (music) 1 .xwb (sound effects) and the 1 json in this folder. The json is only for the soundbank though, not sure why it's called wavebanks :dryadrolleyes:

How can I make a weapon fire rockets (Rocket Is, Rocket IIs, etc.) and have it use them as ammo?
Set the weapon's "shoot" to the ID of one of the rockets (first one makes most sense) and set the "useAmmo" property to the ammo ID of rockets.

So I guess, use 134 for the "shoot" and 771 for the "useAmmo"

EDIT: Wow lots of missed messages, my browser didnt tell me there was more
 
Looking into the code for this, (never did music myself either) I think I found the answer.

You need to make a soundbank (.xsb) with your music and put it in the Wavebanks directory.

Then you need to make a Wavebanks.json, which has a single property "tracks", which is an array of music names.

Code:
{
     "tracks": [
        "Track1",
        "Track2",
        "Track3"
    ]
}

Then you do what you already know to use them :)

Random note, you can have 1 .xsb (music) 1 .xwb (sound effects) and the 1 json in this folder. The json is only for the soundbank though, not sure why it's called wavebanks :dryadrolleyes:
Are the tracks names supposed to be the exact names of the tracks in the bank, or is like based on order (let's say the first track of my bank is called A, but I define it as called B in the json file and then use ModName:B to refer to it).

I mean, this doesn't really matter if the bank is properly set up, but the more you understand what you're dealing with the better I guess.
 
Are the tracks names supposed to be the exact names of the tracks in the bank, or is like based on order (let's say the first track of my bank is called A, but I define it as called B in the json file and then use ModName:B to refer to it).

I mean, this doesn't really matter if the bank is properly set up, but the more you understand what you're dealing with the better I guess.
Has to match the track name. Honestly not sure why the json is needed, though I havent worked with soundbanks/wavebanks before. Maybe it doesn't have a list of tracks included. I do know though that the music won't be fully loaded unless you use the json.
 
Has to match the track name. Honestly not sure why the json is needed, though I havent worked with soundbanks/wavebanks before. Maybe it doesn't have a list of tracks included. I do know though that the music won't be fully loaded unless you use the json.
Back in tConfig, wavebanks were also used, but we didn't have a ini/json file for them. It was just straight out loaded and used based on track names. Hence why I'm asking of a possible reason behind the json.
 
I created a new world and now it doesn't have errors anymore. Geez, I'm about to attempt to make a first ever custom AI. So far I've copied some code to make him hover above the player. I don't really know where to start, though.
 
I created a new world and now it doesn't have errors anymore. Geez, I'm about to attempt to make a first ever custom AI. So far I've copied some code to make him hover above the player. I don't really know where to start, though.
Did you keep the bugged world? It would help if I could get the error log.

And AI honestly isn't too complicated when you break it down. Flying ones are pretty simple too, considering they don't need to jump or anything like that. Make it follow you if has no target, if it finds one, move towards it. If its melee, that's all you really need, if its ranged, make it move within X distance of it, then start shooting. (Assuming minion, based on what you said)
 
You can yes, I suggest decompiling tAPI and looking in Main.cs, there is a bunch of Texture variables, you would just change them to be what you want from your mods loaded textures.

I do this in my mod Future Dance to replace the timer textures, this is how it works:
Code:
// Replace vanilla Timer textures
if(!Main.dedServ) {
    Main.tileTexture[144] = textures["Vanilla/Tile_Timers"];
    Main.itemTexture[583] = textures["Vanilla/Item_Timer_1"];
    Main.itemTexture[584] = textures["Vanilla/Item_Timer_3"];
    Main.itemTexture[585] = textures["Vanilla/Item_Timer_5"];
}

This is done in ModBase.OnAllModsLoaded, btw.

I've been considering texture packs for tAPI, but I'm not sure exactly how to do it or really have the time to work on it much :dryadtongue:

Mmm.... and in which folder is my texture? =(.
 
Status
Not open for further replies.
Back
Top Bottom