Standalone [1.3] tModLoader - A Modding API

I have GlowingMushroomShirt.png, GlowingMushroomShirtArms.png, GlowingMushroomShirtFemaleBody.png and GlowingMushroomShirtBody.png, and it satrted crashing after i tried loading the mod, windows said it had stopped working and closed it and it's been doing that every time i open tmodloader.
Just as the loading bar pops up on the program and says "setting up" wondows tells me it's not working.
 
Just as the loading bar pops up on the program and says "setting up" wondows tells me it's not working.
Hm, it's hard to tell what's happening. Can you upload your mod's folder? I can try to place some stuff in my code to see where things might be going wrong.
 
i found a file named "enable.txt" and changed it to false so now it ran and when i loaded my mod it gave me this:
upload_2015-7-22_17-48-57.png
EDIT: also i'm not quite sure how to upload a file :p
EDIT2: found one of the problems which was a typo in the female texture line, but it still crashes
 
Last edited:
i found a file named "enable.txt" and changed it to false so now it ran and when i loaded my mod it gave me this: EDIT: also i'm not quite sure how to upload a file :p
EDIT2: found one of the problems which was a typo in the female texture line, but it still crashes
Hm, do any of your items use any animations?
 
The shirt has the required spreadsheets in the Armor folder and since i'm just doing a test of sorts i'm only doing one item which is the shirt.
 
Thanks for creating this!

I'm trying to figure out how I can get the item that's currently in the player's hand. Which method do I override? I know I have everything set up and working, so it's more of a general modding question
 
The shirt has the required spreadsheets in the Armor folder and since i'm just doing a test of sorts i'm only doing one item which is the shirt.
Hm... what's happening is really weird and pretty hard to pinput. So sometimes your game is crashing, but sometimes the error message comes up?

Thanks for creating this!

I'm trying to figure out how I can get the item that's currently in the player's hand. Which method do I override? I know I have everything set up and working, so it's more of a general modding question
If you override the HoldItem method, then the ModItem whose method is getting called is the held item. You can also use player.selectedItem to get the index in player.inventory of the item that is in the player's hand.
 
Hm... what's happening is really weird and pretty hard to pinput. So sometimes your game is crashing, but sometimes the error message comes up?
Now it's not giving me an error at all and i have to manually disable it via enabled.txt
 
But the ModItem approach would only work if it's an item I added right? Not with vanilla items? SelectedItem() looks good, is there a way I can use the index to get the name of the item? That's my final goal. I simply need my mod to output the name of currently held item to a stream I'll implement later
[DOUBLEPOST=1437546329,1437546020][/DOUBLEPOST]I see that I can probably use something like Terraria.Player.inventory[Player.SelectedItem()]?

I just need this to be called every time the player switches to a different item. Or am I doing this all wrong?
 
Ok, so i had been trying to implement a new accessory, but i think that was causing problems on its own, i just rewrote 90% of my code and have come back to the same error of the namespace not being found. here are the three .cs pages im using.
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using WyvernCore.Items;

namespace WyvernCore {
public class WyvernCore : Mod
{
public override void SetModInfo(out string name, ref string version, ref string author)
{
name = "WyvernStuff";
version = "v0.0.0.1";
author = "WyvernHunter";
}

public override void Load()
{
SetGlobalItem(new WyvernCoreItem());
AddItem("FeatherBlade", new FeatherBlade(), "WyvernCore/Items/FeatherBlade");

}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(this);
recipe.AddIngredient(ItemID.DirtBlock);
recipe.SetResult(null, "FeatherBlade");
recipe.AddRecipe();
}
}
}
using System;
using Terraria.ID;
using Terraria.ModLoader;

namespace WyvernCore {
public static class RecipeHelper
{
public static void AddEquipmentRecipes(Mod mod)
{
ModRecipe recipe = new ModRecipe(mod);

}

}
}
using System;
using Terraria;
using Terraria.ModLoader;

namespace WyvernCore.Items {
public class FeatherBlade : ModItem
{
public override void SetDefaults()
{
item.name = "Feathery Blade";
item.damage = 45;
item.melee = true;
item.width = 40;
item.height = 40;
item.toolTip = "Doesn't seem very sharp...";
item.useTime = 18;
item.useAnimation = 18;
item.useStyle = 1;
item.knockBack = 8;
item.value = 20000;
item.rare = 2;
item.useSound = 1;
item.autoReuse = true;
}
}
}
The FeatherBlade.png is located in the Items folder with FeatherBlade.cs and the Items Folder is in the WyvernCore folder, that is all i have. Thank you for your patience.

I believe your problem is this:
Code:
SetGlobalItem(new WyvernCoreItem());
considering you didn't add a globalitem.cs file to your post.
[DOUBLEPOST=1437555439,1437555283][/DOUBLEPOST]
Well IDK how to code, don't know what kind of software I need, can't trust 70% of the internet because of scams, hacks, Trojans, and other stuff and I can't install nor download stuff for an entire week (4 more days until I can) because of internet issues of exeeding 400gb of internet usage. Also don't forget the fact that I don't know where to start on making a mod, so yeah.

Get started with C# (tutorials): (some things I used!)
http://www.tutorialspoint.com/csharp/
http://csharp.net-tutorials.com/
http://www.homeandlearn.co.uk/csharp/csharp.html
Brackeys Youtube C# Series (series) (also not a finished series, covers a decent amount of things though, don't bother following it to create a 'complete' app)
 
a thing i just noticed about my problem: it has no problem building the mod it seems but it crashes when i try and reload it :P
 
Is there any posibility of adding drops to vanilla mobs?
 
Why this won't work?
Code:
    public override void UpdateEquip(Player player)
    {
            player.rangedCrit += 0.06f;
    }
 
Why this won't work?
Code:
    public override void UpdateEquip(Player player)
    {
            player.rangedCrit += 0.06f;
    }
crit values are integers not floats
 
So what to do? What should I change? :D
you seriously don't know the difference between an integer and a float?
here's an example
integer: 6
float: 0.06f
double: 0.06
 
you seriously don't know the difference between an integer and a float?
here's an example
integer: 6
float: 0.06f
double: 0.06
But I need percents...
 
Would it be possible to request an example item for ranged/magic weapons? Or at least something that fires projectiles?
I've never used C# before but I wanna try getting into Terraria modding. All the guides/tutorials I could find on that are for json.
 
Would it be possible to request an example item for ranged/magic weapons? Or at least something that fires projectiles?
I've never used C# before but I wanna try getting into Terraria modding. All the guides/tutorials I could find on that are for json.
tModLoader does not support custom projectiles yet
 
Back
Top Bottom