• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone [1.3] tModLoader - A Modding API

Jofairden

Golem
I got this too. I was making my own mod at the time so i ignored it and was going to deal with it later. Guess a redownload wouldnt have fixed it huh
So im not the only one with this problem...
seems like all the big mods seem to fail at random places like sound or images
The mp3 of the big mods like Calamity, Tremor, Thorium and Spirit are not loading so I am not able to play them. Please tell me how to fix this issue.


The mp3 sound file at Sounds/Music/CaveStoryBossBattle.mp3 failed to load
bei Terraria.ModLoader.Mod.Autoload()
bei Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Ensure that the specified stream contains valid PCM mono or stereo wave data.
bei Microsoft.Xna.Framework.Audio.WavFile..ctor(Stream source)
bei Microsoft.Xna.Framework.Audio.WavFile.Open(Stream stream)
bei Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
bei Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
bei Terraria.ModLoader.Mod.Autoload()
Set the mods you want enabled/disabled, don't click reload but restart the game instead. Hopefully this issue is resolved in the next release.
 

Jofairden

Golem
Anyone know how to change vanilla tooltips now?
I was useing
Code:
public class ModedItem : GlobalItem{
public override void SetDefaults(Item item){
            switch(item.type)
            {
                case ItemID.DaedalusStormbow:
                    item.UseSound = null;
                    return;
                case ItemID.Grenade:
                case ItemID.StickyGrenade:
                case ItemID.BouncyGrenade:
                case ItemID.Beenade:
                case ItemID.PartyGirlGrenade:
                    item.ammo = 168;
                    return;
                case ItemID.UmbrellaHat:
                    item.vanity = false;
                    item.toolTip = "Slow falling speed";
                    item.defense = 1;
                    return;
}}}
But this just results in failure to compile
it tried
Code:
public override void SetStaticDefaults(Item item){
        switch(item.type)
            {
            case ItemID.UmbrellaHat
            //DisplayName.SetDefault("xxx");
            Tooltip.SetDefault("Slow falling speed");
            return;
            }
        }
But no dice

Can anyone help with this it would be much appreciated
Try using the ModifyTooltips() hook for this, it's intended for this stuff.
Code:
    public class MyGlobalItem : GlobalItem
    {
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            TooltipLine line = tooltips.FirstOrDefault(tooltip => // FirstOrDefault means we will get this tooltip line, or it will be null if it can't be found
                tooltip.mod == "Terraria" // Checks if the line comes from vanilla Terraria
                && tooltip.Name == "Tooltip0"); // Checks if the line is the tooltip line, first line

            if (line != null) // if the line is not null, it means we found it
            {
                switch (item.type) // switch on our item type
                {
                    case ItemID.UmbrellaHat:
                        line.text = "Slow falling speed"; // Set the line to something new
                        return;
                }
            }
        }
    }
 

Ronon Omega

Terrarian
Try using the ModifyTooltips() hook for this, it's intended for this stuff.
Code:
    public class MyGlobalItem : GlobalItem
    {
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            TooltipLine line = tooltips.FirstOrDefault(tooltip => // FirstOrDefault means we will get this tooltip line, or it will be null if it can't be found
                tooltip.mod == "Terraria" // Checks if the line comes from vanilla Terraria
                && tooltip.Name == "Tooltip0"); // Checks if the line is the tooltip line, first line

            if (line != null) // if the line is not null, it means we found it
            {
                switch (item.type) // switch on our item type
                {
                    case ItemID.UmbrellaHat:
                        line.text = "Slow falling speed"; // Set the line to something new
                        return;
                }
            }
        }
    }
Thanks for responding, Im a c# noob unfortunately..
Im getting a missing namespace or assembly reference now

Code:
\ModedItem.cs(27,56) : error CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
c script
Code:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.Localization;

