Standalone [1.3] tModLoader - A Modding API

How is it possible to make a throwing weapon that uses itself when thrown?
I tried many things, but since spriting my weapons takes the most time and energy I cant really think about that much....
So it would be awesome if someone of you could tell me
 
i keep getting this error when trying to compile a mod
c:\Users\jonkt\OneDrive\Documents\My Games\Terraria\ModLoader\Mod Sources\New folder\Mod Sources\DependentMod\Items\DependentModItem.cs(6,7) : error CS0246: The type or namespace name 'BadUtils' could not be found (are you missing a using directive or an assembly reference?)
 
How is it possible to make a throwing weapon that uses itself when thrown?
I tried many things, but since spriting my weapons takes the most time and energy I cant really think about that much....
So it would be awesome if someone of you could tell me
if you're talking about the weapon being consumed upon use you put:
Code:
item.consumable = true;
 
The custom debuff I made doesn't seem to do anything :/. Basically it drains life very rapidly but when npcs or anything is inflicted with it nothing happens.
Here is the debuff code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessMod.Buffs
{
public class GoldenFire : ModBuff
{
public void Effects(Player P) //, int buffIndex, int buffType, int buffTime)
{
P.lifeRegenTime = 0;
P.lifeRegen = -11;

}

public void NPCEffects(NPC N) //, int buffIndex, int buffType, int buffTime)
{
N.lifeRegen = -20;


}
}
}
 
Hey bluemagic123, I still don't understand (I don't use the terminal at all), I've tried to use the "cd" command but it says that there is "No such file or directory". I really want these mods, but i can't seem to get the command to work! Am I doing this wrong or is something wrong with the terminal?
That means you're getting the folder names wrong.

i keep getting this error when trying to compile a mod
c:\Users\jonkt\OneDrive\Documents\My Games\Terraria\ModLoader\Mod Sources\New folder\Mod Sources\DependentMod\Items\DependentModItem.cs(6,7) : error CS0246: The type or namespace name 'BadUtils' could not be found (are you missing a using directive or an assembly reference?)
There are several problems here; let's start with the first one. First of all, why do you have a "New folder" folder inside the "Mod Sources" folder? Your "DependentMod" and "ExampleMod" folders should be directly in the "Mod Sources" folder, and "BadUtils.dll" should be directly in the "dllReferences" folder.

The custom debuff I made doesn't seem to do anything :/. Basically it drains life very rapidly but when npcs or anything is inflicted with it nothing happens.
Here is the debuff code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessMod.Buffs
{
public class GoldenFire : ModBuff
{
public void Effects(Player P) //, int buffIndex, int buffType, int buffTime)
{
P.lifeRegenTime = 0;
P.lifeRegen = -11;

}

public void NPCEffects(NPC N) //, int buffIndex, int buffType, int buffTime)
{
N.lifeRegen = -20;


}
}
}
Those are the tAPI hooks. You need to use "public override void Update(Player player, ref int buffIndex)". NPC buffs will have support in the next update.
 
That means you're getting the folder names wrong.


There are several problems here; let's start with the first one. First of all, why do you have a "New folder" folder inside the "Mod Sources" folder? Your "DependentMod" and "ExampleMod" folders should be directly in the "Mod Sources" folder, and "BadUtils.dll" should be directly in the "dllReferences" folder.


Those are the tAPI hooks. You need to use "public override void Update(Player player, ref int buffIndex)". NPC buffs will have support in the next update.

It seems to work on enemy players but not enemy npcs...
 
That means you're getting the folder names wrong.


There are several problems here; let's start with the first one. First of all, why do you have a "New folder" folder inside the "Mod Sources" folder? Your "DependentMod" and "ExampleMod" folders should be directly in the "Mod Sources" folder, and "BadUtils.dll" should be directly in the "dllReferences" folder.


Those are the tAPI hooks. You need to use "public override void Update(Player player, ref int buffIndex)". NPC buffs will have support in the next update.

