tModLoader

tModLoader

Particle Library
 This topic has been pinned, so it's probably important
✿snowy✿nibblz✿  [developer] May 28, 2023 @ 5:07am
[Bug Reports]
if you've encountered a bug, please post the details here.

- What happened?
>

- What were you doing when it happened?
>

- What mods were you using?
>

- Were you able to reproduce the bug?
>

- Crash log
>
< >
Showing 1-15 of 21 comments
Resaus Mar 9, 2023 @ 10:30pm 
crash log
my game crashes when i go into hardmode, i disabled the mod temporarily and that solved the problem, maybe it's an incompatibility with other mod.

[12:24:34.532] [Main Thread/ERROR] [Terraria]: System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.GetAlpha(Item item, Color lightColor) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1731
at Terraria.Item.GetAlpha(Color newColor) in tModLoader\Terraria\Item.cs:line 45856
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28964
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 316
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at TerrariaOverhaul.Core.Time.TimeSystem.OnDoDraw(orig_DoDraw orig, Main main, GameTime gameTime) in TerrariaOverhaul\Core\Time\TimeSystem.cs:line 70
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
[12:24:34.652] [Main Thread/FATAL] [tML]: Main engine crash


System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.GetAlpha(Item item, Color lightColor) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1731
at Terraria.Item.GetAlpha(Color newColor) in tModLoader\Terraria\Item.cs:line 45856
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28964
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 316
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at TerrariaOverhaul.Core.Time.TimeSystem.OnDoDraw(orig_DoDraw orig, Main main, GameTime gameTime) in TerrariaOverhaul\Core\Time\TimeSystem.cs:line 70
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562
at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 231
[12:24:34.658] [Main Thread/DEBUG] [TerrariaSteamClient]: Send: shutdown
✿snowy✿nibblz✿  [developer] Mar 10, 2023 @ 12:07pm 
it appears that this error is happening in conjunction with Terraria Overhaul.

I've tried to reproduce the error by entering hardmode with Terraria Overhaul installed, however I can't seem to reproduce the error described here. I'll continue looking into it further, but from a surface level glance I can't see anything inherently wrong with the code in Terraria Overhaul [github.com] or Particle Library [github.com]. if you happen to be able to reproduce this error yourself, let me know what mods were enabled and what you were doing at the time.

thank you for posting the error log though, it's immensely helpful in determining the root cause with issues like these.
Last edited by ✿snowy✿nibblz✿; Mar 10, 2023 @ 12:08pm
Resaus Mar 10, 2023 @ 9:11pm 
----------------------------------------------------A
alchemist npc lite
angler shop
auto reforge
autofish
----------------------------------------------------B
banner bonanza
base library
basic automated mining
better blending
better boss health bar
boss checklist
boss cursor
----------------------------------------------------C
calamity mod
calamity mod music
calamity's vanities
catalyst mod
census - town npc checklist
compare item stats
consolaria
container library
custom cursor library
----------------------------------------------------D
dialogue panel rework
----------------------------------------------------E
enemy radar redux
----------------------------------------------------F
fancy lighting
fargo's best of both worlds
fargo's mutant mod
faster ui
----------------------------------------------------H
heart crystal & life fruit glow
hook stats and wing stats
----------------------------------------------------I
imksushi's mod
impact library
----------------------------------------------------K
koko net lib
----------------------------------------------------L
lights and shadow
living world mod
loot beams
lui afk reborn
----------------------------------------------------M
magic storage
mod of redemption
----------------------------------------------------N
no more tombs
----------------------------------------------------P
particle library
portable storage
----------------------------------------------------Q
quality of life
----------------------------------------------------R
recipe browser
----------------------------------------------------S
secrets of the shadows
shoe slot
shop expander
shorter respawn time
smarter cursor
storm's aditions mod
structure helper
subworld library
----------------------------------------------------T
TWAILA
terraria overhaul
the stars above
thorium mod
----------------------------------------------------V
verdant
vitality mod
----------------------------------------------------W
weapon enchantments
which mod is this from?
wiki this
wing slot extra
world gen previewer
----------------------------------------------------

CPU and GPU: ryzen 5 4600g
16 gb ddr4 3200 mhz
Last edited by Resaus; Mar 10, 2023 @ 9:17pm
Asra Apr 8, 2023 @ 5:06pm 
I have also got a bug report. It looks like it is in cooperation with Gravity don't flip screen.

