PJMail Posted May 24, 2022 Share Posted May 24, 2022 As per the documentation, "Nate.StopCombat()" is clear - Stops "Nate" from being in combat (until the game thinks they should be again). But "Nate.StopCombatAlarm()" documentation suggests it is the complement - pacifies all the other NPC's who are incombat or alarmed at "Nate" - yet it's example says it "Calms Nate down" - which suggests it only stops Nate from being "alarmed". Does anyone have experience with what StopCombatAlarm actually does in FO4? Thanks Link to comment Share on other sites More sharing options...
DieFeM Posted May 24, 2022 Share Posted May 24, 2022 pacifies all the other NPC's who are incombat or alarmed at "Nate"That's what it actually does. Link to comment Share on other sites More sharing options...
SKKmods Posted May 24, 2022 Share Posted May 24, 2022 Amusing side note. If friendly NPCs like settlers are set to essential with nobleedoutrecovery and they enter bleedout, 50% of the time when they are recovered they will be HOSTILE to the player UNLESS .StopCombat() and .StopCombatAlarm() are called on them first: If ((ThisREF as Actor).IsBleedingOut() == TRUE) && ((ThisREF as Actor).GetNoBleedOutRecovery() == TRUE) (ThisREF as Actor).StopCombat() ;avoid hostility when bleedout ends (ThisREF as Actor).StopCombatAlarm() ;avoid hostility when bleedout ends I would guess that the companion system based on PlayerCanStimpak DFOB (rather than AddActivate perk and script) has that built into the game code. Took me WEEKS to track down, initially looked like the actors thought stimpaking was pickpocketing or sommat ... Link to comment Share on other sites More sharing options...
PJMail Posted May 24, 2022 Author Share Posted May 24, 2022 (edited) pacifies all the other NPC's who are incombat or alarmed at "Nate"That's what it actually does. So incorrect example in the creation kit article? Thanks - I suspected as such (as otherwise why have it) but it could have just got rid of the 'IsAlarmed()' state...It does also explain why it seems to have a greater game performance impact than 'stopcombat' (when there are a few hostiles). Interestingly - has anyone ever seen 'npc.IsAlarmed()' ever return true? In OnCombatStateChanged it is always false (for all states). Also I was using stopcombatalarm for a while (in an oncombatstatechanged script) and it NEVER stopped any attackers - so I really think it is broken then (or at best useless). Edited May 24, 2022 by PJMail Link to comment Share on other sites More sharing options...
PJMail Posted May 24, 2022 Author Share Posted May 24, 2022 (edited) Amusing side note. If friendly NPCs like settlers are set to essential with nobleedoutrecovery and they enter bleedout, 50% of the time when they are recovered they will be HOSTILE to the player UNLESS .StopCombat() and .StopCombatAlarm() are called on them first: If ((ThisREF as Actor).IsBleedingOut() == TRUE) && ((ThisREF as Actor).GetNoBleedOutRecovery() == TRUE) (ThisREF as Actor).StopCombat() ;avoid hostility when bleedout ends (ThisREF as Actor).StopCombatAlarm() ;avoid hostility when bleedout ends I would guess that the companion system based on PlayerCanStimpak DFOB (rather than AddActivate perk and script) has that built into the game code. Took me WEEKS to track down, initially looked like the actors thought stimpaking was pickpocketing or sommat ... I am missing something here as I don't see the connection between the player and the friendly NPC.What operation was performed on them to exit bleedout? Are you saying they just recovered and spontaneously became hostile to the player, or the player got them out of bleedout via a stimpack and that perhaps triggered it? I assume the player didn't cause them to enter bleedout (via say friendly fire)?Just trying to understand why they became hostile to the player (apparently only) - perhaps it may explain some other 'spontaneous' hostility by settlers I have experienced (if I understood it). Edited May 24, 2022 by PJMail Link to comment Share on other sites More sharing options...
SKKmods Posted May 24, 2022 Share Posted May 24, 2022 I am missing something here as I don't see the connection between the player and the friendly NPC. Thats right, there is NO connection between ther player and the friendly NPC. If the PlayerCanStimpak DFOB is not active (must be a player follower) the way an actor is recovered from bleedout is through a pure script timer: If ((ThisREF as Actor).IsBleedingOut() == TRUE) && ((ThisREF as Actor).GetNoBleedOutRecovery() == TRUE) (TargetREF as Actor).ResetHealthandLimbs() ; does not actually recover from bleedout (TargetREF as Actor).SetNoBleedoutRecovery(False) int iBailout = 0 While ((TargetREF as Actor).IsBleedingOut() == true) && (iBailout < 15) Utility.WaitMenuMode(1.0) ; takes 12 to 14 real time seconds to recover iBailout +=1 ; this is actually done on a script timer not a While/Wait loop EndWhile (TargetREF as Actor).SetNoBleedoutRecovery(True) Endif Yet they recover hostile to the player on a significant percentage. Odd, but reproducably true. Version 011Fix: regression that caused some settlers to be player hostile on bleedout recovery until their 3D unloaded/reloaded. Link to comment Share on other sites More sharing options...
DieFeM Posted May 24, 2022 Share Posted May 24, 2022 Also I was using stopcombatalarm for a while (in an oncombatstatechanged script) and it NEVER stopped any attackers - so I really think it is broken then (or at best useless). My experience is using it to stop alarmed npc's who are initially friendly, but that get hostile because the player commits a crime against them or their allied factions, like killing, stealing, trepasing etc.I guess that it works for hostile factions but they inmediatelly become alarmed right away after using it. Note that I use it on the player. Additionally I noticed it works only on loaded actors, so if an actor exits the loaded area alarmed and then comes back, its alarmed status wont change, I guess the same happens for bleeding out npc's. Link to comment Share on other sites More sharing options...
PJMail Posted May 31, 2022 Author Share Posted May 31, 2022 Thats right, there is NO connection between ther player and the friendly NPC. If the PlayerCanStimpak DFOB is not active (must be a player follower) the way an actor is recovered from bleedout is through a pure script timer:Yet they recover hostile to the player on a significant percentage. Odd, but reproducably true. How timely SKK! Just had this very effect happen to me and I would have been stumpted if you hadn't mentioned it. 'Accidentally' tested this when I forgot my VB pilot was set to essential and shot them to make sure their bodies were lootable (a feature I added recently).They are set to 'ignore friendly fire' and in the player faction - and normally totally ignore being shot/crippled by the player.100% of the time after they go into bleedout (then get up) they instantly turn hostile to me (and my companions shoot him - rinse repeat).It does it matter whether I or my companions fired the initial 'bleedout' shot (during a firefight say). This also explains why accidently shooting a settlement turret into 'bleedout' causes a resulting firefight (all the settlers then turn on you too - same crime faction). So this means I need to add something like your code to my Pilot NPC to get around this?If I put it in an "OnEnterBleedout" event would that be sufficient? Thanks Link to comment Share on other sites More sharing options...
PJMail Posted May 31, 2022 Author Share Posted May 31, 2022 Just tried it and doing the stopcombat fixes on the "onEnterBleedout" event work perfectly! Thanks. Link to comment Share on other sites More sharing options...
SKKmods Posted May 31, 2022 Share Posted May 31, 2022 Just tried it and doing the stopcombat fixes on the "onEnterBleedout" event work perfectly! Thanks. Thats fantastic payback :smile: as I spent a crap-tonne of time figuring that behavior trigger out. In a similar veign if they are in neutral/friendly factions like, say CrimeDiamondCity, you may want to call IsPlayerEnemy/SetPlayerEnemy(False) on it as their hostility could trigger the temporary faction crime hostility posture. Thats a tiny percentage of the small hostile recovery percentage but can happen. Although when the whole of something like CrimeDiamondCity turns on the player you actually have to run stopcombat/alarm on each actor ... or run away so they can reset. Link to comment Share on other sites More sharing options...
Recommended Posts