• PC NEWS: 1.4.2.3 update is out! More info here. Report bugs here
  • CONSOLE 1.4 NEWS: The current plan is to have Terraria: Journey's End out for Xbox and PlayStation in Q3 2021 (Jul-Sep). Switch will follow shortly afterwards. More info here. Stay up to date with console news here
  • MOBILE NEWS: Stay up to date with the latest mobile news here. Report mobile bugs here

Standalone [1.3] tModLoader - A Modding API

BlackScout

Terrarian
I checked the github for new releases and it says tmodloader has been updated for 1.4 on steam, but when I launch tmodloader on steam it says 1.3.5.3. Any reason why?
z4ho84U.png
 

Stickweedy

Terrarian
Hey everyone , i'm having a problem creating a TML server, when i start a server with mods or i even tried with no mods i get an error in the log file:
[18:41:56] [10/WARN] [tML]: Silently Caught Exception:
System.Runtime.InteropServices.COMException: The requested resource is in use. (Exception of HRESULT : 0x800700AA)
at NATUPNPLib.IStaticPortMappingCollection.Add(Int32 lExternalPort, String bstrProtocol, Int32 lInternalPort, String bstrInternalClient, Boolean bEnabled, String bstrDescription)
at Terraria.Netplay.OpenPort()
at Terraria.Netplay.ServerLoop(Object threadContext)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
therefore nobody is able to join through IP, but i can join from 127.0..0.1 but not from IP.

And if i launch it from "Host & Play" friends can join the world via steam.
I had a server for 1.4 vanilla terraria and never had an issue.
Is there anything im doing wrong or is there something missing for the tModLoaderServer.exe to run smoothly?
 

Attachments

  • server.log
    3.6 KB · Views: 58

White_Shadow

Eye of Cthulhu
Hello guys, my friend is having a problem with one of his worlds. When he tried to load it, the load was successful but once it did load the whole screen except for the UI was a deep purple color. Any subsequent load attempts returned an error. Could a mod be causing this or is it something with the world file?
 

Nyanisty

Terrarian
Hello guys, my friend is having a problem with one of his worlds. When he tried to load it, the load was successful but once it did load the whole screen except for the UI was a deep purple color. Any subsequent load attempts returned an error. Could a mod be causing this or is it something with the world file?

try pressing try pressing F11 or F12 when he loads in game.one of those buttons removes the ui.
he probably pressed it by mistake
 

CST1229

Official Terrarian
rip theres anti-piracy now
i guess i cannot play modded from now on

UPDATE: I bought the game. ok?
 
Last edited:

Segnitia

Terrarian
I recently downloaded the tmodloader v0.11.7.4 but because of my 2gb ram, I couldnt play any game with mods. I thought about playing vanilla terraria and for some reason, the game crashes when i click single player. I get a glimpse of my characters and the color they originally had was different. I know that you can uninstall tmodloader uaing steams verify game files but sadly, our internet has been dead for months. Is there any other way to revert this problem?
 

Solo-Ion

Dungeon Spirit
I recently downloaded the tmodloader v0.11.7.4 but because of my 2gb ram, I couldnt play any game with mods. I thought about playing vanilla terraria and for some reason, the game crashes when i click single player. I get a glimpse of my characters and the color they originally had was different. I know that you can uninstall tmodloader uaing steams verify game files but sadly, our internet has been dead for months. Is there any other way to revert this problem?
If you installed tModLoader via Steam, you simply need to launch Terraria instead of tModLoader. But if you installed with the zip file, open Terraria's install folder and assuming that it wasn't overwritten, you should see both the vanilla and moded .exe files. Rename the moded one to something else and rename the vanilla one to Terraria.exe.
 

Segnitia

Terrarian
If you installed tModLoader via Steam, you simply need to launch Terraria instead of tModLoader. But if you installed with the zip file, open Terraria's install folder and assuming that it wasn't overwritten, you should see both the vanilla and moded .exe files. Rename the moded one to something else and rename the vanilla one to Terraria.exe.
Thats the mistake i made. I overwritten the contents folder which i think is the problem
 

Solo-Ion

Dungeon Spirit
Thats the mistake i made. I overwritten the contents folder which i think is the problem
If you happen to know someone with the vanilla game, they could give you the files you're missing on a usb drive. Otherwise, you'll need to find a way to get an internet connection. Do you have a mobile with an internet connection? Could you do a USB tether to get internet?
 

SapphireSuicune

Spazmatism
The name 'player' does not exist in the current context.
using Terraria.ModLoader;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.UI;
using System.IO;
using System.Numerics;
using Microsoft.Xna.Framework;
using System;

namespace ZephyrMod.Projectiles
{
public class ZephyrBarrierBookProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault("ZephyrBarrierBook"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
}

public override void SetDefaults()
{
projectile.Name = "ZephyrBarrierBook";
projectile.width = 400;
projectile.height = 400;
projectile.aiStyle = 71;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.magic = true;
}
public override void AI()
{
Player p = Main.player[projectile.owner];

double deg = (double)projectile.ai[1];
double rad = deg * (Math.PI / 180);
double dist = 64;

projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - projectile.width / 2;
projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - projectile.height / 2;


projectile.ai[1] += 1f;
}
}
}
 

Solo-Ion

Dungeon Spirit
The name 'player' does not exist in the current context.
using Terraria.ModLoader;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.UI;
using System.IO;
using System.Numerics;
using Microsoft.Xna.Framework;
using System;

namespace ZephyrMod.Projectiles
{
public class ZephyrBarrierBookProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
// DisplayName.SetDefault("ZephyrBarrierBook"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
}