[01:55:03.670] [Main Thread/ERROR] [Terraria]: System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, Single& rotation, Single& scale, Int32 whoAmI) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1751
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28965
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 316
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at GravityDontFlipScreen.GravityFlipSystem.Main_DoDraw(orig_DoDraw orig, Main self, GameTime gameTime) in GravityDontFlipScreen\GravityFlipSystem.cs:line 116
at DMD<Terraria.Main::Draw>(Main this, GameTime gameTime)
[01:55:03.844] [Main Thread/FATAL] [tML]: Main engine crash
Last edited by Asra; Apr 8, 2023 @ 5:07pm
✿snowy✿nibblz✿  [developer] Apr 8, 2023 @ 8:12pm 
hi there! thank you for posting your bug report. Particle Library hooks into the draw methods as does Gravity Dont Flip Screen, however it appears that while the stacktrace contains the names of these mods, there does not seem to be anything inherently wrong with the code in either mod.

GravityFlipSystem.cs Line 116 [github.com]
ParticleManager.cs Line 326 [github.com]

with that in mind, the mods are most likely only in the stacktrace because their hooks are called before the original method where the error actually occurred, hence "stacktrace". the mods don't modify anything that would cause this error nor does the error occur within either mod. the error could be due to another mod's item having incorrect drawcode, but since the stacktrace doesn't reveal any more info, i'm afraid i can't say which.

if you want to try to reproduce the error, the best way would be to first figure out what you did that caused it to happen, then slowly disable mods until you've found the culprit.

thank you!
Asra Apr 9, 2023 @ 6:28pm 
Originally posted by ✿snowy✿nibblz✿:
hi there! thank you for posting your bug report. Particle Library hooks into the draw methods as does Gravity Dont Flip Screen, however it appears that while the stacktrace contains the names of these mods, there does not seem to be anything inherently wrong with the code in either mod.

GravityFlipSystem.cs Line 116 [github.com]
ParticleManager.cs Line 326 [github.com]

with that in mind, the mods are most likely only in the stacktrace because their hooks are called before the original method where the error actually occurred, hence "stacktrace". the mods don't modify anything that would cause this error nor does the error occur within either mod. the error could be due to another mod's item having incorrect drawcode, but since the stacktrace doesn't reveal any more info, i'm afraid i can't say which.

if you want to try to reproduce the error, the best way would be to first figure out what you did that caused it to happen, then slowly disable mods until you've found the culprit.

thank you!
Sorry, I was tired and forgot to mention that. I beat the Wall of Flesh, then after a few seconds, the game crashed. I was able to reproduce it without fail. Maybe it's the Fargo mod or mecha bosses rework. It worked before I installed those. Is there no way to get a better error report than the build in one?
✿snowy✿nibblz✿  [developer] Apr 9, 2023 @ 6:34pm 
Originally posted by Asra:
Sorry, I was tired and forgot to mention that. I beat the Wall of Flesh, then after a few seconds, the game crashed. I was able to reproduce it without fail. Maybe it's the Fargo mod or mecha bosses rework. It worked before I installed those. Is there no way to get a better error report than the build in one?

not to my knowledge, sorry. I don't know exactly why it doesn't show the culprit in the stacktrace, but if you were able to narrow it down it may be worth bringing it to the attention of those mod owners. they'll be able to figure out the issue since you were able to reproduce it.
Lord Foog The 2st Jun 12, 2023 @ 8:32am 
I'm also getting the bug where particle lib crashes tmodloader after removing any mod and reloading. Sometimes it shows literally nothing on its line in logs:

