Not sure if this mod would affect Viconia if you decide to kill her during cutscene, I'll modify the script with your feedback if anything unexpected occurs.
If i know how to make targets untargetable. Does the game have any instance where certain characters are not targetable? I can try copying the technique.
I don't want target to be untargetable per say....
Let me explain, I'm using an AI Allies and the problems is that it doesn't matter if the target is invulnerable it keep attacking same target over and over, I'm assuming you could add a function like Osi.ApplyStatus(uuid,"SURRENDERED", -1) or just remove the "TEMPORARILY_HOSTILE" or "PERMANENTLY_HOSTILE" anything that AI would forgot the target and move to next hostile enemy or maybe you could apply "HOSTILE_REFRESH" status so game would stop target same knock down target
'Well tank you, I've tried the beta version and it's weird... seems "surrender" is doing the opposite and my character is fixed on killing the same target over and over even if the next turn starts :( I am assuming surrender isn't changing the flag hostile or whatever the AI is targeting I also got this in console
Error while dispatching event GameStateChanged:[string "KnockedOutInvulnerable/Server/KnockedOutInvul..."]:55: Param 1: not a valid GUID value: 'S_CRE_CrecheGuard01_5a5c5878-fd9f-41c0-9c8c-b74cea0e3fd9\\\\\\\\\\\\\\\' stack traceback: [C++ Code]: in field 'Get' KnockedOutInvulnerable/Server/KnockedOutInvulnerable.lua:55: in function <KnockedOutInvulnerable/Server/KnockedOutInvulnerable.lua:48> [C++ Code]: in function 'xpcall' builtin://Libs/Event.lua:129: in method 'Throw' builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
Maybe remove the status HOSTILE would make the difference? I'm 100% the "TEMPORARILY_HOSTILE" is what triggers the AI to keep focusing on same target Could you remake another version that Osi.RemoveStatus(uuid,"TEMPORARILY_HOSTILE", -1) after it get down? Seems that hostile status has nothing to do with AI targeting the knock down target, I found a solution by adding
Osi.ApplyStatus(uuid,"SANCTUARY", -1) the AI wont target the same target but will end the turn even if it has more Actions Point
Got it, perma-sacntuary it is regarding the codes you posted, somehow the script kept adding '\' to the guid record, which invalidates them. I'll see what I can do, this is unexpected.
Can you send me the Invulnerable_Record.txt in the script extender folder of the game mod folder ? (In Appdata/Local/Larian Studios/Baldur's Gate 3/Script Extender) I'm going to try Osi.SetIndividualRelation, see the optional file, it will now make the KO target neutral towards the character doing the KO. Is there a command to identify which character you're in with so I can apply to everyone in party? I can mass set relation since IDs of all companions are known, but I'd like to save resources.
I've made some test and it seems that the AI from AI Allies has nothing to do with hostile but I believe Osi.LeaveCombat(uuid) does the trick however the current turn is still keep attacking.... what is weird that without leaving the combat TEMPORARILY_HOSTILE & PERMANENTLY_HOSTILE alone seems to not work
I've messing around with your script trying to make the AI forget the target and move on,the author said "it is likely something about the 'knockout' mechanic is changed from your mods,"
Ext.Osiris.RegisterListener("LeftCombat", 2, "before", function(uuid, combatid) if IsCharacter(uuid) == 1 then if IsEnemy(uuid,GetHostCharacter()) == 1 then if Osi.HasActiveStatus(uuid, "KNOCKED_OUT_PERMANENTLY") == 1 or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_BASE") == 1 or Osi.HasActiveStatus(uuid, "KNOCKED_OUT") == 1 or Osi.HasActiveStatus(uuid, "DEN_KNOCKEDOUT") == 1 or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_INHERITABLE") == 1 or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_TEMPORARILY") == 1 then --Osi.ApplyStatus(uuid,"INVULNERABLE", -1) --Osi.ApplyStatus(uuid,"SURRENDERED", -1) --Osi.ApplyStatus(uuid,"SANCTUARY", 1, 1, GetHostCharacter()) _P("‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾") Ext.Utils.Print("[PARADOXAL char uuid] Wait for debug to " .. GetHostCharacter()) Ext.Utils.Print("[PARADOXAL arch type] " .. Osi.GetActiveArchetype(GetHostCharacter())) Osi.RemovePreferredAiTargetTag(GetHostCharacter(), Osi.GetAiHint(uuid)) Ext.Utils.Print("[PARADOXAL RemovePreferredAiTargetTag] ") Ext.Utils.Print("[PARADOXAL char uuid] Wait for debug to " .. GetHostCharacter()) Osi.PauseCombat(combatid) Ext.Utils.Print("[PARADOXAL combat] pause ") local px,py,pz = Osi.GetPosition(uuid) Osi.RequestPing(px, py, pz, uuid, GetHostCharacter()) Ext.Utils.Print("[PARADOXAL ping] pinged: " .. uuid) --Osi.SetVisible(uuid, 0) --Osi.SetForceUpdate(uuid, 1) Osi.DisappearOutOfSightTo(uuid, GetHostCharacter(),) UnApplyStatusBasedOnBuff(GetHostCharacter()) Ext.Utils.Print("[PARADOXAL AI] disable ") --Osi.LeaveCombat(GetHostCharacter()) --Ext.Utils.Print("[PARADOXAL myself] leave combat") --Osi.EndCombat(combatid) Osi.RemoveStatus(uuid,"TEMPORARILY_HOSTILE") Osi.RemoveStatus(uuid,"PERMANENTLY_HOSTILE") Ext.Utils.Print("[PARADOXAL friend] remove hostility to " .. uuid) Osi.LeaveCombat(uuid) Ext.Utils.Print("[PARADOXAL friend] leave combat " .. uuid) --Osi.EnterCombat(combatid, GetHostCharacter()) Osi.ResumeCombat(combatid) Ext.Utils.Print("[PARADOXAL combat] resume ") ApplyStatusBasedOnBuff(GetHostCharacter()) Ext.Utils.Print("[PARADOXAL AI] enable ") --HOSTILE_REFRESH _P("_____________________________________________________") end end end end)
This mod is 100% script and 0 vanilla asset modification: If an enemy left combat with KO status, it receives a status, that's it. The script isn't supposed to do that with all the '\', did you reload KO a lot ? I assume making the target invisible also failed ? Try modifying the txt file to be like this { [2] = "guid=S_UND_Kuotoa_006_faa76070-acc4-4e02-a89b-9a517e1e53e4", } then tell me how long until the same error creeps back again
Not sure about making them invisible would do the trick, but I also found Osi.SetTag(uuid,"AI_IGNORED_TARGET") however after testing nothing seems to change on the current round, I belive Osi.LeaveCombat(uuid) is stil the safest route.
About that weird "\\\\\" creation not sure what trigger that bug but fileIO usually has problem if is called numerous times, I had same problem with another mod Camp Event Notifications but it created "nil nil nil" unicode char
PS: just tested Osi.ApplyStatus(uuid,"INVISIBLE", 10, 1, GetHostCharacter()) but doesn't work, even on invisibility AI still target poor knockout guys :))
Shouldn't it just be Osi.ApplyStatus(uuid, "INVISIBLE", -1) ? That's how I've always been doing with statuses without duration. Have you tested the new update ? It switches the target to neutral towards the party faction.
I wanted to set invisibility or any status so the game won't break, I would test with the neutral and come back with a review
PS: nothing change, it seems that might be something happening with AI... as I heavily modded things tend to break I believe relation set to neutral is same as doing Osi.LeaveCombat(uuid) I'm assuming game set the enemy as neutral that aren't into combat I've tested at enemy level 2 while I'm level 60+ :)), the pattern is simple and every time the same, pick the first closer enemy and spend all ability point, next round repeat, occasionally it reposition to shot enemy with crossbow. Testing on new play-through things seems to go better as it targets multiple foes use multiple spells, heal, throw things & even run to take cover. The best I can assume from this is that AI doesn't do any calculation as this enemy are way bellow their level Either way I try to find an excuse to get a new game o_0
Let me know if I can help with anything on my end. I feel the same lmao, randomised loot + gear mods means I got even more frequent intrusive thoughts about starting a new playthrough just to see what creative set i can get my hoarding grubby hands on and test them. What about resetting relation and attitude? sequentially: ClearIndividualRelation(uuid, faction of AI ally) SetIndividualRelation(uuid, faction of AI ally, some integer between 0 and 100) AddAttitudeTowardsPlayer(uuid, uuid of character with AI ally, 200) Hypothetically that would make the KO character become ally with any character due to the 100 attitude thing, better than neutral. These helped me with a faction bug where Gale turned hostile and initiate combat when an ally's AOE spell killed his summon, still abled to control him and the party, but no way to end combat until I ran those codes.
What about a way of making knocked out characters turn to sleeping ones? I know sleeping npc's still turn targetable, is there a way to copy the sleeping bugbear and apply that to "knocked out" opponents??
I can apply any status onto enemies now that I worked out the kinks, but why sleeping ? they're still KO and 1 hp away from death, and after long rest they either back to full hp with cleared statuses or vanish.
I've had the same problem with Party Limit Begone, but on Vortex, didn't know how to fix it so I went command console. Unfortunately you'll have to manually install them then, or extract the files in the mod out into Baldurs Gate 3\Data and set debug mode on in script extender.
It turns out something wacky happened with the meta file, I started from scratch using Lazy's mod template builder and it no longer cause the issue. Try it out.
To clarify, you want to the mod to add another passive to give KOed invulnerability ? That still won't solve your problem of wanting to kill them later. Or are you refering to the posibility of a neutral character get KOed, got invul, then after long rest they got back but the invul is still there but you want to kill them ?
I can try to make it so the invul thing disappear upon loading a save, so you can f5 after KO and reload to kill them, no guarantee if it actually work or the ETA though.
28 comments
Let me explain, I'm using an AI Allies and the problems is that it doesn't matter if the target is invulnerable it keep attacking same target over and over, I'm assuming you could add a function like
Osi.ApplyStatus(uuid,"SURRENDERED", -1) or just remove the "TEMPORARILY_HOSTILE" or "PERMANENTLY_HOSTILE" anything that AI would forgot the target and move to next hostile enemy or maybe you could apply "HOSTILE_REFRESH" status so game would stop target same knock down target
the same target over and over even if the next turn starts :( I am assuming
surrender isn't changing the flag hostile or whatever the AI is
targeting
I also got this in console
Error while dispatching event GameStateChanged:[string "KnockedOutInvulnerable/Server/KnockedOutInvul..."]:55: Param 1: not a
valid GUID value:
'S_CRE_CrecheGuard01_5a5c5878-fd9f-41c0-9c8c-b74cea0e3fd9\\\\\\\\\\\\\\\'
stack traceback:
[C++ Code]: in field 'Get'
KnockedOutInvulnerable/Server/KnockedOutInvulnerable.lua:55: in
function
<KnockedOutInvulnerable/Server/KnockedOutInvulnerable.lua:48>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>
Maybe remove the status HOSTILE would make the difference?
I'm 100% the "TEMPORARILY_HOSTILE" is what triggers the AI to keep focusing on same target
Seems that hostile status has nothing to do with AI targeting the knock down target, I found a solution by addingCould you remake another version that Osi.RemoveStatus(uuid,"TEMPORARILY_HOSTILE", -1) after it get down?
Osi.ApplyStatus(uuid,"SANCTUARY", -1)
the AI wont target the same target but will end the turn even if it has more Actions Point
regarding the codes you posted, somehow the script kept adding '\' to the guid record, which invalidates them. I'll see what I can do, this is unexpected.
I'm going to try Osi.SetIndividualRelation, see the optional file, it will now make the KO target neutral towards the character doing the KO. Is there a command to identify which character you're in with so I can apply to everyone in party? I can mass set relation since IDs of all companions are known, but I'd like to save resources.
{
[1] = "{\
[1] = \"{\\\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otoa_006_faa76070-acc4-4e02-a89b-9a517e1e53e4\\\\\\\",\\\\\\\
}\\\",\\\
[2] = \\\"guid=S_UND_Kuotoa_003_db745e99-88bd-4e2c-8714-a85f7c24c145\\\",\\\
}\",\
[2] = \"guid=S_UND_Kuotoa_001_840fd954-7c2b-41e4-b485-13b66659f598\",\
}",
[2] = "guid=S_UND_Kuotoa_006_faa76070-acc4-4e02-a89b-9a517e1e53e4",
}
I've messing around with your script trying to make the AI forget the target and move on,the author said "it is likely something about the 'knockout' mechanic is changed from your mods,"
Ext.Osiris.RegisterListener("LeftCombat", 2, "before", function(uuid, combatid)
if IsCharacter(uuid) == 1 then
if IsEnemy(uuid,GetHostCharacter()) == 1 then
if Osi.HasActiveStatus(uuid, "KNOCKED_OUT_PERMANENTLY") == 1
or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_BASE") == 1
or Osi.HasActiveStatus(uuid, "KNOCKED_OUT") == 1
or Osi.HasActiveStatus(uuid, "DEN_KNOCKEDOUT") == 1
or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_INHERITABLE") == 1
or Osi.HasActiveStatus(uuid, "KNOCKED_OUT_TEMPORARILY") == 1 then
--Osi.ApplyStatus(uuid,"INVULNERABLE", -1)
--Osi.ApplyStatus(uuid,"SURRENDERED", -1)
--Osi.ApplyStatus(uuid,"SANCTUARY", 1, 1, GetHostCharacter())
_P("‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾")
Ext.Utils.Print("[PARADOXAL char uuid] Wait for debug to " .. GetHostCharacter())
Ext.Utils.Print("[PARADOXAL arch type] " .. Osi.GetActiveArchetype(GetHostCharacter()))
Osi.RemovePreferredAiTargetTag(GetHostCharacter(), Osi.GetAiHint(uuid))
Ext.Utils.Print("[PARADOXAL RemovePreferredAiTargetTag] ")
Ext.Utils.Print("[PARADOXAL char uuid] Wait for debug to " .. GetHostCharacter())
Osi.PauseCombat(combatid)
Ext.Utils.Print("[PARADOXAL combat] pause ")
local px,py,pz = Osi.GetPosition(uuid)
Osi.RequestPing(px, py, pz, uuid, GetHostCharacter())
Ext.Utils.Print("[PARADOXAL ping] pinged: " .. uuid)
--Osi.SetVisible(uuid, 0)
--Osi.SetForceUpdate(uuid, 1)
Osi.DisappearOutOfSightTo(uuid, GetHostCharacter(),)
UnApplyStatusBasedOnBuff(GetHostCharacter())
Ext.Utils.Print("[PARADOXAL AI] disable ")
--Osi.LeaveCombat(GetHostCharacter())
--Ext.Utils.Print("[PARADOXAL myself] leave combat")
--Osi.EndCombat(combatid)
Osi.RemoveStatus(uuid,"TEMPORARILY_HOSTILE")
Osi.RemoveStatus(uuid,"PERMANENTLY_HOSTILE")
Ext.Utils.Print("[PARADOXAL friend] remove hostility to " .. uuid)
Osi.LeaveCombat(uuid)
Ext.Utils.Print("[PARADOXAL friend] leave combat " .. uuid)
--Osi.EnterCombat(combatid, GetHostCharacter())
Osi.ResumeCombat(combatid)
Ext.Utils.Print("[PARADOXAL combat] resume ")
ApplyStatusBasedOnBuff(GetHostCharacter())
Ext.Utils.Print("[PARADOXAL AI] enable ")
--HOSTILE_REFRESH
_P("_____________________________________________________")
end
end
end
end)
The script isn't supposed to do that with all the '\', did you reload KO a lot ?
I assume making the target invisible also failed ?
Try modifying the txt file to be like this
{
[2] = "guid=S_UND_Kuotoa_006_faa76070-acc4-4e02-a89b-9a517e1e53e4",
}
then tell me how long until the same error creeps back again
About that weird "\\\\\" creation not sure what trigger that bug but fileIO usually has problem if is called numerous times, I had same problem with another mod Camp Event Notifications but it created "nil nil nil" unicode char
PS: just tested Osi.ApplyStatus(uuid,"INVISIBLE", 10, 1, GetHostCharacter()) but doesn't work, even on invisibility AI still target poor knockout guys :))
Osi.ApplyStatus(uuid, "INVISIBLE", -1) ?
That's how I've always been doing with statuses without duration.
Have you tested the new update ? It switches the target to neutral towards the party faction.
PS: nothing change, it seems that might be something happening with AI... as I heavily modded things tend to break
I believe relation set to neutral is same as doing Osi.LeaveCombat(uuid) I'm assuming game set the enemy as neutral that aren't into combat I've tested at enemy level 2 while I'm level 60+ :)), the pattern is simple and every time the same, pick the first closer enemy and spend all ability point, next round repeat, occasionally it reposition to shot enemy with crossbow. Testing on new play-through things seems to go better as it targets multiple foes use multiple spells, heal, throw things & even run to take cover. The best I can assume from this is that AI doesn't do any calculation as this enemy are way bellow their level
Either way I try to find an excuse to get a new game o_0
I feel the same lmao, randomised loot + gear mods means I got even more frequent intrusive thoughts about starting a new playthrough just to see what creative set i can get my hoarding grubby hands on and test them.
What about resetting relation and attitude? sequentially:
ClearIndividualRelation(uuid, faction of AI ally)
SetIndividualRelation(uuid, faction of AI ally, some integer between 0 and 100)
AddAttitudeTowardsPlayer(uuid, uuid of character with AI ally, 200)
Hypothetically that would make the KO character become ally with any character due to the 100 attitude thing, better than neutral.
These helped me with a faction bug where Gale turned hostile and initiate combat when an ally's AOE spell killed his summon, still abled to control him and the party, but no way to end combat until I ran those codes.
When i start the game, all of the mod literally set to inactive, but the "manual" install mod and mod that overwrite like better* etc still working
Unfortunately you'll have to manually install them then, or extract the files in the mod out into Baldurs Gate 3\Data and set debug mode on in script extender.
If that's the case, would it be possible to get this as a toggle-able passive?
Or are you refering to the posibility of a neutral character get KOed, got invul, then after long rest they got back but the invul is still there but you want to kill them ?