When I put in the the public override Update(Player player, ref int buffIndex) code I got this error
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\Buffs\GoldenFire.cs(11,1) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
Here is the debuff code if it helps
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessMod.Buffs
{
public class GoldenFire : ModBuff
{
public override void Update(Player player, ref int buffIndex);//, int buffIndex, int buffType, int buffTime)
{
P.lifeRegenTime = 0;
P.lifeRegen = -11;

}

public void NPCEffects(NPC N) //, int buffIndex, int buffType, int buffTime)
{
N.lifeRegen = -20;


}
}
}
 
When I put in the the public override Update(Player player, ref int buffIndex) code I got this error
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\Buffs\GoldenFire.cs(11,1) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
Here is the debuff code if it helps
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessMod.Buffs
{
public class GoldenFire : ModBuff
{
public override void Update(Player player, ref int buffIndex);//, int buffIndex, int buffType, int buffTime)
{
P.lifeRegenTime = 0;
P.lifeRegen = -11;

}

public void NPCEffects(NPC N) //, int buffIndex, int buffType, int buffTime)
{
N.lifeRegen = -20;


}
}
}
Why are you using "P" when you named the Player variable "player"? You'll need to change the name of one or the other.
 
Why are you using "P" when you named the Player variable "player"? You'll need to change the name of one or the other.

The Debuff works but how do I get it so when a npc uses a projectile on a player it gives the player the debuff? Also is it possible to get a enemy projectile to home in on a player?
 
When I put in the the public override Update(Player player, ref int buffIndex) code I got this error
c:\Users\Julian Romero\Documents\My Games\Terraria\ModLoader\Mod Sources\EpicnessMod\Buffs\GoldenFire.cs(11,1) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
Here is the debuff code if it helps
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace EpicnessMod.Buffs
{
public class GoldenFire : ModBuff
{
public override void Update(Player player, ref int buffIndex);//, int buffIndex, int buffType, int buffTime)
{
P.lifeRegenTime = 0;
P.lifeRegen = -11;

}

public void NPCEffects(NPC N) //, int buffIndex, int buffType, int buffTime)
{
N.lifeRegen = -20;


}
}
}
Also in the Update method before the // comment you don't need the semi-colon.
 
MediaFire is being a bit of a douche. When I click the download button, it just loads the page again, without actually downloading anything. I only have this problem when downloading tModloader v0.6 for Windows, not with any other file whatsoever. Why is this? And how can I fix it?
 
The Debuff works but how do I get it so when a npc uses a projectile on a player it gives the player the debuff? Also is it possible to get a enemy projectile to home in on a player?
 
MediaFire is being a bit of a douche. When I click the download button, it just loads the page again, without actually downloading anything. I only have this problem when downloading tModloader v0.6 for Windows, not with any other file whatsoever. Why is this? And how can I fix it?
Just reload the page, not sure why it does that, but it does.

The Debuff works but how do I get it so when a npc uses a projectile on a player it gives the player the debuff? Also is it possible to get a enemy projectile to home in on a player?
Just use the projectile onhitplayer hook.

Yes, see the posts from earlier for an example.

How come I cant restore my terraria back to vanilla mode? Can somebody help me with my problem?
Run the installer again and select the appropriate option.
 
Anyone know how to fix this

at Terraria.ModLoader.ModLoader.do_Load(Object threadContext) at Terraria.Recipe.SetupRecipes() at Terraria.ModLoader.ModLoader.AddRecipes() at Terranauts.Weapons.BluesSword.AddRecipes() at Terraria.ModLoader.ModRecipe.AddIngredient(Mod mod, String itemName, Int32 stack)If you are trying to use a vanilla item, try removing the first argument.The item Wood does not exist in the mod Terranauts.
 
how do i install this, the OP says to read the README and the README says to read the OP.
...What? This is what the README says on Windows:

To open the tModLoader installer, run Installer.exe.

To install tModLoader, click on the "Install tModLoader" button.

If you want to create mods, after you install tModLoader click on the "Setup Modder Environment" button.

If you want tModLoader to be in a different folder than the Terraria folder, or you want it to have a file name other than Terraria.exe, click on the "Choose Terraria Path" button.

To restore vanilla Terraria after you have installed tModLoader, click on the "Restore Vanilla Terraria" button.

To restore tModLoader after you have installed tModLoader then restored vanilla Terraria, click on the "Restore tModLoader" button.
 
Back
Top Bottom