namespace mymod
{
    public class ModedItem : GlobalItem
    {
        public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
        {
            TooltipLine line = tooltips.FirstOrDefault(tooltip => // FirstOrDefault means we will get this tooltip line, or it will be null if it can't be found
                tooltip.mod == "Terraria" // Checks if the line comes from vanilla Terraria
                && tooltip.Name == "Tooltip0"); // Checks if the line is the tooltip line, first line

            if (line != null) // if the line is not null, it means we found it
            {
                switch (item.type) // switch on our item type
                {
                    case ItemID.UmbrellaHat:
                        line.text = "Slow falling speed"; // Set the line to something new
                        return;
                }
            }
        }
I deleted some clutter from there but 27,56 was the first mention of List<>

Thankyou very much for your time, sorry for noob questions
 

SlippyCheeze

Terrarian
My mod browser is broken for some reason...
It justs says Mod Browser Offline (UNKNOWN)
It is highly likely something is blocking the website that it needs to fetch data from. Try visiting the "manual browsing" link in the first post in your web browser, and see if you can figure out what.
 

alexzhang05

Terrarian
It is highly likely something is blocking the website that it needs to fetch data from. Try visiting the "manual browsing" link in the first post in your web browser, and see if you can figure out what.
Ahhh I am currently in China so the website must be blocked here... Thanks!
 

rikd1977

Terrarian
Anyone know how to make can run in Windows 10 visual studio 2017? Can't find any posts that actually work??
[doublepost=1501297811,1501297774][/doublepost]Xna not can
[doublepost=1501297935][/doublepost]I got some code working with that monogame ###$#$$$ but?? XNA would be so much easier
 

Linx145

Terrarian
Um, whatever happened to item.name? I can't find it anywhere in ExampleMod anymore. Is it still relevant? Because I still need access to naming items differently from the item file's name.
 

Saobie

Terrarian
Is it possible to get projectiles to use more than 1 AI style?

I want my projectile to behave similarly to razorblade typhoon, but also bounce off surfaces and get faster as they travel
 

Saobie

Terrarian
For the life of me i cannot get my boss to spawn custom entities and shoot projectiles. I also cant get said entities to shoot projectiles

Im aiming for the boss to constantly spawn entities every few seconds

Anyone able to teach me how to do this?
 

Linx145

Terrarian
It's possible to get bosses to shoot projectiles and spawn enemies. Heres how:
Spawning enemies:

Code:
int timer = 60;//Initialise a timer for the boss to spawn NPCS. '60'
//means 60 frames, or one second.
if (timer <= 0 && Main.netMode != 1) //If my timer is 0 and not
//loading server(I think Netmode 1 is that anyways, sorry not
//good with Multiplayer friendly modding)
{
Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); //Declare pawn position. This spawns NPC at the exact center of
//the boss sprite.
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, <Insert Npc Type/ID here>); //Spawn an NPC at spawnAt, or the center pos of boss.
timer = 60;//Reset the timer
} else timer--; //If not, minus the timer by 1 every frame,
//leading to an effective and working code that spawns one
//enemy every second.
Shooting projectiles(Extracted from the insanely old Tconfig Wiki.):
Code:
int timer2 = <Insert timer2's start value here>;
if (timer2 <= 0) //Please add another timer for projectile, if you don't want ur game to eventually explode
{
float Speed = 30f; //Speed of which projectile is fired. For all values that are 'floats', put an f after the value.
int damage = 36; //damage of the projectile
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); //Find the center position of the NPC
int type = <Insert projectile type or ID here>;
float KB = 0f; //Knockback. 0f means no knockback for projectile. I think theres a maximum knockback amount but idk
float rotation = (float) Math.Atan2(vector8.Y-(Main.player[npc.target].position.Y+(Main.player[npc.target].height *  0.5f)), vector8.X-(Main.player[npc.target].position.X+(Main.player[npc.target].width * 0.5f))); //You don't really need to know about this, just, it works.
Projectile.NewProjectile(vector8.X, vector8.Y,(float)((Math.Cos(rotation) * Speed)*-1),(float)((Math.Sin(rotation) *  Speed)*-1), type, damage, KB, 0); //Finally shoot a projectile
timer2 = <Insert timer2's start value here>; //Reset timer2
}
else timer2--;
These two ain't limited to timer based. I just added a timer to explain. You could, say, make the boss spawn an NPC or shoot a projectile when it hits 50% life too.
sorry if my explanation isn't clear. I need to buck up on explanation skills
 
Top Bottom