public override void SetDefaults()
{
projectile.Name = "ZephyrBarrierBook";
projectile.width = 400;
projectile.height = 400;
projectile.aiStyle = 71;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.magic = true;
}
public override void AI()
{
Player p = Main.player[projectile.owner];

double deg = (double)projectile.ai[1];
double rad = deg * (Math.PI / 180);
double dist = 64;

projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - projectile.width / 2;
projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - projectile.height / 2;


projectile.ai[1] += 1f;
}
}
}
Change
Player p = Main.player[projectile.owner];
to
Player player = Main.player[projectile.owner];

Or else player.Center.X and .Y won't have a clue which player you mean.
 

Yeahfrick

Official Terrarian
c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(10,30) : error CS0115: 'noname.Items.WingsName.Autoload(ref string, ref string, System.Collections.Generic.IList<Terraria.ModLoader.EquipType>)': no se encontró ningún miembro adecuado que invalidar

c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(32,30) : error CS0115: 'noname.Items.WingsName.VerticalWingSpeeds(ref float, ref float, ref float, ref float, ref float)': no se encontró ningún miembro adecuado que invalidar

c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(42,30) : error CS0115: 'noname.Items.WingsName.HorizontalWingSpeeds(ref float, ref float)': no se encontró ningún miembro adecuado que invalidar

(sorry i have terraria in spanish)

code:

using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace noname.Items
{
public class LatormWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}

public override void SetDefaults()
{
item.name = "LatormWings";
item.width = 22;
item.height = 20;
item.toolTip = "";
item.value = 10000;
item.rare = 4;
item.accessory = true;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}

public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising,
ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}

public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}

public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "latorm", 10); //you need 10 Wood
recipe.AddTile(TileID.anvil); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}

the code is from Al0n37 . i think i have this error because its outdated
 
Last edited:

Simple

The Destroyer
c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(10,30) : error CS0115: 'noname.Items.WingsName.Autoload(ref string, ref string, System.Collections.Generic.IList<Terraria.ModLoader.EquipType>)': no se encontró ningún miembro adecuado que invalidar

c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(32,30) : error CS0115: 'noname.Items.WingsName.VerticalWingSpeeds(ref float, ref float, ref float, ref float, ref float)': no se encontró ningún miembro adecuado que invalidar

c:\Users\AARONCITO\Documents\My Games\Terraria\ModLoader\Mod Sources\noname\Items\LatormWings.cs(42,30) : error CS0115: 'noname.Items.WingsName.HorizontalWingSpeeds(ref float, ref float)': no se encontró ningún miembro adecuado que invalidar

(sorry i have terraria in spanish)

code:

using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace noname.Items
{
public class LatormWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}

public override void SetDefaults()
{
item.name = "LatormWings";
item.width = 22;
item.height = 20;
item.toolTip = "";
item.value = 10000;
item.rare = 4;
item.accessory = true;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = 10; //wings Height
}

public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising,
ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentMultiplier = 3f;
constantAscend = 0.135f;
}

public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
{
speed = 9f;
acceleration *= 2.5f;
}

public override void AddRecipes() //How to craft this item
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(null, "latorm", 10); //you need 10 Wood
recipe.AddTile(TileID.anvil); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}

the code is from Al0n37 . i think i have this error because its outdated
To Al0n37 does have an outdated code. Add "Player player," to and public override void HorizontalWingSpeeds(ref float speed, ref float acceleration) and public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)

There are some extra errors I have noticed:
TileID.anvil is not the ID for an anvil, it should be this instead: TileID.Anvils
In SetDefaults, item.toolTip = ""; and item.name = "LatormWings"; is outdated. Instead, make a new class thingy called SetStaticDefaults
public override void SetStaticDefaults() {
DisplayName.SetDefault("LatormWings");
Tooltip.SetDefault("");
}

C#:
using System.Collections.Generic;

using Terraria;

using Terraria.ID;

using Terraria.ModLoader;



namespace noname.Items

{

    public class LatormWings : ModItem

    {

        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)

        {

            equips.Add(EquipType.Wings);

            return true;

        }

        public override void SetStaticDefaults() {

            DisplayName.SetDefault("LatormWings");
            Tooltip.SetDefault("");

        }

        public override void SetDefaults()

        {

            item.width = 22;

            item.height = 20;

            item.value = 10000;

            item.rare = 4;

            item.accessory = true;

        }



        public override void UpdateAccessory(Player player, bool hideVisual)

        {

            player.wingTimeMax = 10;  //wings Height

        }



        public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)

        {

            ascentWhenFalling = 0.85f;

            ascentWhenRising = 0.15f;

            maxCanAscendMultiplier = 1f;

            maxAscentMultiplier = 3f;

            constantAscend = 0.135f;

        }



        public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)

        {

            speed = 9f;

            acceleration *= 2.5f;

        }



        public override void AddRecipes()  //How to craft this item

        {

            ModRecipe recipe = new ModRecipe (mod);

            recipe.AddIngredient(null, "latorm", 10);

            recipe.AddTile(TileID.Anvils);

            recipe.SetResult(this);

            recipe.AddRecipe();

        }

    }

}

I hope that works! :D

P.S: There is another modding tutorial video called Modding Master class made by Lynx on youtube, although cancelled for 1.4, it is up to date.
 

Nyanisty

Terrarian
can someone help me out here?
My Tmodloader is up to date however my terraria server.exe is not it's using v0.11.6.2

im running v0.11.7.5


Edit 1: Resolved
 
Last edited:
Top Bottom