Base_N wrote: ↑Mon Aug 28, 2023 11:51 pm
It seems like we can add and remove passives to characters BUT we can't remove passives that were added normally through gameplay instead of the CE table.
For example:
Code: Select all
{$lua}
if syntaxcheck then return end
passive = {
"CRE_BrainDamage_CON",
"CRE_BrainDamage_INT",
"CRE_BrainDamage_WIS"
}
[ENABLE]
RemovePassiveFromPlayer(passive)
[DISABLE]
This will remove the passives if they were added with AddPassiveToPlayer() but it will not touch the passives actually added by the gith machine.
I also see that this question has been asked a LOT of times (after reading the entire thread) but has been unanswered.
This also leads me to believe that the way we're adding the passives perhaps is not the way the game engine does it and this could lead to unusable savegame files at some point.
I made some simple experiment about it:
Those passives that you try to remove are activated by a "condition" and thus they are kept active until the condition itself is removed.
In my test, I tried to remove a passive that was linked to some boots: I couldn't add/remove the passive until I remove my boots!
So, you need to find what is the "condition" that keep you passive active then try to remove it.
In my example, the boots, there is a "PassiveOnEquip" and " StatusOnEquip" linked to it.
Here is a piece of CT code that test if a passive is active:
Code: Select all
if syntaxcheck then return end
PassiveID = "MAG_EndGame_Boots_Passive"
[ENABLE]
--HasPassive([in](GUIDSTRING)_Entity, [in](STRING)_PassiveID, [out](INTEGER)_BoolHasPassive)
local Entity = GetHostCharacter()
SetArgToString(0, Entity)
SetArgToString(1, PassiveID)
ClearArg(2)
local result = ExecuteCall("HasPassive")
print(PassiveID .. " = " .. GetArgAsInteger(2))
[DISABLE]
In your case:
the passive "CRE_BRAINDAMAGE_CON" is may be linked to the Status "CRE_BRAINDAMAGE_CON" (yes same name!):
You could try to remove the status/BOOST instead of the passive?
Code: Select all
"CRE_BRAINDAMAGE_CON": {
"EntryName": "CRE_BRAINDAMAGE_CON",
"EntryType": "StatusData",
"StatusType": "BOOST",
"DisplayName": "h007eaf6agfca5g4ce7g9f2fg468013cd698b;2",
"DisplayName_English": "%%% EMPTY",
"Icon": "statIcons_CRE_BrainDamage_CON",
"Passives": "CRE_BrainDamage_CON",
"StatusPropertyFlags": "DisableOverhead;DisableCombatlog;ApplyToDead;IgnoreResting;DisablePortraitIndicator;BringIntoCombat",
"RootFolder": "Patch1/Public/GustavDev"
},