Nakano15
Terrarian
I've found out what caused that problem, at the end of the PostDrawInterface, I had to add spriteBatch.End(), and then the error stopped happening and the hud is being drawn as intended.Hey guys, I've found a problem.
Trying to call drawing on spritebatch at PostDrawInterface causes the game to crash showing a window with this error:
The issue surged after I updated tModLoader, and I've tried disabling the scripts in the mod that calls drawing on PostDrawInterface to see if the issue happened, and didn't, I could even play the game, when I enabled the scripts again the modloader crashes.Code:8/23/2018 4:54:15 AM System.InvalidOperationException: Begin cannot be called again until End has been successfully called. at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) at Terraria.Main.RenderBlack() at Terraria.Main.RenderTiles() at Terraria.Main.do_Draw(GameTime gameTime) at Terraria.Main.DoDraw(GameTime gameTime) at Terraria.Main.Draw(GameTime gameTime) at Microsoft.Xna.Framework.Game.DrawFrame() at Microsoft.Xna.Framework.Game.Tick() at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e) at Microsoft.Xna.Framework.GameHost.OnIdle() at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame() at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e) at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at Microsoft.Xna.Framework.WindowsGameHost.Run() at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun) at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
I'd like to thank the support team for all the help they provided me to fix this and other issues with this mod loader, since I know I can count on them to find the solution to a problem.
Edit:. Heh, I've noticed that the cursor disappears when you uses spriteBatch.End(), so it's either have no cursor or don't use PostDrawInterface at all.
Last edited:
I'm trying to make my sword create dust when swung, and i'm getting this error when trying to build it.
error CS0246: The type or namespace name 'Player could not be found (are you missing a using directive or an assembly reference?)
here's all the code of the item: https://pastebin.com/QspyurQk
error CS0246: The type or namespace name 'Player could not be found (are you missing a using directive or an assembly reference?)
here's all the code of the item: https://pastebin.com/QspyurQk
Nakano15
Terrarian
You forgot "using Terraria;" at the top of the file.I'm trying to make my sword create dust when swung, and i'm getting this error when trying to build it.
error CS0246: The type or namespace name 'Player could not be found (are you missing a using directive or an assembly reference?)
here's all the code of the item: https://pastebin.com/QspyurQk
You forgot "using Terraria;" at the top of the file.
I added that in and now it says "The type or namespace name 'Player could not be found (are you missing a using directive or an assembly reference?)"
I would enjoy if you were to make a easy way to switch Tmodloader on and off my friends want to play on a vanilla server and I want to play on canilla and modded however it is a large effort to install and uninstall Tmodloader, especially because i don't know how to save my modded worlds / characters. Also i do understand that there is a way to do this already but all I can find are posts on the forums and can't find any videos, also the instructions on how to do this on the forums are complicated and I don't understand.
Thank you for your time,
Wyhiob
Thank you for your time,
Wyhiob
ArrowOfPeace
Spazmatism
I would enjoy if you were to make a easy way to switch Tmodloader on and off my friends want to play on a vanilla server and I want to play on canilla and modded however it is a large effort to install and uninstall Tmodloader, especially because i don't know how to save my modded worlds / characters. Also i do understand that there is a way to do this already but all I can find are posts on the forums and can't find any videos, also the instructions on how to do this on the forums are complicated and I don't understand.
Thank you for your time,
Wyhiob
You can just when you install tmodloader rename the terraria (the tmodloader one) file to "tmodloader" or "modded" and then just install it manually... makes it possible to play vanilla AND modded
With kind regards,
A helpfull Archer
ssj3gogeta
Terrarian
so somehow the memory problem i have been having magically fixed it self i don't know how though
[doublepost=1535314069,1535313900][/doublepost]and i jinxed my self again
[doublepost=1535314069,1535313900][/doublepost]and i jinxed my self again
GuiseppeXOXO
Terrarian
helo I have downloaded the exemple mod to try to create a biom but when I create a world with it no new biom in the map so can you help me
Hiya! I'm trying to make a mod that checks when a boss in CalamityMod has been downed. How would I go about this? I understand how to check vanilla bosses (NPC.downedX) but that isn't working. I know how to create a Mod object but that doesn't seem to be helping much.
GuiseppeXOXO
Terrarian
do you know ho to create a biom
Zwip-Zwap Zapony
Terrarian
Is this an appropriate place to ask for help regarding tModLoader modding? If so... I'm trying to create my first "actual" mod, but I'm running into trouble. I want to make a function(?) and use it in several different classes(?), but from what I can tell, tModLoader and/or C# doesn't like how I'm trying to do that. I only have one .cs file in the mod, which basically looks like this:
Of course, I would expand the CalculateRegen function(?) a lot if I can get this to work, but for now, I can't seem to get it to work despite my best efforts (which does include moving the CalculateRegen() function(?) into a class, which didn't work so well for me). If anyone can tell me exactly what I have to do to get this to hopefully work, that would be appreciated.
Code:
using Terraria;
using Terraria.ModLoader;
namespace RegenFromBosses
{
public class RegenFromBosses : Mod
{
public RegenFromBosses()
{
}
public int lifeRegenFromBosses=0; //How much life is regenerated per second from slain bosses - Half of this is regenerated per second
}
class RegenFromBosses_World : ModWorld
{
public override void Initialize()
{
CalculateRegen();
Main.NewText("New HP/S: " + (lifeRegenFromBosses/2));
}
}
class RegenFromBosses_Player : ModPlayer
{
public override void UpdateLifeRegen()
{
player.lifeRegen += lifeRegenFromBosses;
}
}
class RegenFromBosses_NPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
CalculateRegen();
Main.NewText("New HP/S: " + (lifeRegenFromBosses/2));
}
}
public void CalculateRegen()
{
lifeRegenFromBosses+=2;
}
}
The proper place for questions is the discord chat: discord.me/tModLoaderIs this an appropriate place to ask for help regarding tModLoader modding? If so... I'm trying to create my first "actual" mod, but I'm running into trouble. I want to make a function(?) and use it in several different classes(?), but from what I can tell, tModLoader and/or C# doesn't like how I'm trying to do that. I only have one .cs file in the mod, which basically looks like this:
Of course, I would expand the CalculateRegen function(?) a lot if I can get this to work, but for now, I can't seem to get it to work despite my best efforts (which does include moving the CalculateRegen() function(?) into a class, which didn't work so well for me). If anyone can tell me exactly what I have to do to get this to hopefully work, that would be appreciated.Code:using Terraria; using Terraria.ModLoader; namespace RegenFromBosses { public class RegenFromBosses : Mod { public RegenFromBosses() { } public int lifeRegenFromBosses=0; //How much life is regenerated per second from slain bosses - Half of this is regenerated per second } class RegenFromBosses_World : ModWorld { public override void Initialize() { CalculateRegen(); Main.NewText("New HP/S: " + (lifeRegenFromBosses/2)); } } class RegenFromBosses_Player : ModPlayer { public override void UpdateLifeRegen() { player.lifeRegen += lifeRegenFromBosses; } } class RegenFromBosses_NPC : GlobalNPC { public override void NPCLoot(NPC npc) { CalculateRegen(); Main.NewText("New HP/S: " + (lifeRegenFromBosses/2)); } } public void CalculateRegen() { lifeRegenFromBosses+=2; } }
Bruspo
Terrarian
I don't know, i've been trying to download it for days, but it starts and then cancels after 0.6 MB or remains at 0.1 Mb forever without explanation...
Windows 7 64 bit with chrome btw
Windows 7 64 bit with chrome btw
Maxwele1435
Spazmatism
When i was trying to host a modded world it was stuck on "starting server". Is there anyway to fix this?
Sasha Drakovi
Steampunker
Is anyone else having a problem updating mods like thorium? I keep getting a bandwidth bug. >.> but its been persistant over the last few days so i was wondering if it was just me or not...
DraganLevaunt
Terrarian
So.. any mod I have crashes my game its kind annoying, It might be the amount of mods I ahve but I really dont have much
DraganLevaunt
Terrarian
Where is post draw interface? I have the same issue but cant find it in doccuments or the terraria files, so I can fix this issueI've found out what caused that problem, at the end of the PostDrawInterface, I had to add spriteBatch.End(), and then the error stopped happening and the hud is being drawn as intended.
I'd like to thank the support team for all the help they provided me to fix this and other issues with this mod loader, since I know I can count on them to find the solution to a problem.
Edit:. Heh, I've noticed that the cursor disappears when you uses spriteBatch.End(), so it's either have no cursor or don't use PostDrawInterface at all.
Shadicus
Terrarian
So I'm doing something stupid, I just started modding and I'm already starting to try to set up a mod containing multiple draconic pets and mounts. However fairly early on I seem to have done something wrong, as I'm already being hit with "Error CS0117: Terraria.Main does not contain a definition for Buffname", any chance this has happened to others who can give a bit of advice there? ...I can find my code if necessary but it's admittedly rather basic...
Edit: By just started modding, I mean I completed a basic tutorial with the whole "Tutorial sword" thing yesterday. I have no experience with code or sprite art, but, thought that counts?
Edit: By just started modding, I mean I completed a basic tutorial with the whole "Tutorial sword" thing yesterday. I have no experience with code or sprite art, but, thought that counts?
brandowill
Terrarian
im playing on linux and tmodloader does not work . is it going to work on the next tmodloader update?
Similar threads
- Replies
- 40
- Views
- 23K
- Replies
- 5
- Views
- 1K
- Replies
- 893
- Views
- 891K
- Replies
- 0
- Views
- 482
- Sticky
- Replies
- 270
- Views
- 264K
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.