tModLoader Official tModLoader Help Thread

So I'm a pretty new modder, and this is my code. I'm trying to make a clone of the Enchanted Boomerang to test out projectiles, but I keep receiving the message "error CS0246 The type or namespace name 'ModProjectile' could not be found. I'm confused by this since this is the exact same as in the example code on the "Basic Projectile"

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TestMod.Projectiles
{
public class NanorangProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("English Display Name Here");
}

public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.EnchantedBoomerang);
// projectile.aiStyle = 3; This line is not needed since CloneDefaults sets it.
aiType = ProjectileID.EnchantedBoomerang;
}

// Additional hooks/methods here.
}
}
 
I've got a problem with one of the files in my mod. I've tried to add the special arrows fired from the Shadowflame Bow as an actual, craftable item, which wasn't hard as the projectile already exists in-game.

However, when I tried to make an "Endless Quiver"-style item for these new arrows, an error occured, specifically error CS0117. The code that causes the error is as follows

ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModItem.ShadowflameArrow, 4000);
recipe.AddTile(TileID.CrystalBall);
recipe.SetResult(this);
recipe.AddRecipe();

Specifically, the AddIngredient line is the one causing the error. Any advice on how to fix this?
 

Attachments

I've got a problem with one of the files in my mod. I've tried to add the special arrows fired from the Shadowflame Bow as an actual, craftable item, which wasn't hard as the projectile already exists in-game.

However, when I tried to make an "Endless Quiver"-style item for these new arrows, an error occured, specifically error CS0117. The code that causes the error is as follows

ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModItem.ShadowflameArrow, 4000);
recipe.AddTile(TileID.CrystalBall);
recipe.SetResult(this);
recipe.AddRecipe();

Specifically, the AddIngredient line is the one causing the error. Any advice on how to fix this?
replace ModItem.ShadowflameArrow with mod.ItemType("ShadowflameArrow");
 
For some reason I am getting this error when I launch a freshly installed "tML 64 0.11.4 Windows.7z" installed on a fresh download of whatever the latest non-beta steam version is, whether through steam or through explorer directory (and I deleted "../my documents/terraria" prior)
 
So ever since tmodloader got updated I am unable to launch it, the error message "Please ensure steam is logged in and running" appears. I've resetted, uninstalled steam, and messed around with a ton things, yet I cant find whats wrong any help?
 
ModCompile folder is missing. Please help. I downloaded ModCompile XNA already, unzip it into Terraria. But the error keep appearing :(
 
You don't need to download anything manually
Disable Terraria Overhaul mod (if you had it enabled), delete the files you extracted, then go ingame and click Mod Sources
 
You don't need to download anything manually
Disable Terraria Overhaul mod (if you had it enabled), delete the files you extracted, then go ingame and click Mod Sources
Thanks. Terraria Overhaul does such a huge change to game.
 
I installed tmodloader, and decided to try some modding. I don't have a 'mod sources' button. What do I do?
 
replace ModItem.ShadowflameArrow with mod.ItemType("ShadowflameArrow");

Unfortunately, that didn't work, but thanks anyway.
I was able to fix the error after searching these forums some more. After I replaced
"recipe.AddIngredient(ModItem.ShadowflameArrow, 4000);"
with
"recipe.AddIngredient(null,"ShadowflameArrow", 4000);"
ModLoader could compile the file without any errors.
 
i have been using tmodloader for a while now playing both singleplayer and multiplayer with friends, today when i went to install a new mod i was prompted so update tmodloader and since i didnt want to bother doing it manually i clicked the button for auto update, it did its thing downloading the auto updater but when the game re-opened i had this strange debug menu layered over my normal controls and i can't get it to go away, i've tried all the f-number keys and all the hotkeys i can think of but nothing works, any advice on getting it to disable?
 

Attachments

  • screencap.PNG
    screencap.PNG
    853.6 KB · Views: 259
Overhaul doesn't work on 0.11.5 tml yet. Either disable that mod, or downgrade tml to 0.11.4
 
Overhaul doesn't work on 0.11.5 tml yet. Either disable that mod, or downgrade tml to 0.11.4
thanks for the info, i was just realising that overhaul was the problem, how do i downgrade now that i have auto update on?
 
So I'm a pretty new modder, and this is my code. I'm trying to make a clone of the Enchanted Boomerang to test out projectiles, but I keep receiving the message "error CS0246 The type or namespace name 'ModProjectile' could not be found. I'm confused by this since this is the exact same as in the example code on the "Basic Projectile"

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TestMod.Projectiles
{
public class NanorangProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("English Display Name Here");
}

public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.EnchantedBoomerang);
// projectile.aiStyle = 3; This line is not needed since CloneDefaults sets it.
aiType = ProjectileID.EnchantedBoomerang;
}

// Additional hooks/methods here.
}
}
 
I installed tmodloader, and decided to try some modding. I don't have a 'mod sources' button. What do I do?
Click the "Enter Developer Mode" button in the lower right corner.
 
is the mod browser not working for anyone else? me and three of my friends wanted to play together but tmodloader wasnt working properly, the mod browser is offline and we cant join each others worlds
 
is the mod browser not working for anyone else? me and three of my friends wanted to play together but tmodloader wasnt working properly, the mod browser is offline and we cant join each others worlds
Yes, the Mod Browser is down and will likely remain so for a couple of days. As per the tModLoader discord:

1571315710044.png
 
Hey, anyone else know how to get the rainbow trails like on the Meowmere?
 
TheBestPortato24 said:
Hey, anyone else know how to get the rainbow trails like on the Meowmere?
You should ether look at the games source code, just clone it or get one or find two kind good modders.

Code:
float Re = (float)Main.DiscoR / 255f;
float Gr = (float)Main.DiscoG / 255f;
float Bu = (float)Main.DiscoB / 255f;
Re = (0.5f + Re) / 2f;
Gr = (0.5f + Gr) / 2f;
Bu = (0.5f + Bu) / 2f;
Lighting.AddLight(projectile.Center, Re, Gr, Bu);

Yes there is rainbow lighting. for some reason

Code:
            int num3;
            for (int num318 = 0; num318 < projectile.oldPos.Length; num318 = num3 + 1)
            {
                if (!(projectile.oldPos[num318] == Vector2.Zero))
                {
                    int num319 = Dust.NewDust(projectile.oldPos[num318] + value13, 0, 0, 66, 0f, 0f, 150, Color.Transparent, 0.7f);
                    Main.dust[num319].color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f);
                    Main.dust[num319].noGravity = true;
                }
                num3 = num318;
            }
should work but i'm not testing it. put it in wherever you put dust.
 
Last edited:
Back
Top Bottom