Don't Starve Together

Don't Starve Together

Flaire The Spellblade (DST!)
Fairy  [developer] 24 Dec, 2023 @ 7:47pm
Surprise! (Version 2.0.0)
I bring you a little something for the holidays! As a side project, I've taken the time this month to completely rewrite Flaire from scratch. The mod, while functional, was made when I had much less programming experience, so maintaining it for anything more complex has been slightly troublesome. Hopefully, this should help make it easier if changes need to be made or Klei posts another update!

But of course, it's not just the background code that's changed-- here's a list of changes that you might find interesting;

  • Complete internal rewrite of the mod!
  • All the features you remember
  • Better maintainability
  • Better mod compatibility
  • Better compression of sound files, and slighty lighter file size overall
  • Flaire's voice now properly loops through all clips, preventing the same sound from playing twice!
  • Flaire's angry face sprite has been changed.
  • Things are (likely) slightly more performant
  • Strings are properly separated, making possible translations easier
  • Flaire now has generic description quotes for when a specific quote is missing.
  • Tail sprites are now animated in the casting animation, for when you're wearing a skin that has it!
  • Flaire finally saves and loads for rerolls properly; meaning you will no longer lose your spells upon getting cursed (Wonkey).
  • A new hotkey in the config for spell examining.
  • Custom sounds (seem to) always play now when playing in host mode (without caves).
  • A whole list of...

Gameplay changes:
  • Boss monsters have a 10% extra spell drop chance.
  • If multiple enemies get hit by Manaburst, they now all have a chance to drop a spell upon dying.
  • Visual effects will now play when you gain or lose an aspect!
  • Flaire now announces when she gets hit by lightning for more damage whilst under water aspect.
  • Gleam's light radius now grows by 50% when under the effect of Lightning Aspect, and its mana drain rate is reduced by 50% as well.
  • Guard now drains its durability before equipment armour. This means it should take the same amount of damage from attacks, whether you're wearing armour or not.
  • In accordance with Guard's change, it now has 200 (compared to 40) durability!
  • Spell buffs could previously be casted on creatures, but they would lose it upon server restart. Now, they keep it between sessions like players do!
  • "Supportively" casting spells is now referred to as "Chain" casting spells!
  • Chain-casting spells should feel a lot more snappy compared to the previous version. If it says you can do it, you should be able to 100% of the time now!
  • Chain-casting is no longer just limited to other players, and can be performed with creatures now as well; up to 6 times per window.
  • A visual effect will now play when a chain-spell window ends!
  • Manaburst can now also be chain casted; only once after casting it normally.
  • The chain-cast effect will have a slightly more subtle appearance when under the effect of Manaburst's damage boost.
  • Manaburst's damage boost is now also refreshed by casting any of the other spells while it's still active (with a sword, of course!)
  • Manaburst's damage boost now also grants a flat 8 bonus damage each hit.
  • Mana regeneration from sleeping now varies based on what item/structure the player uses to sleep (ranging from 0.25 to 1 per second).
  • Casting spells now only consumes one use of the weapon, rather than 1% of the total durability.
  • Flaire's spell mastery bonus has been changed; Sword weapons now lose 50% less durability when attacking or spell-casting with it active.
  • Flaire no longer loses hunger from eating foods with negative hunger values, and instead loses 5 mana each time she eats such a food.

* Some features have slight differences from the previous version. For example, heal's buff increases healing by 1.75x instead of 1.8x, and the spell mastery bonus regarding the Dark Sword's sanity drain was replaced.



Finally, I've added Flaire's first skin! It's based on the vanilla game's Shadow Collection (The Triumphant), and it even has a unique unlock requirement! Make sure you subscribe to Modded Skins API to be able to use it-- though, it is of course not required to play Flaire without any skins.

While the code is structurally much improved over the previous version, it is of course still "new" and there may be some bugs or crashes I missed. If you find any, let me know!
Last edited by Fairy; 26 Dec, 2023 @ 12:45pm
< >
Showing 1-6 of 6 comments
Luneyl 11 Jan, 2024 @ 3:02pm 
Bug report: game crashes (server) when hitting a Snap-Trap[uncompromising-mode.fandom.com] from Uncompromising Mode with Manaburst

[02:42:13]: [workshop-2189004162 (Insight)]: Text: [string "../mods/workshop-2496686961/scripts/utility..."]:105: attempt to index field 'combat' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-2496686961/scripts/utility/spells/manaburst.lua:105 in (upvalue) DealAreaDamage (Lua) <81-108>
../mods/workshop-2496686961/scripts/utility/spells/manaburst.lua:182 in (method) Execute (Lua) <128-188>
../mods/workshop-2496686961/scripts/components/weaponcaster.lua:36 in (method) CastSpell (Lua) <7-55>
../mods/workshop-2496686961/scripts/utility/modmain/stategraphs.lua:110 in (field) fn (Lua) <95-111>
scripts/stategraph.lua:653 in (method) UpdateState (Lua) <621-665>
scripts/stategraph.lua:691 in (upvalue) old_update (Lua) <684-710>
../mods/workshop-1837053004/modmain/timemagic.lua:44 in (upvalue) old_Update (Lua) <43-59>
../mods/workshop-1837053004/modmain/snowpea.lua:99 in (method) Update (Lua) <94-107>
scripts/stategraph.lua:128 in (method) Update (Lua) <109-146>
scripts/update.lua:288 in () ? (Lua) <224-298>
Last edited by Luneyl; 11 Jan, 2024 @ 3:23pm
Luneyl 11 Jan, 2024 @ 3:12pm 
Another bug report: sometimes clients that are not Flare crash (only their client, not server) because they somehow spawn invisible gleamsprite, teleporting to it using c_gonext("gleamsprtie") and deleting it with c_select():Remove() makes them able to join back without this crash

