Jump to content

Stop combat - Scripting


ismael29h

Recommended Posts

Hello!!!
Here I am, slowly learning scripting ...
Is there a way to stop combat with hostile enemies?
I have tried "StopCombatAlarmOnActor", but it does not work properly with hostile enemies, rather it stops them for a moment ... in this sense, I have created a loop with said function hoping to get some result, and nothing.
I have tried other functions like "stopcombat" or, going further, "SetCombatDisabled" (scanning to each npc separately, of course). The results are not seen either.
Is there a way to stop all hostile acts towards the player and to be able to resume the combat later?

 

PD: (if something of my painful English is not understood, please notice)

Link to comment
Share on other sites

In Oblivion I've found that it is necessary to reduce the hostile NPC's aggression to get them to stop combat.

 

Not certain if the console commands are the same for FONV but in Oblivion you can see what I'm talking about by issuing these console commands with the NPC's refID selected:

 

getav aggression (will report 100 for most hostile NPCs, though some will be lower)

stopcombat

 

This will display excactly the same behavior you are reporting ... they will stop combat long enough to put away their weapon and then will immediately reinitiate combat (which only makes sense as their aggression is high and their disposition towards the player is low). Next issue the following commands:

 

getav aggression (let's assume it reports 100)

modav aggression -99 (so the aim is to leave the NPC's aggression at 1)

stopcombat

 

You will see that they again stopcombat and put away their weapon ... this time they stay non-hostile.

 

The reason I go through the getav part is because not all hostile NPCs have aggression set to 100 in Oblivion. Using the console commands (vs scripting) I have found that the command setav aggression 1 gives unreliable results ... could be that scripting using setav aggression is more reliable, I can't say for certain one way or the other.

Link to comment
Share on other sites

There is a Yield mechanic in the game where Neutrals will stop combat if the player holsters their weapon.

 

Maybe it would be easier to just force the player to do that with DisablePlayerControls?

Thanks. The npc's I'm targeting don't accept surrender.

Link to comment
Share on other sites

In Oblivion I've found that it is necessary to reduce the hostile NPC's aggression to get them to stop combat.

 

Not certain if the console commands are the same for FONV but in Oblivion you can see what I'm talking about by issuing these console commands with the NPC's refID selected:

 

getav aggression (will report 100 for most hostile NPCs, though some will be lower)

stopcombat

 

This will display excactly the same behavior you are reporting ... they will stop combat long enough to put away their weapon and then will immediately reinitiate combat (which only makes sense as their aggression is high and their disposition towards the player is low). Next issue the following commands:

 

getav aggression (let's assume it reports 100)

modav aggression -99 (so the aim is to leave the NPC's aggression at 1)

stopcombat

 

You will see that they again stopcombat and put away their weapon ... this time they stay non-hostile.

 

The reason I go through the getav part is because not all hostile NPCs have aggression set to 100 in Oblivion. Using the console commands (vs scripting) I have found that the command setav aggression 1 gives unreliable results ... could be that scripting using setav aggression is more reliable, I can't say for certain one way or the other.

Wow, it makes perfect sense ... I'm going to try.

I think that may be the answer.

Thanks!!

Edited by ismael29h
Link to comment
Share on other sites

Besides stopcombat ... you have to change the faction reaction. Hence add them to be friend with player faction.

Attacking them after will make them attack you though ... if that is what you were wondering .

Link to comment
Share on other sites

And remember ... this is not oblivion .

 

Hence in Fo3 it will not work ... ergo FNV

Yes, the mention of oblivion helped me better investigate the subject. Get to the theme of the factions, in an unpredictable scenario it is complete chaos to be taking into account every detail.

This topic is not worth touching on, especially when I'm learning.

Thanks for answering!

Link to comment
Share on other sites

@ ismael29h

Sorry to drag this thread up just for this.

But your avatar pic is familiar to me. And I can not place it's origin.

So it has been gnawing at my brain.

Could you tell me where it is from ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...