Standalone [1.3] tModLoader - A Modding API

ooooh!! so one for every hand, kewl,

next two questions:

1:
how to inflict damage on Player and NPC
i want a debuff dealing 8 dmg per sec

2:
how do i make a projectile inflict a debuff on a PLAYER
 
ooooh!! so one for every hand, kewl,

next two questions:

1:
how to inflict damage on Player and NPC
i want a debuff dealing 8 dmg per sec

2:
how do i make a projectile inflict a debuff on a PLAYER

1)Button Search.
2)Button Search.

Man, stop that, the forum have 50 times the answer than you search, search a small, seriously.
 
Code:
using Terraria;
using Terraria.ModLoader;
using ExampleMod.NPCs;

namespace ExampleMod.Buffs
{
    public class EtherealFlames : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffName[Type] = "Ethereal Flames";
            Main.buffTip[Type] = "Losing life";
            Main.debuff[Type] = true;
            Main.pvpBuff[Type] = true;
            Main.buffNoSave[Type] = true;
            longerExpertDebuff = true;
        }

        public override void Update(Player player, ref int buffIndex)
        {
            player.GetModPlayer<ExamplePlayer>(mod).eFlames = true;
        }

        public override void Update(NPC npc, ref int buffIndex)
        {
            npc.GetModInfo<ExampleNPCInfo>(mod).eFlames = true;
        }
    }
}

i see NOTHING damage inflicting
[doublepost=1468588536,1468588216][/doublepost]and whats the file for the Beam?? i wanna make a boss shooting beams like the Moonlord
 
For you, this is what this two method in modbuff?
public override void Update(NPC npc, ref int buffIndex)
public override void Update(Player player, ref int buffIndex)

For the beam, if you have search a small, the purity spirit in the example mod have the beam than you search, take it.
You know than many people have created tutorial for help you? ><

After, yes, many question than you have put is normal, but seriously : "whats the file for the Beam?? i wanna make a boss shooting beams like the Moonlord" "is there something in the example mod??" are a serious question?
Before post a question, search a small, if you have not found, you can.

I say that, because you have not for the moment a link in your mod subject, so, if you cannot just put a link in your subject, ah ah :p

Because i have just impression than you wannot work too, just create a mod, but a mod need work ^^. (I do not talk for sprite, but well, you can recruit coder for that :p , or before, try small, then big. Begin per a boss is always a bad idea, or begin per a beam also)
 
uh, wat u mean "search a small"
 
I'm running a local server for my brother and me with only Thorium installed. The problem we have is that everytime someone leaves the server no one can join it anymore. So for example if my brother loses connection to the router he gets kicked from the server. When he then tries to join again he only gets the "connecting to [IP]" message. The same happens if you simply leave the server. The only solution for this that I found is to restart the server which gets quite annoying after some time. Does anyone know what I could do to fix it?

btw I don't know if this is a problem with the Thorium mod or the tmodloader so I will probably post this in the Thorium mod thread too.
 
does this make a projectile home into enemies??
ProjectileID.Sets.Homing[projectile.type] = true;
 
No. And i have not idea what is this, also, sorry. (Except say than this thing is a homing projectile and so you can making many things with that, like proj.melee/throw/ranged/magic)

For a homing projectile, you need use AI()
 
Capture.PNG

I extracted the files to my desktop as instructed, and then I got this error when I run the installer.
 
Any plans for multiplayer support on Mac? At least the ability to join others through Steam?
 
If you have no mods installed (or active) can you play with players who don't have tModLoader but have Terraria for Steam? Can they join your world if no mods are installed (or active)?
 
