Standalone [1.3] tModLoader - A Modding API

its a 32x32 PNG file
 
Oh well I'm not sure then.
 
OMG!!! ITS BECUS ITS SacredTools.Weapons and not SacredTools.Items.Weapons -.-

ARGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
[doublepost=1468762956,1468762689][/doublepost]next question:
i wanted to make a Custom Ore, but i want it to be mined ONLY with Pickaxe Power 250%
how can i do this??
 
hello. I am really new to the Tmodloader, and after a while of modded terraria and searching for a mod that suits me, I realized that I cannot find it. So i decided to create my own mod. which i dont know how to do.

The basic idea of my Mod is to expand on the Fishing system of Terraria. In vanilla terraira, you can kill at least Duke Fishron with only things you can collect from Fishing. I want to make Fishing a significant thing, by adding more fishable items, and even maybe a Boss or two. My ultimate goal is to create a powerful fishing class character that can kill the MOON LORD with items gained from only fishing. and on EXPERT.

Of course, a mod that allows you to expand one class and let it kill high level bosses on expert sounds like something of Zoalkan or maybe Thorium.(both mods have a side that boosts Thrower class significantly) It sounds difficult, and im not even sure if Tmodloader can support modded fishing(that may be why I cant seem to find any...) but I want to create it anyways.

Maybe in the future, I may expand this mod to support other side classes like Thrower, Demolitionist(explosive only) or healer class. But thats my basic idea. For now, I want to work on the fishing side.

If anyone can help me with this, especially the coding(The best i can do is Sprite, but I have created a small mod for minecraft before. although they are really different) I would be very happy.

P.S.) this idea came from the basis of a youtuber. He sort of made me want to do a modded fishing class, so when i didnt find one I just decided to create one. Or at least get the idea out there. I have several ideas already.

If someone could get back to me, thank you. (geeze this sounds like a letter to someone...)

Edit: If instead of creating my own mod, You think having me help create your mod is better, then sure. But my main priority is to create a mod that somehow adds expansions to fishing. I can help with your own mod, especially with sprites.
 
Last edited:
How do I make a projectile play a custom sound when it dies?
 
In the method Kill(), you add just a sound ^^
 
hey snrasha ur back!
sorry to bother, but how do i make a projectile make an animated explosion when it hits something??
(with sound and dust and stuff, and damage)

SORRY, I DIDNT FIND ANYTHING
 
How to I make a npc aim at the player when it fires? Like a skeleton archer. But I still want a custom animation for the NPC, not use the exact same frameanimation as the archer.
EDIT: I also need to know how to make a NPC face right when going that way.
 
Last edited:
hey snrasha ur back!
sorry to bother, but how do i make a projectile make an animated explosion when it hits something??
(with sound and dust and stuff, and damage)

SORRY, I DIDNT FIND ANYTHING
Check method damage in the vanilla code, with the type of a rocket. (Then, you include that in OnhitNpc or other.)
Yes, here, i can understand than you do not found, but after my help, if you do not found, i cannot help you(Because this is that, the answer.)