[00:01:44]: [string "../mods/workshop-2496686961/scripts/prefabs..."]:48: attempt to index a nil value
LUA ERROR stack traceback:
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:48 in (local) fn (Lua) <43-53>
inst = 102172 - gleamsprite (valid:true)
scripts/entityscript.lua:1178 in (method) PushEvent (Lua) <1165-1192>
self (valid:true) =
GUID = 102172
net_owner = net_entity (000000005B210890)
_islighton = net_bool (000000005B210160)
SetPersistData = function - ../mods/workshop-2812783478/scripts/ms_postinits.lua:86
Light = Light (00000000C34E2700)
Network = Network (00000000C34E2BE0)
OnManaChanged = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:242
_lightframe = net_tinybyte (000000005B20F7B0)
spawntime = 0.46666669100523
Transform = Transform (00000000C34E2610)
UpdateRadiusAndVisuals = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:120
actionreplica = table: 00000000471413C0
event_listening = table: 0000000047141910
actioncomponents = table: 000000004713FD90
AddComponent = function - ../mods/workshop-1837053004/modmain/timemagic.lua:190
lower_components_shadow = table: 00000000471410F0
entity = Entity (00000000C3405790)
prefab = gleamsprite
OnSave = function - ../mods/workshop-2039181790/postinit/any.lua:67
OnLoad = function - ../mods/workshop-2039181790/postinit/any.lua:78
persists = false
inlimbo = false
GetOwner = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:166
event_listeners = table: 0000000047141280
ToggleManaDrain = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:55
RegisterComponentActions = function - ../mods/workshop-836583293/modmain.lua:56
IsSummoned = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:174
AnimState = AnimState (00000000C34E21F0)
name = MISSING NAME
replica = table: 000000004713FDE0
SoundEmitter = SoundEmitter (00000000C34E2190)
components = table: 0000000047140E20
GetPersistData = function - ../mods/workshop-2812783478/scripts/ms_postinits.lua:73
event = flaireGleamOwnerChanged
data = nil
listeners = table: 000000005B20F530
tocall = table: 00000000524ECF40
i = 1
fn = function - ../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:43
scripts/mainfunctions.lua:529 in () ? (Lua) <526-531>
guid = 102172
event = flaireGleamOwnerChanged
data = nil
inst = 102172 - gleamsprite (valid:true)
Last edited by Luneyl; 11 Jan, 2024 @ 3:23pm
Fairy  [developer] 11 Jan, 2024 @ 7:54pm 
Thank you for reporting them! Apparently the Snap-Trap removes its combat component immediately upon being hit lol.

I couldn't reproduce your Gleam problem, and from your description that should be impossible (Gleam sprites are only spawned for Flaire), but I've added some countermeasures that hopefully prevent the crashes; Also when this happens again, it should log it in the server console and continue. Maybe it has something to do with the Homura character you have installed? I had a peek and it hooks some core game functions like AddComponent, though their implementation shouldn't cause issues with Flaire from what I could see.

But yeah thanks again, tell me if that helps.
Luneyl 12 Jan, 2024 @ 2:26am 
Snap-Traps no longer crash the game, thanks! As for gleamsprite i'll keep playing and see if anyone crashes again (I also don't really know how to replicate that bug).
Luneyl 12 Jan, 2024 @ 2:55pm 
Update on gleamsprite crash: this time server crashed when I as Flaire tried to enter caves. Happened once and didn't repeat yet after server restart.

