Standalone [1.3] tModLoader - A Modding API

Is there a specific forum to ask for assistance on coding a mod?

There is nothing wrong with asking modding code questions in this thread, but the member I was speaking to was making posts that weren't questions and weren't directly about TML which is what I was addressing. Sorry if my post was confusing on that point.

There is also the Official tModLoader Help Thread and the mentioned General Mod Discussion section if you think your question would be better served by its own thread.
 
There is nothing wrong with asking modding code questions in this thread, but the member I was speaking to was making posts that weren't questions and weren't directly about TML which is what I was addressing. Sorry if my post was confusing on that point.

There is also the Official tModLoader Help Thread and the mentioned General Mod Discussion section if you think your question would be better served by its own thread.

Cool, thanks jeckel
 
I cant join the discord group. It says invite expired even though i havent joined yet so i cant be banned. Any halp?
[doublepost=1480209330,1480209246][/doublepost]
I've given this a try. Seems easy enough. I tried following your example however, but even your example doesn't work. I've done the steps correctly, but the recipes don't show up in-game. And no, I'm not getting compiling errors either.
Can you paste your code? An item that has its recipe not showing up.
 
i cant download tmodloader it always gives me an error that the dll file couldnt be installed then it says 'CSteamWorks' couldnt find something module plz help
[doublepost=1480217840,1480217338][/doublepost]my tmodloader doesnt work i have downloaded it several times and i always get the same exact error could not find dll file 'CSteamWorks' could not find controlmodule (tryrestartingapp)

its always that same one
 
i cant download tmodloader it always gives me an error that the dll file couldnt be installed then it says 'CSteamWorks' couldnt find something module plz help
[doublepost=1480217840,1480217338][/doublepost]my tmodloader doesnt work i have downloaded it several times and i always get the same exact error could not find dll file 'CSteamWorks' could not find controlmodule (tryrestartingapp)

its always that same one
Try uninstalling Terraria and reinstall it.
 
When should I send information to the server use NetMessage? And Where can i read about NetMessage's static methods include arguments?
 
Last edited:
Uh, so I'm trying to make some infinite flight wings and whenever I try to build and reload I get this error message:
c:\Users\(You dont need to know my real name)\Documents\My Games\Terraria\ModLoader\Mod Sources\OxysMod\Items\TerrariansLastWings.cs(27,40) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)

I don't really know what to do here since I'm kinda new, here's the code:

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

namespace OxysMod.Items
{
public class TerrariansLastWings : 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 = "Terrarians Last Wings";
item.width = 22;
item.height = 20;
item.toolTip = "It's about time.";
item.toolTip2 = "Allows complete freedom of flight";
item.value = 10000;
item.rare = 11;
item.accessory = true;
}
//these wings use the same values as the solar wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = -1;
}

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 = 2f;
maxAscentMultiplier = 4f;
constantAscend = 0.135f;
}

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

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.LunarBar, 95);
recipe.AddIngredient(ItemID.SoulofFlight, 99);
recipe.AddIngredient(ItemID.SoulofLight, 65);
recipe.AddIngredient(ItemID.Feather, 80);
recipe.AddIngredient(ItemID.SunplateBlock, 310);
recipe.AddIngredient(ItemID.FragmentSolar, 95);
recipe.AddIngredient(ItemID.DemonWings);
recipe.AddIngredient(ItemID.AngelWings);
recipe.AddIngredient(ItemID.ButterflyWings);
recipe.AddIngredient(ItemID.FairyWings);
recipe.AddIngredient(ItemID.BeeWings);
recipe.AddIngredient(ItemID.HarpyWings);
recipe.AddIngredient(ItemID.BoneWings);
recipe.AddIngredient(ItemID.AngelWings);
recipe.AddIngredient(ItemID.FlameWings);
recipe.AddIngredient(ItemID.FrozenWings);
recipe.AddIngredient(ItemID.SteampunkWings);
recipe.AddIngredient(ItemID.LeafWings);
recipe.AddIngredient(ItemID.FishronWings);
recipe.AddIngredient(ItemID.MothronWings);
recipe.AddIngredient(ItemID.WingsSolar);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
Uh, so I'm trying to make some infinite flight wings and whenever I try to build and reload I get this error message:
c:\Users\(You dont need to know my real name)\Documents\My Games\Terraria\ModLoader\Mod Sources\OxysMod\Items\TerrariansLastWings.cs(27,40) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)

