• Switch 1.4: Journey's End on Switch released January 4, 2022! More details here. Report bugs here.

Standalone [1.3] tModLoader - A Modding API

OVuzS

Terrarian
When I click on the installer it says what app do you want to use to open it and im confused. can someone help?
edit- On windows 10, no winrar
 

Solo-Ion

Dungeon Spirit
When I click on the installer it says what app do you want to use to open it and im confused. can someone help?
edit- On windows 10, no winrar
The readme that comes with tModLoader explains how to do a manual install if you can't do an auto install.
 

InspectrE YT

Terrarian
I really enjoy this, but there are some bugs I'm experiencing on MacOS.
Whenever I close the game, I have to delete the modloader folder to play Terraria again with mods. (I'm assuming it's because the game tries to make another ModLoader folder, but fails to do so)
I'll try to put in some more I find, if I do find anything.
 
Last edited:

Jofairden

Duke Fishron
tModLoader
I really enjoy this, but there are some bugs I'm experiencing on MacOS.
Whenever I close the game, I have to delete the modloader folder to play Terraria again with mods. (I'm assuming it's because the game tries to make another ModLoader folder, but fails to do so)
I'll try to put in some more I find, if I do find anything.
It is useful if you join us on discord, we need mac testers. We recently made changes to mac/linux config that should fix issues (not in current release but the new beta)
 
Terraria\ModLoader\Mod Sources\ModTerrariaAnotherDimension\TerrariaAnotherDimension.cs(7,10) : error CS1520: the method must have a return type

my code btw:

using Terraria.ModLoader;

namespace TerrariaAnotherDimension
{
class TerrariaAnotherDimension : Mod
{
public ModTerrariaAnotherDimension()
{
}
}
}

pls help!!!!!!!!! and thank you to anyone that does!!!!!!
 
Last edited:
Not sure if I can just post my problems here but every time I try to play this game with tModLoader I can get a few days of gameplay in and then my world and player become corrupted.
The Character becomes blank and I can't choose them, and the world just gives me the message:
Index was outside the bounds of the array.
at Terraria.Player.Spawn()
at Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
at Terraria.WorldGen.playWorldCallBack(Object threadContext)
when i click on it.

I have tried changing the plr.bak, tplr.bak, and both for the world but nothing helps.
 

mr e

The Destroyer
I downloaded the Calamity Mod the other day, and while it worked perfectly while I had the Terraria window open, after I closed Steam and logged back on later, Terraria just gets stuck loading the mod. I left my computer on for most of the day while I did other stuff, but it still never loaded. I uninstalled and reinstalled tmod, but Calamity is still downloaded because of the save file and it's stuck again. Any tips?
[doublepost=1554326932,1554326803][/doublepost]Never mind, deleted Calamity from my Terraria folder and now it's fine. I'll just have to remember to disable Calamity whenever I leave...
 

Crysmax00D2FF

Skeletron Prime
If at all possible, how would I write a mod in F#? I have everything down, and it all seems to be written correctly, but tModLoader says "make sure there is exactly one class that extends Mod." but the class exists. Any help would be appreciated. Here's my mod code:

namespace FSTestMod
open Terraria.ModLoader
type public FSTestMod() =
inherit Mod()

let mutable properties = new ModProperties()

do
properties.Autoload <- true
properties.AutoloadBackgrounds <- true
properties.AutoloadGores <- true
properties.AutoloadSounds <- true

member __.Properties = properties
 

jopojelly

Retinazer
tModLoader
If at all possible, how would I write a mod in F#? I have everything down, and it all seems to be written correctly, but tModLoader says "make sure there is exactly one class that extends Mod." but the class exists. Any help would be appreciated. Here's my mod code:

namespace FSTestMod
open Terraria.ModLoader
type public FSTestMod() =
inherit Mod()

let mutable properties = new ModProperties()

do
properties.Autoload <- true
properties.AutoloadBackgrounds <- true
properties.AutoloadGores <- true
properties.AutoloadSounds <- true

member __.Properties = properties
you are on your own there.
 

Quethed

Terrarian
Can you add a feature that makes a graph of downloads every month you get on your mod, it will help tell if you are rising or falling in popularity.
 

Everybody

