staalo18 Posted November 18, 2022 Share Posted November 18, 2022 (edited) ------ Solved - see below -------- Here's my problem: I want an actor to completely ignore the player's combat with one specific actor, but join the player's combat with other actors.Actor_1 is an ally of the player, and has "Helps Allies" AI attribute.Actor_2 is an enemy of the player.I want Actor_1 to completely ignore when the player is attacked by Actor_2.In particular, it is important that Actor_1's dialogue works while Actor_2 is in combat state with the player. (Actually Actor_2 is locked in a prison cell, so the player can just ignore the combat, and start dialogue with Actor_1)But I also want Actor_1 to join combat in case the player, or another ally, is being attacked by another actor (not Actor_2).Here's what I tried: Make actor 1 an ally of Actor_2. Now Actor_1 will not try to attack Actor_2 , and looks as if he is ignoring the combat. But dialogue with actor 1 is not working correctly while Actor_2 is in combat state with the player. Actor_1 immediately leaves the dialogue after the player initiated it. Scripted calming of Actor_1 (OnCombatStateChanged() -> StopCombatAlarm()). In principle this works. Dialogue with Actor_1 is possible while Actor_2 is in combat with the player. But it looks awkward, because Actor_1 repeatedly jumps into combat (equips a spell) and falls out of it (unequips the spell), as long as Actor_2 is in combat state with the player. I cannot use "Ignore Combat" flag in the package of actor 1, becausethat just means that Actor_1 behaves as if there is no combat. But he still is in combate state, that means dialogue with the player is not working.Actor_1 will not join combat in case player is attacked by another actor.Does anybody have an idea on how to solve this? Edited November 19, 2022 by staalo18 Link to comment Share on other sites More sharing options...
staalo18 Posted November 18, 2022 Author Share Posted November 18, 2022 FYI, for option 2. above, here is the script attached to Actor_1: Actor property Actor_2 auto event OnCombatStateChanged(actor akTarget, int aeCombatState) if Actor_2 == akTarget && aeCombatState != 0 GetCombatState() while GetCombatState() != 0 StopCombatAlarm() endwhile endif endevent Link to comment Share on other sites More sharing options...
Sphered Posted November 18, 2022 Share Posted November 18, 2022 Dialogue tends to not work if either participant is dealing with combat. Being set as a teammate, and faction relations, tend to be the major factors that govern combat starting. If your goal is to prevent combat from starting, you need to mitigate those two triggers. You dont necessarily need to set someone as a teammate, to be your follower, and they dont necessarily need to have any faction relationship with you either. Also their actorbase record can be set to help no one Perhaps I skimmed quickly, but I dont have a grasp of your mod concept. And how "necessary" is it for them to use dialogue? Aka, can a sound clip work instead? Etc Edit: There are combat override packages you can approach here, to just stand there, or not do typical combat actions, but they are still technically flagged as in combat at the time, so not sure thats really an option Link to comment Share on other sites More sharing options...
staalo18 Posted November 18, 2022 Author Share Posted November 18, 2022 (edited) Thanks for the quick reply. Unfortunately, dialogue with Actor_1, while Actor_2 is in combat state, is a must. As mentioned, Actor_2 is locked up in a prison cell, and I want him to start combat upon sight of the player (will cast distance spells which can hit the player through the cell entrance). But as long as the cell is not unlocked, the other actors (one level up in the same building) should behave normally, and that includes dialogue. Actually, the cell will only be unlocked through such a dialogue. On the other hand, the player must pass the cell to meet Actor_1, which means that Actor_2 will start combat before the player can initiate the dialogue with Actor_1. So:I need combat to start on Actor_2's end upon sight of the player.I need Actor_1 to be ignoring that combat, and be available for dialogueI do not want to make compromises on this, it would impact the story too much. The closest I got so far was using the script. This technically addresses both requirements. But it looks awkard due to the continuos entering/leaving combat behavior of Actor_1. Edited November 18, 2022 by staalo18 Link to comment Share on other sites More sharing options...
staalo18 Posted November 19, 2022 Author Share Posted November 19, 2022 (edited) Ok, I solved this. Because I am not able to have Actor_1 ignore Actor_2's combat state, I now stop Actor_2's combat alarm when the player passes a checkpoint on his way up to Actor_1. That way, Actor_1 no longer tries to come for help, and behaves normally. Because Actor_2 is locked in the cell, and Actor_1 actually does not come close to the cell until it's unlocked (I still apply the scripted Calm on him), this will work for me. Thanks again to Sphered for their input. That made me think of alternative ways beyond directly impacting the actor's behavior. Edited November 19, 2022 by staalo18 Link to comment Share on other sites More sharing options...
Recommended Posts