I don't really know what to do here since I'm kinda new, here's the code:

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

namespace OxysMod.Items
{
public class TerrariansLastWings : 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 = "Terrarians Last Wings";
item.width = 22;
item.height = 20;
item.toolTip = "It's about time.";
item.toolTip2 = "Allows complete freedom of flight";
item.value = 10000;
item.rare = 11;
item.accessory = true;
}
//these wings use the same values as the solar wings
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.wingTimeMax = -1;
}

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 = 2f;
maxAscentMultiplier = 4f;
constantAscend = 0.135f;
}

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

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.LunarBar, 95);
recipe.AddIngredient(ItemID.SoulofFlight, 99);
recipe.AddIngredient(ItemID.SoulofLight, 65);
recipe.AddIngredient(ItemID.Feather, 80);
recipe.AddIngredient(ItemID.SunplateBlock, 310);
recipe.AddIngredient(ItemID.FragmentSolar, 95);
recipe.AddIngredient(ItemID.DemonWings);
recipe.AddIngredient(ItemID.AngelWings);
recipe.AddIngredient(ItemID.ButterflyWings);
recipe.AddIngredient(ItemID.FairyWings);
recipe.AddIngredient(ItemID.BeeWings);
recipe.AddIngredient(ItemID.HarpyWings);
recipe.AddIngredient(ItemID.BoneWings);
recipe.AddIngredient(ItemID.AngelWings);
recipe.AddIngredient(ItemID.FlameWings);
recipe.AddIngredient(ItemID.FrozenWings);
recipe.AddIngredient(ItemID.SteampunkWings);
recipe.AddIngredient(ItemID.LeafWings);
recipe.AddIngredient(ItemID.FishronWings);
recipe.AddIngredient(ItemID.MothronWings);
recipe.AddIngredient(ItemID.WingsSolar);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Add 'using Terraria;' before main code
 
Oh, well, I got another problem with making a sword projectile similar to the Terra beam.

I'll just put the code and error message here.

Projectiles/RuleBeam
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace OxysMod.Projectiles
{

public class RuleBeam : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "RuleBeam"; //projectile name
projectile.width = 20; //projectile width
projectile.height = 28; //projectile height
projectile.friendly = true; //make that the projectile will not damage you
projectile.melee = true; //
projectile.tileCollide = true; //make that the projectile will be destroed if it hits the terrain
projectile.penetrate = 15; //how many npc will penetrate
projectile.timeLeft = 200; //how many time this projectile has before disepire
projectile.light = 0.75f; // projectile light
projectile.extraUpdates = 1;
projectile.ignoreWater = false;
}
public override void AI() //this make that the projectile will face the corect way
{ // |
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
}
}
}

EDIT: I wont be surprised if I'm on here asking a lot of questions
 
Oh, well, I got another problem with making a sword projectile similar to the Terra beam.

I'll just put the code and error message here.

Projectiles/RuleBeam
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace OxysMod.Projectiles
{

public class RuleBeam : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "RuleBeam"; //projectile name
projectile.width = 20; //projectile width
projectile.height = 28; //projectile height
projectile.friendly = true; //make that the projectile will not damage you
projectile.melee = true; //
projectile.tileCollide = true; //make that the projectile will be destroed if it hits the terrain
projectile.penetrate = 15; //how many npc will penetrate
projectile.timeLeft = 200; //how many time this projectile has before disepire
projectile.light = 0.75f; // projectile light
projectile.extraUpdates = 1;
projectile.ignoreWater = false;
}
public override void AI() //this make that the projectile will face the corect way
{ // |
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
}
}
}

EDIT: I wont be surprised if I'm on here asking a lot of questions
What is the name of texture?
 
Back
Top Bottom