Standalone [1.3] tModLoader - A Modding API

you can do it bluemagic JUST DO IT
 
thanks and how i can do it but with magic instead of life
and how i can put someones message in mine to respond it
 
I've got a question: I have my code in my LegendOfMutater.cs and I get this error

c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\LegendOfMutater.cs(14,16) : error CS1520: Method must have a return type

Here is my Code:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using Mod.Items;

namespace LegendOfMutater
{
public class Mod : LegendOfMutater
{
public LegendOfMutater()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
};
}
}
}
 
ah yes is a problem of single mod or tmodloader when there is a update of a mod but if you install it and refresh the page it re-appear
 
I've got a question: I have my code in my LegendOfMutater.cs and I get this error

c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\LegendOfMutater.cs(14,16) : error CS1520: Method must have a return type

Here is my Code:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using Mod.Items;

namespace LegendOfMutater
{
public class Mod : LegendOfMutater
{
public LegendOfMutater()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
};
}
}
}
You reversed the mod and legendofmetator. The : thing
 
thanks and how i can do it but with magic instead of life
and how i can put someones message in mine to respond it

I haven't tested this but
Code:
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            player.statMana += 6; //Heals Mana by 6; Can be changed of course
            player.HealEffect(6); //Shows a green 6 above your head to show you've been healed
        }

i don't know how to make it the mana colored number sorry

highlight what they say and it will say
+ quote | reply

click '+ quote'

go to your message and click 'Insert Quotes...' button at the bottom
then click 'Quote These Messages'
It'll appear in your message with the word 'QUOTE' before and after in []
 
Ok, now I am getting the error (And I fixed my code)
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\LegendOfMutater.cs(8,23) : error CS0234: The type or namespace name 'Items' does not exist in the namespace 'LegendOfMutater' (are you missing an assembly reference?)
What is an assembly reference btw?
At the top you probably now have "using LegendOfMutater.Items;", but you haven't put any classes in that namespace, so the reference to that namespace doesn't exist.
 
Is the GoG version going to be updated?
 
how i can change the arkhalis projectile sprite to a 4 frame 100x100 sprite
 
when will tmodloader have json support?
 
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...

YAY! an answer Thank You! Now I have a semi-Functional boss

I have a couple of questions about npc ai, projectile ai, and other stuff for my custom boss. If anyone can answer 1 please do, you don't have to answer all of them

- 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 find and move the npc to the center of the rectangle.
- also how might I check to see if the player is inside of this rectangle

- 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 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 found acceptable functionality for this on al0n37's tutorials

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 unanswered but I figured it out
PLEASE Help or find me good, complete tutorials. I can't find anything on this.
 
Guys , i feel so bad 4 interrupt u all... but, maybe anyone can hep me :( I started to whatch some , videos , and i got interested in some mods, but i can't find them with the browser and can't find them with google, but in the video says that he download them from the browser...
The mods i can't found:
MinersExtra v1.1.4
PotionsPlus v1.2.3
PreHardModeWings v1.1.3
Lunar Rings v1.0.4
More Accessories+ v1.3

He plays in 1.3.1.1 so i don't understand what i am doing wrong
If want to see them, check the video description

(Yep , i found some of them by the browser)
Maybe someone still have those mods and can upload em (?)
Sry for my english... i already forgot all that i knew xD
And sry again for interrupt :(
 
I am getting a weird problem with installing mods that are not in the Mod browser section. I put them into the mods folder and nothing shows up when I reload the mods.
Any suggestions would be nice :happy:
 
I am getting a weird problem with installing mods that are not in the Mod browser section. I put them into the mods folder and nothing shows up when I reload the mods.
Any suggestions would be nice :happy:
If they aren't in the Mod Browser, I'm willing to be they are pre 0.8 mods, which are incompatible.
 
Is the GoG version going to be updated?

Yes, though I've been swamped with real life stuff as well as a bit of laziness and haven't gotten around to it yet. Hopefully I'll be able to devote some time to it over the next couple weeks.
 
Yes, though I've been swamped with real life stuff as well as a bit of laziness and haven't gotten around to it yet. Hopefully I'll be able to devote some time to it over the next couple weeks.
Nice! Even though most of us have Steam (I guess), it's still nice for those that do have GoG.
 
Hello everyone!


I create a variable on the basis of downedAbomination from ExampleMod. In single player works fine, but in multiplayer, when you create the server hangs at the "Starting Server"... But when I removed the variable, multiplayer working!


What could be wrong?
 
I need help with this :I :

Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
at Terraria.ModLoader.AssemblyManager.InstantiateMods(List`1 modsToLoad)
 
Back
Top Bottom