Standalone [1.3] tModLoader - A Modding API

Discussion in 'Works-in-Progress' started by blushiemagic, Jul 7, 2015.

  1. Miristdasschnuppe

    Miristdasschnuppe Terrarian

    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()
     
    Last edited: Jul 28, 2017
  2. heresyandtreachery

    heresyandtreachery Official Terrarian

    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
     
  3. Saobie

    Saobie Terrarian

    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
     
  4. Callum Johnson

    Callum Johnson Terrarian

    When will tmodloader be out for version 1.3.5.3??
     
  5. jopojelly

    jopojelly Retinazer

    That is not needed at all, and for all intents and purposes it already is.
     
  6. Jofairden

    Jofairden Golem

    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.
     
  7. Callum Johnson

    Callum Johnson Terrarian

    Yeah but i cant play with people that dont have tmodloader.
     
  8. Jofairden

    Jofairden Golem

    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;
                    }
                }
            }
        }
     
  9. Jofairden

    Jofairden Golem

    And you will never. If you want to play with them they should either get tModLoader or you should revert to vanilla.
     
  10. Ronon Omega

    Ronon Omega Terrarian

    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
     
  11. Callum Johnson

    Callum Johnson Terrarian

    why will i never be able to?
     
  12. jopojelly

    jopojelly Retinazer

    We haven't programmed tmodloader to allow connecting to vanilla servers. That would just crash things.
     
  13. Callum Johnson

    Callum Johnson Terrarian

    ahhh ok i didnt know that but thanks for your help
     
  14. alexzhang05

    alexzhang05 Terrarian

    My mod browser is broken for some reason...
    It justs says Mod Browser Offline (UNKNOWN)
     
  15. SlippyCheeze

    SlippyCheeze 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.
     
  16. alexzhang05

    alexzhang05 Terrarian

    Ahhh I am currently in China so the website must be blocked here... Thanks!
     
  17. rikd1977

    rikd1977 Terrarian

    Anyone know how to make can run in Windows 10 visual studio 2017? Can't find any posts that actually work??
    --- Double Post Merged, Jul 29, 2017, Original Post Date: Jul 29, 2017 ---
    Xna not can
    --- Double Post Merged, Jul 29, 2017 ---
    I got some code working with that monogame ###$#$$$ but?? XNA would be so much easier
     
  18. SlippyCheeze

    SlippyCheeze Terrarian

    https://github.com/blushiemagic/tModLoader/wiki/Developing-with-Visual-Studio
     
    Jofairden likes this.
  19. Saobie

    Saobie Terrarian

    Im developing a spell tome for my mod and am just curious how i make it cost hp to cast AS WELL as mp?
     
  20. Linx145

    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.