Jump to content

Managing Flourish Unlocks


Newbiespud

Recommended Posts

I made the severe mistake of creating and testing flourishes for a custom character... with the "All Unlocks" mod on. Without really understanding what manages whether a flourish is locked or unlocked. Without All Unlocks, pressing the Flourish button causes a crash.

What do I need to do in GameProfile to make sure the game knows which flourishes are currently locked and unlocked?

CrashFlourishUnlocks.jpg

I don't think the devs did a proper nil check on the game profile, and that may be the issue.

Here's the code that may be the issue:

local all_flourishes = shallowcopy(self:GetSetting( "unlocked_flourishes" ))
return all_flourishes[character_id][game_type]

As you can see, the character_id isn't nil checked, and it causes issues when there are additional characters.

Solved with this in the modinit OnLoad:

if not TheGame:GetGameProfile().values["unlocked_flourishes"]["PC_ARINT_DEMO"] then
		TheGame:GetGameProfile().values["unlocked_flourishes"]["PC_ARINT_DEMO"] = {BATTLE = {},NEGOTIATION = {},}
end

Replace "PC_ARINT_DEMO" with whatever your character's ID is. The problem was indeed a nil value. This makes it function normally.

Credit where credit's due: Thanks @codyfun123 for the extra pair of eyes and pointing me in the right direction.

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...