After, i am a holiday, so, no i am not back, i cannot help too. (And, if i help you too, you have a problem, ^^')
 
How do I make a Boss NPC spawn a different one when it dies, and play a custom death message?
 
I have a couple of questions about npc ai, projectile ai, and other stuff for my custom boss. I be soo lost

- how do I make the npc texture change to something else kinda like the EoC changes to have a mouth.

- how do I make the npc shoot a projectile from the edge of the texture and not the center to where it's facing, not necessarily at the player EDIT: sorta like the way either one of the twins shoots, my shots usually come out in weird angles from the texture center to where the player is when it is shot. I want this so it shoots the way it is facing when it spins.

- how do I make the npc stay stationary and spin
- also how might I make the npc invincible and regen while it is spinning

- how do I draw a giant rectangle, sort of like the circle around the abomination in that it is shaded, but more like the purity spirit's arena rectangle, with the player's position, when it is first drawn, as the center when the boss is first summoned, and stay put until the boss is defeated or leaves, which it will do if the player dies
- also how might I move the npc to the center of the rectangle. Reword : find the center of the rectangle
- also how might I make the npc charge super fast at the payer and deal 1,000,000,000,000 damage or what ever the max damage in terraria is and be invincible if the player leaves the inside of the rectangle (I know it's OP, buuut... the summon item will warn you not to leave...)

- also how could I make a bouncing projectile bounce of the side of the rectangle, but only if it hits them from the inside (or is this even possible)
- also how could I make a projectile shoot motionless projectile every single tick to stay along the path it took and damage the player Basically, I want a damaging trail left behind a projectile

- how might I make the npc damage and defense increase the more damaged it is

- how might I make the npc shoot a beam like the moon lord's death ray thing

-how do I make the npc face the player and then charge like the expert EoC

EDIT: 'a couple questions' is a huge understatement. I just noticed that

pls help me

green is for important parts of each question that were already in the question that I need to know
red is for rewriting the question if it is not complete

PLEASE Help or find me good, complete tutorials. I can't find anything on this.
 
On MacOSX it doesn't even load up, says its running for a few seconds, and then syncs and doesn't say anything. i feel like it might have to do with the terraria.exe not being an .app, but when you change it to an .app, it disappears, and goes invisible, and your not able to change the terrariaOld back, since terraria.app is used

I tied to change the terraria file at the start to .app which worked, but now it wont allow me to paste any of the files into the Steam Terraria folder, and it says that an item is already named terraria, even after changing the name to TerrariaOld
 
Last edited:
how i make a weapon that can suck enemies lives like vampire knives
 
how i make a weapon that can suck enemies lives like vampire knives
put this in your weapon

Code:
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            player.statLife += 2;
            player.HealEffect(2);
        }
you can change the 2 to the number you want healed per hit
 
Whenever I try to build something, I get this:
error CS1703: An assembly with the same identity 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' has already been imported. Try removing one of the duplicate references.
 
Hi guys, any ideas on how I could replace all dirt tiles in the right most 500 blocks will my own modded tiles? Thanks I know this is kinda vague but I'm pretty new to worldgen.
 
I have a couple of questions about npc ai, projectile ai, and other stuff for my custom boss. I be soo lost

- how do I make the npc texture change to something else kinda like the EoC changes to have a mouth.

- how do I make the npc shoot a projectile from the edge of the texture and not the center to where it's facing, not necessarily at the player EDIT: sorta like the way either one of the twins shoots, my shots usually come out in weird angles from the texture center to where the player is when it is shot. I want this so it shoots the way it is facing when it spins.

- how do I make the npc stay stationary and spin
- also how might I make the npc invincible and regen while it is spinning

- how do I draw a giant rectangle, sort of like the circle around the abomination in that it is shaded, but more like the purity spirit's arena rectangle, with the player's position, when it is first drawn, as the center when the boss is first summoned, and stay put until the boss is defeated or leaves, which it will do if the player dies
- also how might I move the npc to the center of the rectangle. Reword : find the center of the rectangle
- also how might I make the npc charge super fast at the payer and deal 1,000,000,000,000 damage or what ever the max damage in terraria is and be invincible if the player leaves the inside of the rectangle (I know it's OP, buuut... the summon item will warn you not to leave...)

- also how could I make a bouncing projectile bounce of the side of the rectangle, but only if it hits them from the inside (or is this even possible)
- also how could I make a projectile shoot motionless projectile every single tick to stay along the path it took and damage the player Basically, I want a damaging trail left behind a projectile

- how might I make the npc damage and defense increase the more damaged it is

- how might I make the npc shoot a beam like the moon lord's death ray thing

-how do I make the npc face the player and then charge like the expert EoC

EDIT: 'a couple questions' is a huge understatement. I just noticed that

pls help me

green is for important parts of each question that were already in the question that I need to know
red is for rewriting the question if it is not complete

PLEASE Help or find me good, complete tutorials. I can't find anything on this.
I'm not going to answer every single one of these questions (sorry!) since I'll be answering them from the top of my head:

1. When the Eye of Cthulu (for example) changes its form, it's not chaning its texture. Every NPC has a so called 'frame' (npc.frame') which is a rectangle (X coordinate, Y coordinate, width, height). This frame takes care of the change in visuals.
Imagine you have a piece of paper with 4 different images below one another. Now you have another piece of paper with a square/rectangle cut out in the middle, the exact same size as one of those images. You can move the piece with the hole to show different parts of the other piece with the images on it. Same with npc.frame. If you have multiple images below one another, you can change npc.frame.Y to scroll down on the 'spritesheet'.

2. I'm not sure if you know how a projectile is shot already, so I'm going to start from the basics. There's a method called Projectile.NewProjectile which basically spawns in a new projectile, simple as that. Now the parameters for this method are as follows: (XPosition, YPosition, speedX, speedY, projectileType, damage, knockback, owner, ai0, ai1). Now you want to focus on spawning the projectile at a given position that is at the edge of the texture.
First of all, you want to turn the rotation of the NPC in question into a direction vector. That way you also immediately know which way to shoot the projectile in. You can also use that direction vector and multiply it to make the projectile spawn at the edge of the texture. In code it would look something like this:
Code:
Vector2 direction = npc.rotation.ToRotationVector2();
Vector2 spawnProjectileAtPosition = npc.Center + (direction * 18); // You'll want to change the '18' to whatever value you see fit. The '18' influences the distance at which the projectile spawns according to the center of the NPC.
direction *= 8; // Here we modify the speed at which we're going to shoot the projectile. Change the '8' if you want the projectile to go faster or slower.
Projectile.NewProjectile(spawnProjectileAtPosition.X, spawnProjectileAtPosition.Y, direction.X, direction.Y, projectileType, damage, knockback, Main.myPlayer);
As you can see, I left the (projectileType, damage, knockback) as just names. You'll want to modify those, though.

3. Very simple, really. Example:
Code:
npc.velocity *= 0; // Makes the NPC stop moving.
npc.rotation += 0.2F; // Rotate the NPC. You can change the value to make it rotate faster or slower and change '+=' to '-=' to make it rotate the other way.

4. Also not too difficult.
Code:
npc.dontTakeDamage = true; // Make sure the NPC cannot be damaged.
npc.lifeRegenCount += 5; // Change '5' to make the NPC generate slower or faster.
Also, do NOT forget to set npc.dontTakeDamage back to false when the NPC ends its spin.

5, 6, 7, 8, 9 - Not right now. Bit too much from the top of my head :P

10. You'll want to check the NPCs current life against its max life and go from there. Also use defDamage and defDefense to modify its damage and defense values:
Code:
if(npc.life <= npc.lifeMax * 0.5F) // Check if the current life of the NPC is lower or equal to half of its max life.
{
    npc.damage = npc.defDamage * 2; // Damage is multiplied.    
    npc.defense= npc.defDefense * 2; // As well as defense.
}

11... Not from the top of my head xD

12. To make an NPC look at the player, you can kind of reverse-apply the rotating+shooting projectile from earlier on:
Code:
npc.TargetClosest(true); // Get the closest player to target.
npc.rotation = (Main.player[npc.target].Center - npc.Center).ToRotation();
For the charging.. Someone else might be able to help you there...
 
Hm, so 1.3.2 releases tomorrow. I wonder whether I'll be able to finish the next update in time so I can release it for 1.3.2 as soon as possible...
 
Hey blue so quick question. Seems I can get the tModReader fine on my Linux and Windows but the Loader link doesn't work for any of them for either system? Is there a problem with the download. Haven't been able to get them for a few days now and really want to try Terraria with some awesome looking mods. *Sorry for sounding so noobish X3* :3
 
Back
Top Bottom