tAPI [Discontinued] tAPI - A Mod To Make Mods

Status
Not open for further replies.
and as tAPI builder is working, how do i make a crafting bench/custom crafting tile?
or a recipe with more than 1 material?
or import builders workshop?
 
Last edited:
Another day, another server crash. This happens whenever someone uses any flail from a mod, but it's very similar to the crash I got from NeoMods:

DfXAWEq.png


Is there any fix aside from Yoraiz0r overhauling tAPI?
 
Not sure if it's been complained before. But I try to click on the tAPI shortcut on my desktop and it says "This app cannot run on your PC.".

Meaning I can't make anything. Which sucks cause I had an awesome idea for a 'More Wires' mod.

I run Windows 8.1. I also tried running it in compatibility mode for Windows 7, Vista(ew), XP, and even 98 .-. Nothing.

Halp?
 
Another day, another server crash. This happens whenever someone uses any flail from a mod, but it's very similar to the crash I got from NeoMods:

Is there any fix aside from Yoraiz0r overhauling tAPI?

You may want to ask @DivermanSam about that, it seems like there's something missing. Either that or there's something wrong with flails on servers.
 
The way we did it was to add -1 to the y velocity of the item every frame. Seemed to work pretty well!
But that just makes the item float in the air. If you want the item to pulsate and glow you need another piece of code. But don't worry, I got the code:p
Code:
        public override void MidUpdate(ref float gravity, ref float maxVelocity)
        {
            gravity = 0f;
            item.velocity.Y *= 0.95f;
            if ((double)item.velocity.Y < 0.1 && (double)item.velocity.Y > -0.1)
            {
                item.velocity.Y = 0f;
            }
            float num10 = (float)Main.rand.Next(90, 111) * 0.01f;
            num10 *= Main.essScale;
            Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.4f * num10, 0.3f * num10, 0.4f * num10);
        }
        public override bool PreWorldDraw(SpriteBatch sb)
        {
            float rotation = item.velocity.X * 0.2f;
            Color alpha = new Color(255, 255, 255, 50); //This is what soul items return for their GetAlpha method
            alpha *= Main.essScale;
            float offsetY = (float)(item.height - Main.itemTexture[item.type].Height);
            float offsetX = (float)(item.width / 2 - Main.itemTexture[item.type].Width / 2);
            Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float)(Main.itemTexture[item.type].Width / 2) + offsetX, item.position.Y - Main.screenPosition.Y + (float)(Main.itemTexture[item.type].Height / 2) + offsetY + 2f), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), alpha, rotation, new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)), Main.essScale, SpriteEffects.None, 0f);
            return false; //This is important since we're doing the actual drawing now.
        }
With a huge help of @bluemagic123 I managed to get it to work. 80% credit to him. This code should do the trick but if you throw your soul out of your inventory when your inventory is open the item will just fall upwards(I know it's strange).
 
I am installing r15 and when i continue and click install it says
the selected directory is not a valid terraria directory.Please go back and choose the right folder

setup cant continue please click cancel to continue


i selected this directory
C:\Program Files\Steam\steamapps\common\Terraria
 
But that just makes the item float in the air. If you want the item to pulsate and glow you need another piece of code. But don't worry, I got the code:p
Code:
        public override void MidUpdate(ref float gravity, ref float maxVelocity)
        {
            gravity = 0f;
            item.velocity.Y *= 0.95f;
            if ((double)item.velocity.Y < 0.1 && (double)item.velocity.Y > -0.1)
            {
                item.velocity.Y = 0f;
            }
            float num10 = (float)Main.rand.Next(90, 111) * 0.01f;
            num10 *= Main.essScale;
            Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.4f * num10, 0.3f * num10, 0.4f * num10);
        }
        public override bool PreWorldDraw(SpriteBatch sb)
        {
            float rotation = item.velocity.X * 0.2f;
            Color alpha = new Color(255, 255, 255, 50); //This is what soul items return for their GetAlpha method
            alpha *= Main.essScale;
            float offsetY = (float)(item.height - Main.itemTexture[item.type].Height);
            float offsetX = (float)(item.width / 2 - Main.itemTexture[item.type].Width / 2);
            Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float)(Main.itemTexture[item.type].Width / 2) + offsetX, item.position.Y - Main.screenPosition.Y + (float)(Main.itemTexture[item.type].Height / 2) + offsetY + 2f), new Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), alpha, rotation, new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)), Main.essScale, SpriteEffects.None, 0f);
            return false; //This is important since we're doing the actual drawing now.
        }
With a huge help of @bluemagic123 I managed to get it to work. 80% credit to him. This code should do the trick but if you throw your soul out of your inventory when your inventory is open the item will just fall upwards(I know it's strange).
the PreWorldDraw hook already gives you a SpriteBatch, so there's no need to use Main.spriteBatch
 
Hmm.. is there a way to force the monster to appear only where there are certain tiles? If possible, please help =)
In ModNPC's CanSpawn() hook, you can check if the player is within a given biome (I think it was player.zone["<biome name>"]?). You can also define your own custom biomes, which I think can be as simple as having a only single tile/tile type, and in any amount.
 
Not sure if it's been complained before. But I try to click on the tAPI shortcut on my desktop and it says "This app cannot run on your PC.".

Meaning I can't make anything. Which sucks cause I had an awesome idea for a 'More Wires' mod.

I run Windows 8.1. I also tried running it in compatibility mode for Windows 7, Vista(ew), XP, and even 98 .-. Nothing.

Halp?

Anyone? :C
 
the PreWorldDraw hook already gives you a SpriteBatch, so there's no need to use Main.spriteBatch
It turns out that the SpriteBatch that gets passed actually is Main.spriteBatch. But yeah, it would be better practice to use the parameter instead of Main.spriteBatch. (This is what happens when you copy/paste source code, lol)
 
I know it might be said before but the truffle not spawning when you have a surface mushroom biome is a big problem to those that likes having shroomite equipment on most of these mods, anyway to fix it?
 
Status
Not open for further replies.
Back
Top Bottom