[03:19:55]: Activating portal[3] to 2809331063
[03:19:56]: Serializing user: session/002E56439B511BEF/A7JFIHCU3BNF/0000000058
[03:19:56]: [string "../mods/workshop-2496686961/scripts/prefabs..."]:38: attempt to index a nil value
LUA ERROR stack traceback:
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:38 in (upvalue) OnLightDirty (Lua) <33-41>
inst = 120921 - gleamsprite (valid:true)
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:92 in (upvalue) ToggleLight (Lua) <85-94>
inst = 120921 - gleamsprite (valid:true)
enabled = false
instant = true
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:168 in (method) Dispel (Lua) <162-179>
inst = 120921 - gleamsprite (valid:true)
instant = true
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:209 in (local) fn (Lua) <199-210>
x = -35.129039764404
y = 0
z = -155.06709289551
scripts/entityscript.lua:1178 in (method) PushEvent (Lua) <1165-1192>
self (valid:true) =
_PostActivateHandshakeState_Client = 0
GetMoistureRateScale = function - scripts/prefabs/player_common.lua:254
SetCameraDistance = function - scripts/prefabs/player_common.lua:1478
ScreenFlash = function - scripts/prefabs/player_common.lua:1540
skeleton_prefab = skeleton_player
chainSpellFx = 120566 - chainspell_fx (valid:true)
spellDropChance = 0.08125
swordComboTask = PERIODIC 120561: 6.000000
MakeGenericCommander = function - scripts/prefabs/player_common_extensions.lua:823
wallupdatecomponents = table: 0000000018FE32C0
IsActing = function - scripts/prefabs/player_common_extensions.lua:864
Light = Light (000000004689C4F0)
ShowHUD = function - scripts/prefabs/player_common.lua:1450
ResetMinimapOffset = function - scripts/prefabs/player_common.lua:1462
ApplyScale = function - scripts/prefabs/player_common.lua:1557
SetGhostMode = function - scripts/prefabs/player_common.lua:902
ShowActions = function - scripts/prefabs/player_common.lua:1444
OnWakeUp = function - scripts/prefabs/player_common.lua:1308
IsChannelCastingItem = function - scripts/prefabs/player_common.lua:290
gleamSprite = 120921 - gleamsprite (valid:true)
actionreplica = table: 0000000049CCD170
event_listening = table: 0000000049CCBE10
actioncomponents = table: 0000000049CCB0A0
homura_bowblast = table: 0000000018FD94A0
SwapAllCharacteristics = function - scripts/prefabs/player_common.lua:2043
prefab = flaire
updatecomponents = table: 00000000161421F0
YOTB_issetunlocked = function - scripts/prefabs/player_common.lua:85
ShakeCamera = function - scripts/prefabs/player_common.lua:1498
OnLoad = function - ../mods/workshop-2039181790/init/init_vetcurse.lua:20
MiniMapEntity = MiniMapEntity (000000004689C5E0)
modded_healthabsorption = 1
SetGymStopState = function - scripts/prefabs/player_common.lua:64
OnSleepIn = function - scripts/prefabs/player_common.lua:1280
hasRevivedPlayer = true
_underleafcanopy = net_bool (000000001612F550)
IsChannelCasting = function - scripts/prefabs/player_common.lua:286
um_world_temperature = 45.16643221387
SetCameraZoomed = function - scripts/prefabs/player_common.lua:1484
TargetForceAttackOnly = function - scripts/prefabs/player_common.lua:51
SetPersistData = function - ../mods/workshop-2812783478/scripts/ms_postinits.lua:86
DisableLoadingProtection = function - scripts/prefabs/player_common.lua:1059
Network = Network (000000004689C0D0)
eligibleForSpellDrop = false
userid = KU_RvHPuQxl
OnPreLoad = function - scripts/prefabs/player_common.lua:1180
GetPersistData = function - ../mods/workshop-2812783478/scripts/ms_postinits.lua:73
name = Luneyl
regenCombosDone = 0
inCombat = false
ScreenFade = function - scripts/prefabs/player_common.lua:1531
um_all_followers = table: 0000000018FD7C40
modded_hungerabsorption = 1
comboFx = 120568 - combo_fx (valid:true)
_PostActivateHandshakeState_Server = 3
OnSave = function - ../mods/workshop-2039181790/init/init_vetcurse.lu
[03:19:56]: [string "../mods/workshop-2496686961/scripts/prefabs..."]:38: attempt to index a nil value
LUA ERROR stack traceback:
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:38 in (upvalue) OnLightDirty (Lua) <33-41>
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:92 in (upvalue) ToggleLight (Lua) <85-94>
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:168 in (method) Dispel (Lua) <162-179>
../mods/workshop-2496686961/scripts/prefabs/gleamsprite.lua:209 in (local) fn (Lua) <199-210>
scripts/entityscript.lua:1178 in (method) PushEvent (Lua) <1165-1192>
scripts/entityscript.lua:1538 in () ? (Lua) <1527-1594>
=(tail call):-1 in () (tail) <-1--1>
scripts/components/playerspawner.lua:97 in (field) fn (Lua) <81-104>
scripts/scheduler.lua:186 in (method) OnTick (Lua) <164-216>
scripts/scheduler.lua:419 in (global) RunStaticScheduler (Lua) <417-425>
scripts/update.lua:178 in () ? (Lua) <169-220>
Fairy  [developer] 12 Jan, 2024 @ 3:59pm 
Modding tip: Don't try to pool objects if it causes way more problems than it fixes... :/ Sorry for those crashes, I hope this update will prevent any more regarding gleam.
Actually, I think I figured out what it was doing. Should be good now (hopefully). :cozybethesda:
Last edited by Fairy; 13 Jan, 2024 @ 12:14pm
< >
Showing 1-6 of 6 comments
Per page: 1530 50