[16:29:44.921] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: JourneyTrend (Journey's Trend: The Community Vanity Mod) v1.0.2
[16:29:45.198] [.NET ThreadPool Worker/INFO] [JourneyTrend]: JourneyTrend Logs:
[16:29:45.351] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: LansUnlimitedBuffSlots (Lan's Unlimited Buff Slots) v2022.9.1
[16:29:45.428] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: LootBeams (Loot Beams) v1.7.3.1
[16:29:45.524] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: MountAndJourney (Mount and Journey) v0.70

^ is where particle lib should appear

Then other times:

[16:23:47.723] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: ParticleLibrary ([c/9ebae2:Pa][c/dafaf4:rtic][c/9ebae2:le][c/e8a272:Li][c/fad3a0:bra][c/e8a272:ry]) v1.1.4.2
[16:23:47.777] [.NET ThreadPool Worker/DEBUG] [tML]: Hook On.Terraria.Main::DrawDust() added by ParticleLibrary

it always hard crashes around this point. Sometimes it manages to pull through but that's around 1 out of 10 attempts? I haven't been able to find any notable reason for this.
✿snowy✿nibblz✿  [developer] Jun 12, 2023 @ 4:51pm 
Originally posted by Lord Foog The 2st:
I'm also getting the bug where particle lib crashes tmodloader after removing any mod and reloading. Sometimes it shows literally nothing on its line in logs:

[16:29:44.921] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: JourneyTrend (Journey's Trend: The Community Vanity Mod) v1.0.2
[16:29:45.198] [.NET ThreadPool Worker/INFO] [JourneyTrend]: JourneyTrend Logs:
[16:29:45.351] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: LansUnlimitedBuffSlots (Lan's Unlimited Buff Slots) v2022.9.1
[16:29:45.428] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: LootBeams (Loot Beams) v1.7.3.1
[16:29:45.524] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: MountAndJourney (Mount and Journey) v0.70

^ is where particle lib should appear

Then other times:

[16:23:47.723] [.NET ThreadPool Worker/INFO] [tML]: Adding Content: ParticleLibrary ([c/9ebae2:Pa][c/dafaf4:rtic][c/9ebae2:le][c/e8a272:Li][c/fad3a0:bra][c/e8a272:ry]) v1.1.4.2
[16:23:47.777] [.NET ThreadPool Worker/DEBUG] [tML]: Hook On.Terraria.Main::DrawDust() added by ParticleLibrary

it always hard crashes around this point. Sometimes it manages to pull through but that's around 1 out of 10 attempts? I haven't been able to find any notable reason for this.

im currently looking into it but so far i've had no luck reproducing the error. i fixed some of the static references leftover from mod reloading, can you test these changes to see if you encounter the same error?
StrangerDanger Jun 13, 2023 @ 5:52pm 
Found this discussion and found I had a similar issue, but it occurs after defeating plantera. I've been able to reproduce this twice:

[00:32:12.536] [Main Thread/ERROR] [Terraria]: System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, Single& rotation, Single& scale, Int32 whoAmI) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1751
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28965
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 328
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
[00:32:12.614] [Main Thread/FATAL] [tML]: Main engine crash

Tip: This is likely a mod's fault. Disable mods one by one and check if the issue persists

System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, Single& rotation, Single& scale, Int32 whoAmI) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1751
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28965
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 328
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562
at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 231
[00:32:12.620] [Main Thread/DEBUG] [TerrariaSteamClient]: Send: shutdown
✿snowy✿nibblz✿  [developer] Jun 14, 2023 @ 5:05am 
Originally posted by StrangerDanger:
Found this discussion and found I had a similar issue, but it occurs after defeating plantera. I've been able to reproduce this twice:

[00:32:12.536] [Main Thread/ERROR] [Terraria]: System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, Single& rotation, Single& scale, Int32 whoAmI) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1751
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28965
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 328
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
[00:32:12.614] [Main Thread/FATAL] [tML]: Main engine crash

Tip: This is likely a mod's fault. Disable mods one by one and check if the issue persists

System.NullReferenceException: Object reference not set to an instance of an object.
at Terraria.ModLoader.ItemLoader.PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, Single& rotation, Single& scale, Int32 whoAmI) in tModLoader\Terraria\ModLoader\ItemLoader.cs:line 1751
at Terraria.Main.DrawItem(Item item, Int32 whoami) in tModLoader\Terraria\Main.cs:line 28965
at DMD<Terraria.Main::DrawItems>(Main this)
at ParticleLibrary.ParticleManager.DrawParticlesBeforeItems(orig_DrawItems orig, Main self) in ParticleLibrary\ParticleSystem\ParticleManager.cs:line 328
at DMD<Terraria.Main::DoDraw>(Main this, GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 48723
at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562
at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 231
[00:32:12.620] [Main Thread/DEBUG] [TerrariaSteamClient]: Send: shutdown


hi there! we've addressed something similar to this above. while the stacktrace might list ParticleLibrary, this is only because ParticleLibrary hooks into the drawing methods to do its rendering. it doesn't perform any code that would cause an error like this to occur in ItemLoader.PreDrawInWorld. usually this is due to a mod adding an item and not handling its draw code defensively.

if you would like, you can try disabling mods one by one to find which mod is crashing your game upon killing Plantera. since this isn't the first occurrence of this issue mentioned here, do you happen to have Fargo's Mod?
StrangerDanger Jun 15, 2023 @ 12:53am 
Hello, yeah I do have Fargo's Mutant mod installed, along side best of both worlds, and banner boost. I might try disabling mods one by one later.
YewTree Aug 8, 2023 @ 5:18pm 
When I use the mod I am unable to place certain furniture and unable to place pylons
✿snowy✿nibblz✿  [developer] Aug 8, 2023 @ 5:41pm 
Originally posted by YewTree:
When I use the mod I am unable to place certain furniture and unable to place pylons

what mods are you using? ParticleLibrary shouldn't affect placing tiles
Mister Sanguis Dec 3, 2024 @ 10:45am 
After updating the mod, upon entering any world with any character I see white particles radiating from my characters head with no way to stop it from happening. I guess that's a bug...

UPD: upon generating new world too...
Last edited by Mister Sanguis; Dec 3, 2024 @ 10:45am
< >
Showing 1-15 of 21 comments
Per page: 1530 50