Standalone [1.3] tModLoader - A Modding API

Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace League.Items.Advanced
{
    public class TearOfGoddess : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("+ " 50+(player.tearStacks) "/300 Mana" + "\nAdds 1 Maximum Mana everytime you damage an enemy with magic damage");
        }

        public override void SetDefaults()
        {
            item.width = 30;
            item.height = 24;
            item.value = 5000;
            item.rare = 2;
            item.accessory = true;
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.statManaMax2 += (50+player.tearStacks);
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SapphireCrystal");
            recipe.AddIngredient(null, "FaerieCharm");
            recipe.AddIngredient(null, "LeagueCoin", 275);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

that's my code and it's telling me ')' is expected at {14,28} but it's a } there. any help?
 
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace League.Items.Advanced
{
    public class TearOfGoddess : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("+ " 50+(player.tearStacks) "/300 Mana" + "\nAdds 1 Maximum Mana everytime you damage an enemy with magic damage");
        }

        public override void SetDefaults()
        {
            item.width = 30;
            item.height = 24;
            item.value = 5000;
            item.rare = 2;
            item.accessory = true;
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.statManaMax2 += (50+player.tearStacks);
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SapphireCrystal");
            recipe.AddIngredient(null, "FaerieCharm");
            recipe.AddIngredient(null, "LeagueCoin", 275);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

that's my code and it's telling me ')' is expected at {14,28} but it's a } there. any help?
Your quotes, plus signs, etc don't match up, I'd suggest using Visual Studio because things syntax errors like this shouldn't be the hard part of modding.

SetStaticDefaults is called before a Player object even exists, you can't access player in SetStaticDefaults. If you want adaptive tooltips, you'd have to do that in ModifyTooltips hook.
 
Your quotes, plus signs, etc don't match up, I'd suggest using Visual Studio because things syntax errors like this shouldn't be the hard part of modding.

SetStaticDefaults is called before a Player object even exists, you can't access player in SetStaticDefaults. If you want adaptive tooltips, you'd have to do that in ModifyTooltips hook.
see... I use this format for all my items without failure. It is this specific item. Should I show another item?
 
How do you make an accessory that increases max life
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace League.Items.Basic
{
    public class RubyCrystal : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("+20 HP");
        }

        public override void SetDefaults()
        {
            item.width = 22;
            item.height = 20;
            item.value = 1000;
            item.rare = 1;
            item.accessory = true;
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.statLifeMax2 += 20;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.LifeCrystal);
            recipe.AddIngredient(null, "LeagueCoin", 400);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

notice the public override void UpdateAccessory portion
 
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace League.Items.Basic
{
    public class RubyCrystal : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("+20 HP");
        }

        public override void SetDefaults()
        {
            item.width = 22;
            item.height = 20;
            item.value = 1000;
            item.rare = 1;
            item.accessory = true;
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.statLifeMax2 += 20;
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.LifeCrystal);
            recipe.AddIngredient(null, "LeagueCoin", 400);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

notice the public override void UpdateAccessory portion
Yeah, that's fine, because the player that we are affecting is passed into that method.
 
Two things wrong with this comment. Firstly: This is obviously a crash error. Read the entire thing and don't just skim through.
Secondly: I had already said in the post that I had reinstalled both the game and TML twice each. /\ /\ /\



1.3.5.3 is not a focus for the team as the update is an extremely minor patch update. Plus, the download already works fine for people with this vanilla version.


Cloud saving destroys ALL mod things in every form: players and worlds, without exception.

Then how can i install mods on GoG terraria 1.3.5.3??
 
...also how do you make something happen when plantera is defeated, similar to (Main.hardMode)?

Edit: the wiki says it is "downedPlantBoss", but the game says otherwise? Help?
 
Last edited:
I'm using the latest version of Tmodloader, finally, when I create a character, after selecting the nickname the crash game and closes after, I do not know what to do.
 
...also how do you make something happen when plantera is defeated, similar to (Main.hardMode)?

Edit: the wiki says it is "downedPlantBoss", but the game says otherwise? Help?
NPC.downedPlantBoss is correct.

I'm using the latest version of Tmodloader, finally, when I create a character, after selecting the nickname the crash game and closes after, I do not know what to do.
Make sure all your mods are up to date, then experiment with no mods loaded and see if it loads then. If so, add some of your mods and reload, continue until it fails
 
NPC.downedPlantBoss is correct.


Make sure all your mods are up to date, then experiment with no mods loaded and see if it loads then. If so, add some of your mods and reload, continue until it fails
It is still coming up with an error "the type or namespace 'downedPlantBoss' does not exist in the namespace ***"
using Terraria;
using Terraria.ModLoader;
namespace "I hid this text"
{
[AutoloadEquip(EquipType.Shield)]
public class "I hid this text": ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+30 Max life before hardmode,+65 in hardmode, +100 Post Plantera");
}
public override void SetDefaults()
{
item.width = 24;
item.height = 28;
item.value = 20000;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
if (Main.hardMode == false)
{
player.statLifeMax2 += 30;
}
else if (NPC.downedPlantBoss == false)
{
player.statLifeMax2 += 65;
}
else
{
player.statLifeMax2 += 100;
}
}
}
}
 
Can you please help me? :D

Do you know if someone is working on the v1.3.5.3 patch for GoG installer?
Not at the moment.
[doublepost=1506663197,1506663093][/doublepost]
It is still coming up with an error "the type or namespace 'downedPlantBoss' does not exist in the namespace ***"
using Terraria;
using Terraria.ModLoader;
namespace "I hid this text"
{
[AutoloadEquip(EquipType.Shield)]
public class "I hid this text": ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+30 Max life before hardmode,+65 in hardmode, +100 Post Plantera");
}
public override void SetDefaults()
{
item.width = 24;
item.height = 28;
item.value = 20000;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
if (Main.hardMode == false)
{
player.statLifeMax2 += 30;
}
else if (NPC.downedPlantBoss == false)
{
player.statLifeMax2 += 65;
}
else
{
player.statLifeMax2 += 100;
}
}
}
}
Ahh, I think you are having this problem: https://github.com/blushiemagic/tMo...space-y-are-you-missing-an-assembly-reference

You probably names one of your namespaces NPC, so the compiler is confused.
 
I can not find any conflict, but is it anything to do with this:

namespace QuethedsMod.Images.NPC
(I did not blur name this time(Also I took this from another file, so it should not relate?))
FunFact: All my textures are in a folder called "Images", to match "Images"(non-modded)
 
Last edited:
I can not find any conflict, but is it anything to do with this:

namespace QuethedsMod.Images.NPC
(I did not blur name this time(Also I took this from another file, so it should not relate?))
FunFact: All my textures are in a folder called "Images", to match "Images"(non-modded)
Yes, that is the conflict. Either rename that to NPCs or qualify NPC.downedPlantBoss by writing Terraria.NPC.downedPlantBoss
 
There is a bug when me and my freind got the new tmodloader update


it would break our multiplayer session by not alloweing blocks to drop when we break them(it only shows we broke a block that we broke on our own, my freind broke some blocks and it looked like he was walking through all the blocks he broke)


we tried to summon plantera by destroying it's bulb


nothing happened


trees wouldn't drop wood when chopped and the blocks would just reapeer when we relog from the server



we restarted terraria, restarted our pc's

nothing worked


can you guys please look in and see why this is happening?
 
Back
Top Bottom