Terrarian
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using TerrariaPlus.Items;
using Terraria.ModLoader.IO;
using Terraria.GameInput;

namespace TerrariaPlus
{   
    public class GlobalPlayer : ModPlayer
    {
        public bool reviveAngel = false;
        public bool reviveDebuff = false;
        public override void ResetEffects()
        {
            public bool reviveAngel = false;
            public bool reviveDebuff = false;
        }
        public override void OnHitByNPC(NPC npc, int damage, bool crit)
        {
            for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
            {
                if (player.armor[index1].type == mod.ItemType("GlassShield"))
                {
                    if(Main.rand.Next(6)==0)
                    {
                        player.statLife += (damage);
                        Main.NewText(player.name + " blocked " +  damage + damage", 0, 155, 55);
                    }
                }
                if (player.armor[index1].type == mod.ItemType("FireShield"))
                {
                        npc.AddBuff(BuffID.OnFire, 300);
                }
                if(player.setBonus == ("Chance to dodge attacks by hiding in shadows"))
                {
                    if(Main.rand.Next(15)==0)
                    {
                        player.AddBuff(BuffID.Invisibility, 30);
                        player.statLife += (damage);
                        Main.NewText(player.name + " hid from " +  damage + " damage", 0, 155, 55);
                    }
                }
            }
        }
        public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
        {
            for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
            {
                if (player.reviveAngel = true)
                {
                    if(player.reviveDebuff = false)
                    {
                        return false;
                        player.statLife += (player.statLifeMax * 0.3);
                        Main.NewText(player.name + " lives!", 0, 155, 55);
                        player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
                    }
                }
            }
        }
    }
}

says } expected when I try to compile. Any help?
 

Quethed

Terrarian
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using TerrariaPlus.Items;
using Terraria.ModLoader.IO;
using Terraria.GameInput;

namespace TerrariaPlus
{  
    public class GlobalPlayer : ModPlayer
    {
        public bool reviveAngel = false;
        public bool reviveDebuff = false;
        public override void ResetEffects()
        {
            public bool reviveAngel = false;
            public bool reviveDebuff = false;
        }
        public override void OnHitByNPC(NPC npc, int damage, bool crit)
        {
            for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
            {
                if (player.armor[index1].type == mod.ItemType("GlassShield"))
                {
                    if(Main.rand.Next(6)==0)
                    {
                        player.statLife += (damage);
                        Main.NewText(player.name + " blocked " +  damage + damage", 0, 155, 55);
                    }
                }
                if (player.armor[index1].type == mod.ItemType("FireShield"))
                {
                        npc.AddBuff(BuffID.OnFire, 300);
                }
                if(player.setBonus == ("Chance to dodge attacks by hiding in shadows"))
                {
                    if(Main.rand.Next(15)==0)
                    {
                        player.AddBuff(BuffID.Invisibility, 30);
                        player.statLife += (damage);
                        Main.NewText(player.name + " hid from " +  damage + " damage", 0, 155, 55);
                    }
                }
            }
        }
        public override void Hurt (bool pvp, bool quiet, double damage, int hitDirection, bool crit)
        {
            for (int index1 = 3; index1 < 8 + player.extraAccessorySlots; ++index1)
            {
                if (player.reviveAngel = true)
                {
                    if(player.reviveDebuff = false)
                    {
                        return false;
                        player.statLife += (player.statLifeMax * 0.3);
                        Main.NewText(player.name + " lives!", 0, 155, 55);
                        player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
                    }
                }
            }
        }
    }
}

says } expected when I try to compile. Any help?

if(player.reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
likely because you mis-placed a return value, but that return value is still a problem.
return values go on the end:

if(player.reviveDebuff = false)
{
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
return false;
}
 

Everybody

Terrarian
if(player.reviveDebuff = false)
{
return false;
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
}
likely because you mis-placed a return value, but that return value is still a problem.
return values go on the end:

if(player.reviveDebuff = false)
{
player.statLife += (player.statLifeMax * 0.3);
Main.NewText(player.name + " lives!", 0, 155, 55);
player.AddBuff(mod.BuffType("ReviveDebuff"), 18000);
return false;
}
same error still occuring
 
Top Bottom