Standalone [1.3] tModLoader - A Modding API

I posted awhile ago and I've seemed to figure out a few things, but something's missing. I'm currently trying to rotate my sword by 45 degrees when it's held out like a gun, as it will shoot with right click and swing with left click. I tried to custom draw it in PreDrawInWorld, but it seems to draw the same no matter what, even if I turn it to false. Here's my code:

Code:
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
        {
            if (item.useStyle == 5)
            {
                rotation = (float) Math.PI/4;
            } else
            {
                rotation = 0;
            }
            spriteBatch.Draw(mod.GetTexture("HallowedGunblade"), Main.player[whoAmI].position, null, default(Color), rotation, new Vector2(32, 31), 0, SpriteEffects.None, 0f);
            return false;
        }

Anybody have an idea?
 
well, what was the error?

c:\Users\Alumno\Documents\My Games\Terraria\ModLoader\Mod Sources\Awesomium Weapons 2.0\Awesomium Weapons 2.0.cs(8,18) : error CS1002: was expected ;


thats the error

fricking error wont let me try my mod!!!

also since i made the weapons and im planning putting more weapons in the mod sooner
i just want to try the mod that im making in development!!
 
Last edited:
c:\Users\Alumno\Documents\My Games\Terraria\ModLoader\Mod Sources\Awesomium Weapons 2.0\Awesomium Weapons 2.0.cs(8,18) : error CS1002: was expected ;


thats the error

fricking error wont let me try my mod!!!

also since i made the weapons and im planning putting more weapons in the mod sooner
i just want to try the mod that im making in development!!
That could be anything, but basically your syntax is wrong. You can learn the syntax or use an IDE like Visual Studio and it'll point out incorrect syntax for you. Without the code I couldn't guess. That (8, 18) points to the line and character it is complaining about.
 
I need some help with a tile I'm trying to make.
It's a 3x2 tile, and I have the following to make sure it drops the item when destroyed.
Code:
drop = mod.ItemType("Forge");
However, it drops 6 of them. How do I fix that?

Also, how do I make it produce light similar to the vanilla furnace?
 
I need some help with a tile I'm trying to make.
It's a 3x2 tile, and I have the following to make sure it drops the item when destroyed.
Code:
drop = mod.ItemType("Forge");
However, it drops 6 of them. How do I fix that?

Also, how do I make it produce light similar to the vanilla furnace?
Check the hooks you're able to use. Instead of using drop (which works for 1x1 tiles only), use KillMultiTile.
 
That could be anything, but basically your syntax is wrong. You can learn the syntax or use an IDE like Visual Studio and it'll point out incorrect syntax for you. Without the code I couldn't guess. That (8, 18) points to the line and character it is complaining about.


where's that syntax to fix it?
 
i cant load mods with custom music in tmodloader v10.0.2 i get this message
The mp3 sound file at Sounds/Music/CaveStoryBossBattle.mp3 failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Ensure that the specified stream contains valid PCM mono or stereo wave data.
at Microsoft.Xna.Framework.Audio.WavFile..ctor(Stream source)
at Microsoft.Xna.Framework.Audio.WavFile.Open(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
at Terraria.ModLoader.Mod.Autoload()
 
i cant load mods with custom music in tmodloader v10.0.2 i get this message
The mp3 sound file at Sounds/Music/CaveStoryBossBattle.mp3 failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Ensure that the specified stream contains valid PCM mono or stereo wave data.
at Microsoft.Xna.Framework.Audio.WavFile..ctor(Stream source)
at Microsoft.Xna.Framework.Audio.WavFile.Open(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect..ctor(Stream stream)
at Microsoft.Xna.Framework.Audio.SoundEffect.FromStream(Stream stream)
at Terraria.ModLoader.Mod.Autoload()
The custom music is currently very broken, so stay away from mods, it's kinda annoying that you can't play lot of mods currently cause the custom music is broken and 70% of the time doesn't load, and it gives this error.
 
someone know how does can i make a item get dropped by some mob
Is the mob you're referring to a vanilla NPC or a custom made NPC?
In both cases you will want to use the NPCLoot method. For a vanilla NPC you'll want a GlobalNPC class. For a custom NPC, just implement the NPCLoot method in the NPCs' class.
 
Object reference not set to an instance of an object.
at EnemyMods.NPCs.gNPC.SetDefaults(NPC npc) in C:\Users\Kenneth\Documents\My Games\Terraria/ModLoader\Mod Sources\EnemyMods\NPCs\gNPC.cs:line 70
at Terraria.ModLoader.NPCLoader.SetDefaults(NPC npc, Boolean createModNPC)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Some of my mods keep automatically disabling but the thing that keeps confusing me is that there is no Kenneth user on this computer. What do I do?
 
Any news on when the custom sound will be fixed, it seems to be a very inconsistent issue with certain mods. (Calamity,Tremor,ect)
I will upload a screen shot of my game with only one mod installed to avoid any conflicts with other mods. Don't know if this just a bug with 10.2 but would love to hear some feedback. Thx.
 

Attachments

  • Error.png
    Error.png
    338.2 KB · Views: 173
Any news on when the custom sound will be fixed, it seems to be a very inconsistent issue with certain mods. (Calamity,Tremor,ect)
I will upload a screen shot of my game with only one mod installed to avoid any conflicts with other mods. Don't know if this just a bug with 10.2 but would love to hear some feedback. Thx.
Yea I would quite like that they would fix this or show a way to fix this it's the most annoying bug ever
 
Back
Top Bottom