MiraiMai
Terrarian
Doesn't matter, I used "Vanilla" as you can see in the code. All images are loaded no matter where they are.Mmm.... and in which folder is my texture? =(.
Doesn't matter, I used "Vanilla" as you can see in the code. All images are loaded no matter where they are.Mmm.... and in which folder is my texture? =(.
using System;
using System.Collections.Generic;
using System.Text;
using Terraria;
using TAPI;
namespace ROTD
{
public class ModBase :
{
public override void OnAllModsLoaded()
{
// Replace vanilla Timer textures
if(!Main.dedServ) {
Main.itemTexture[383] = textures["Vanilla/Item_383"];
Main.itemTexture[384] = textures["Vanilla/Item_384"];
Main.itemTexture[385] = textures["Vanilla/Item_385"];
Main.itemTexture[386] = textures["Vanilla/Item_386"];
Main.itemTexture[387] = textures["Vanilla/Item_387"];
Main.itemTexture[388] = textures["Vanilla/Item_388"];
Main.itemTexture[483] = textures["Vanilla/Item_483"];
Main.projectileTexture[57] = textures["Vanilla/Projectile_57"];
Main.projectileTexture[58] = textures["Vanilla/Projectile_58"];
Main.projectileTexture[59] = textures["Vanilla/Projectile_59"];
Main.projectileTexture[60] = textures["Vanilla/Projectile_60"];
Main.projectileTexture[61] = textures["Vanilla/Projectile_61"];
Main.projectileTexture[62] = textures["Vanilla/Projectile_62"];
}
}
}
}
"public class ModBase :"Code:using System; using System.Collections.Generic; using System.Text; using Terraria; using TAPI; namespace ROTD { public class ModBase : { public override void OnAllModsLoaded() { // Replace vanilla Timer textures if(!Main.dedServ) { Main.itemTexture[383] = textures["Vanilla/Item_383"]; Main.itemTexture[384] = textures["Vanilla/Item_384"]; Main.itemTexture[385] = textures["Vanilla/Item_385"]; Main.itemTexture[386] = textures["Vanilla/Item_386"]; Main.itemTexture[387] = textures["Vanilla/Item_387"]; Main.itemTexture[388] = textures["Vanilla/Item_388"]; Main.itemTexture[483] = textures["Vanilla/Item_483"]; Main.projectileTexture[57] = textures["Vanilla/Projectile_57"]; Main.projectileTexture[58] = textures["Vanilla/Projectile_58"]; Main.projectileTexture[59] = textures["Vanilla/Projectile_59"]; Main.projectileTexture[60] = textures["Vanilla/Projectile_60"]; Main.projectileTexture[61] = textures["Vanilla/Projectile_61"]; Main.projectileTexture[62] = textures["Vanilla/Projectile_62"]; } } } }
I tried to use the code, but the code does not want to build. What did I do wrong?
[DOUBLEPOST=1421475177][/DOUBLEPOST]The textures put in a folder
"Vanilla"
When I write TAPI.ModBase, there are many error =(."public class ModBase :"
You forgot TAPI.ModBase after the colon.
Random other note, the comment still says timer, lol
There is an example and prewritten AI in base mod. AIMinionFighter – Custom AI that works similarly to fighter minion AI. (uses ai[0, 1]). That's all there is to it, use that for the AI and you have a minion.You could check if he actually uses it in G realm for a usage example.Hi,
How would i make a minion? I dont think theres an ai built in and there is no example in the template mod.
It's very difficult to make an AI from scratch, unless you want something very simple. You're much better off studying an existing AI and using it as a template, assuming you can read code. If you can't, I would put some serious effort into trying to learn.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.
AIRotate Custom AI that will cause the npc to rotate around a point in a fixed circle.
AIPounce Custom AI that will cause the npc to 'pounce' at the given target when it is within range.
AIPath Custom AI that will cause the npc to follow the path of given points. (uses ai[0, 1, 2])
AITackle Custom AI that will cause the npc to 'tackle' a specific point given. (uses ai[0, 1, 2])
AIGravitate Custom AI that will cause the npc to 'gravitate' near a specific point given. (uses ai[0, 1, 2])
WalkupHalfBricks Code based on vanilla halfbrick walkup code, checks for and attempts to walk over half tiles.
AttemptJump Code based on vanilla jumping code, checks for and attempts to jump over tiles and gaps when needed.
AttemptOpenDoor Attempts to interact with a door.
AIWeapon A cleaned up (and edited) copy of Possessed Weapon AI. (aiStyle 23) (Enchanted Sword, Demon Hammer, etc.)
AISnail A cleaned up (and edited) copy of Snail AI. (Snail, etc.) (AIStyle 67)
AISpore A cleaned up (and edited) copy of Spore AI. (Fungi Spore, Plantera Spore, etc.) (AIStyle 50)
AICharger A cleaned up (and edited) copy of Charger AI. (Unicorns, wolves, etc.) (AIStyle 26)
AIFriendly A cleaned up (and edited) copy of Friendly AI. (Town NPCs, Bunnies, Penguins, etc.) (AIStyle 7)
AIEater A cleaned up (and edited) copy of Eater of Souls AI. (EoS, Corruptor, etc.) (AIStyle 5)
AIWheel A cleaned up (and edited) copy of Wheel AI. (Blazing Wheel) (AIStyle 21)
AISpider A cleaned up (and edited) copy of Spider Wallwalking AI. (Blood Crawler, etc.) (AIStyle 40)
AISkull A cleaned up (and edited) copy of Skull AI. (Cursed Skull) (AIStyle 10)
AIFloater A cleaned up (and edited) copy of Floater AI. (Pixie, Gastropod, etc.) (AIStyle 22)
AIFlier A cleaned up (and edited) copy of Flier AI. (Bat, Demon, etc.) (AIStyle 14)
AIPlant A cleaned up (and edited) copy of Plant AI. (Man Eater, etc.) (AIStyle 13)
AIWorm A cleaned up (and edited) copy of Worm AI. (Giant Worm, EoW, Wyvern, etc.) (AIStyle 6)
AITeleporter A cleaned up (and edited) copy of Teleporter AI. (Fire Imps, Tim, Chaos Elementals, etc.) (AIStyle 8)
AIFish A cleaned up (and edited) copy of Fish AI. (Goldfish, Angler Fish, etc.)
AIZombie A cleaned up (and edited) copy of Zombie AI. (Stripped Fighter AI)
AIEye A cleaned up copy of Demon Eye AI. (Flier AI)
AISlime A cleaned up copy of Slime AI.
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
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.
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
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
You are clearly doing something very very wrong, because that shouldn't happen, period. Me and multiple others have perfectly working armour sets. The only thing I can think of is if for some reason you have head slot set on all 3 pieces, for that. Still don't think it would cause that though.I think it isn't the sprite but if you want I can upload them later. Today things went even crazier with the armor set(or it is supposed to be a vanity set actually). The legs and body sprite aren't where they are supposed to be. They are above the head as you can see in these pictures.
When I'm just wearing the pants.View attachment 21657
When I'm just wearing the body and the legs.View attachment 21658
And when I'm wearing all three parts.View attachment 21659
Main.projectileTexture is right. Main.npcTexture has to be lower case.Yes! Now my sprites work! I use Main.itemTexture and Main.tileTexture. But Main.projectileTexture and Main.NPCTexture won't work. Can you tell me how to fix it?
You are clearly doing something very very wrong, because that shouldn't happen, period. Me and multiple others have perfectly working armour sets. The only thing I can think of is if for some reason you have head slot set on all 3 pieces, for that. Still don't think it would cause that though.
Main.projectileTexture is right. Main.npcTexture has to be lower case.
And like I said, go figure out how to decompile tAPI, and look for these values your self. It's not our job to go look up value names for people, it's something extremely easy to do yourself.
A BinBuffer is literally just a byte array, that is easier to add data to. It is what is used for writing custom data to files, and for sending data in multiplayer.Alright... I'm back ^^
(The RPG questions guy like 20 pages back - was a bit busy recently and I'm working on the mod during weekends...)
Got a couple more questions if you don't mind:
I don't quite understand the structure of BinBuffer...
Thank you a lot for being so helpful! ^^
- Do variables get deleted from it as I load them or do I have to "manually" delete them?
- Are we speaking about ~A~ BinBuffer or ~THE~ BinBuffer?
- If in my case I'd like to save a/the BinBuffer each time the world is saved, what would be the good/best solution? (got some ideas how to do it, but help here would be awesome)
You shouldn't need any code for a vanity set, just a JSON for each piece. Unless you want special effects anyways, but you don't seem to be using any.I have done some armours before and they worked perfect. I did like I always have done so it should work. I will try to find a solution but I do think that nothing is wrong with my code or sprites.
Something went wrong.You are clearly doing something very very wrong, because that shouldn't happen, period. Me and multiple others have perfectly working armour sets. The only thing I can think of is if for some reason you have head slot set on all 3 pieces, for that. Still don't think it would cause that though.
Main.projectileTexture is right. Main.npcTexture has to be lower case.
And like I said, go figure out how to decompile tAPI, and look for these values your self. It's not our job to go look up value names for people, it's something extremely easy to do yourself.
public override void OnAllModsLoaded()
{
// Replace vanilla Timer textures
if(!Main.dedServ) {
Main.itemTexture[483] = textures["Vanilla/Item_483"];
Main.itemTexture[103] = textures["Vanilla/Item_103"];
Main.itemTexture[120] = textures["Vanilla/Item_120"];
Main.itemTexture[127] = textures["Vanilla/Item_127"];
Main.itemTexture[197] = textures["Vanilla/Item_197"];
Main.itemTexture[204] = textures["Vanilla/Item_204"];
Main.itemTexture[122] = textures["Vanilla/Item_122"];
Main.itemTexture[724] = textures["Vanilla/Item_724"];
Main.itemTexture[155] = textures["Vanilla/Muramasa"];
Main.npcTexture[134] = textures["Vanilla/DestroyerHead"];
Main.npcTexture[135] = textures["Vanilla/DestroyerBody"];
Main.npcTexture[136] = textures["Vanilla/DestroyerTail"];
}
}
One of the textures you tried using doesn't exist. the "Vanilla/blah" has to match the exact name of the .png file, without .png of course.Something went wrong.
I have this code. After starting tAPI I'm getting this error:Code:public override void OnAllModsLoaded() { // Replace vanilla Timer textures if(!Main.dedServ) { Main.itemTexture[483] = textures["Vanilla/Item_483"]; Main.itemTexture[103] = textures["Vanilla/Item_103"]; Main.itemTexture[120] = textures["Vanilla/Item_120"]; Main.itemTexture[127] = textures["Vanilla/Item_127"]; Main.itemTexture[197] = textures["Vanilla/Item_197"]; Main.itemTexture[204] = textures["Vanilla/Item_204"]; Main.itemTexture[122] = textures["Vanilla/Item_122"]; Main.itemTexture[724] = textures["Vanilla/Item_724"]; Main.itemTexture[155] = textures["Vanilla/Muramasa"]; Main.npcTexture[134] = textures["Vanilla/DestroyerHead"]; Main.npcTexture[135] = textures["Vanilla/DestroyerBody"]; Main.npcTexture[136] = textures["Vanilla/DestroyerTail"]; } }
Main.npcTexture[136] = textures["Vanilla/DestroyerTail"]; wont workOne of the textures you tried using doesn't exist. the "Vanilla/blah" has to match the exact name of the .png file, without .png of course.
Then fix the file name...? It's literally just the path and name of the image file, without .pngMain.npcTexture[136] = textures["Vanilla/DestroyerTail"]; wont work
"DestroyerTail.png" is the filename.Then fix the file name...? It's literally just the path and name of the image file, without .png
A BinBuffer is literally just a byte array, that is easier to add data to. It is what is used for writing custom data to files, and for sending data in multiplayer.
1) You are given a fresh, empty BinBuffer each time. This BinBuffer is written to the main BinBuffer before writing the file. So no, you don't have to delete anything.
2) Just an instance of BinBuffer. You can't manipulate the vanilla data or other mods data with the one given to you.
3) Check the docs for list of hooks. ( http://tapi.axxim.net/docs/?mode=hooks&doc=modworld ) ModPlayer has the same hooks (Initialize / Save / Load ), why they aren't listen I don't know Basically just write/read from the BinBuffer as needed in the appropriate hooks.
You shouldn't need any code for a vanity set, just a JSON for each piece. Unless you want special effects anyways, but you don't seem to be using any.
Either way though, it's hard to help with only seeing screenshots.