I REALLY need help, I am developing my first mod and I have had about 30 errors which have been solved, but this one just does not make any sense what so ever. CSerror0117:
'Terraria.Item' does not contain a definition for 'name'
It says there is a problem with line 15 but I cant solve it.
My Coding is this:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
Item.Name = "Dirt Sword"; //sword name
Item.damage = 5; //sword damage
Item.melee = true;
Item.width = 50;
item.height = 50;
item.toopTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
Item.useAnimation = 25;
Item.useStyle = 1;
Item.Knockback = 5;
Item.value = .33;
Item.rare = 10;
Item.usesound = 1;
Item.autoReuse = true;
Item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();



}
}
}
Please Help me as soon as possible, I have some great ideas I would love to enter into the terraira modding community, Thanks in advance!
[doublepost=1468610756,1468610642][/doublepost]
View attachment 127104
I extracted the files to my desktop as instructed, and then I got this error when I run the installer.
I think they are planning to do this, it would be nice as some of my friends are running a ol' macbook
 
I REALLY need help, I am developing my first mod and I have had about 30 errors which have been solved, but this one just does not make any sense what so ever. CSerror0117:
'Terraria.Item' does not contain a definition for 'name'
It says there is a problem with line 15 but I cant solve it.
My Coding is this:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
Item.Name = "Dirt Sword"; //sword name
Item.damage = 5; //sword damage
Item.melee = true;
Item.width = 50;
item.height = 50;
item.toopTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
Item.useAnimation = 25;
Item.useStyle = 1;
Item.Knockback = 5;
Item.value = .33;
Item.rare = 10;
Item.usesound = 1;
Item.autoReuse = true;
Item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();



}
}
}
Please Help me as soon as possible, I have some great ideas I would love to enter into the terraira modding community, Thanks in advance!
If you type Item with a capital, the code thinks you're referring to the Item class of Terraria. Item should be lowercase in all the lines from SetDefaults, as well as Name and Knockback.
 
If you type Item with a capital, the code thinks you're referring to the Item class of Terraria. Item should be lowercase in all the lines from SetDefaults, as well as Name and Knockback.
Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?
My Updated code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword"; //sword name
item.damage = 5; //sword damage
item.melee = true;
item.width = 50;
item.height = 50;
item.toolTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockback = 5;
item.value = .33;
item.rare = 10;
item.usesound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();



}
}
}
 
If you have no mods installed (or active) can you play with players who don't have tModLoader but have Terraria for Steam? Can they join your world if no mods are installed (or active)?
No, Modloader is a mod for include mods. So same if you have not active mods, meh, this is not the same thing ^^.

Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?
My Updated code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword"; //sword name
item.damage = 5; //sword damage
item.melee = true;
item.width = 50;
item.height = 50;
item.toolTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockback = 5;
item.value = .33;
item.rare = 10;
item.usesound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();



}
}
}

I think 100% than knockback is knockBack and usesound is useSound ^^. Use Examplemod for have correct word or VisualStudio(or, if you cannot, use a other IDE) who see error instantly and propose you a correction.
 
Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?
My Updated code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword"; //sword name
item.damage = 5; //sword damage
item.melee = true;
item.width = 50;
item.height = 50;
item.toolTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockback = 5;
item.value = .33;
item.rare = 10;
item.usesound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();



}
}
}
The b in knockback needs to be capitalised (knockBack). That's what's causing the issue.

I recommend installing Visual Studio, it has the IntelliSense feature which auto-completes your code, and all in all prevents you from making these mistakes. It'll make everything a lot simpler and faster.
 
The b in knockback needs to be capitalised (knockBack). That's what's causing the issue.

I recommend installing Visual Studio, it has the IntelliSense feature which auto-completes your code, and all in all prevents you from making these mistakes. It'll make everything a lot simpler and faster.
Thats what im using, it autocorrected to that but I thought it was wrong, my mistake. thank you so much!
 
When I click on "Download" in any mod of the mod browser,it don't works and shows this in the log:

The system can not find the file specified
em System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
em System.Diagnostics.Process.Start()
em System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
em Terraria.ModLoader.UI.UIErrorMessage.OpenFile(UIMouseEvent evt, UIElement listeningElement)
em Terraria.UI.UIElement.Click(UIMouseEvent evt)
em Terraria.UI.UserInterface.Update(GameTime time)
em Terraria.Main.do_Update(GameTime gameTime)
em Terraria.Main.Update(GameTime gameTime)
 
Back
Top Bottom