user826 Posted November 20, 2018 Share Posted November 20, 2018 I'm trying to make a new ammo type for my Syringer Pistol mod that pacifies hostile NPCs and creatures for 30 seconds, but I'm having some trouble actually implementing it. I first tried nesting a StopCombat command inside some If/EndIf blocks like so: if (Timer < 30) if (Victim.IsInCombat == 1) StopCombat endif endifBut that didn't work at all. Next, I tried making a new faction that is allied with the player, and then using the AddToFaction function to temporarily make them allies, like so: Victim.AddToFaction PacifiedFaction set Timer to (Timer + GetSecondsPassed) if (Timer >= 30) Victim.RemoveFromFaction PacifiedFaction endifWhile this did technically work, I ran into another issue - namely that if I attacked another NPC within those 30 seconds, that second NPC would get added to the faction as well and the script would lose the reference variable of the first NPC, which means the first NPC would remain in the faction indefinitely and never become hostile again. Does anyone have any ideas? Ideally, an Actor Effect would be my preferred solution, since those can run on timers that aren't reliant on scripts. I tried using the Damage Aggression effect, but it didn't seem to do anything. Maybe I need to make the Magnitude a negative number, perhaps? Or alternatively, is there a function that will remove every ref from a faction? Any help would be appreciated! Link to comment Share on other sites More sharing options...
FiftyTifty Posted November 20, 2018 Share Posted November 20, 2018 You could try changing the aggression. int iDefaultAggression int iTempAggression let iDefaultAggression := Victim.GetAV Aggression let iTempAggression := 0 Victim.SetAV Aggression iTempAggression if (Timer >= 30) Victim.SetAV Aggression iOldAggression endif Link to comment Share on other sites More sharing options...
user826 Posted November 20, 2018 Author Share Posted November 20, 2018 (edited) Ooh, I'll try that and report back. Thanks! EDIT: Hmm, no joy. Even with the Aggression set to 0, as soon as they see me, they attack, even if I shot them with 3 darts. I also tried creating a new Base Effect with a Value Modifier to damage their Aggression, but it does nothing. I suspect the Aggression AV doesn't work like the others, which can be damaged. As far as I've seen, the only way to change the NPC's aggression is the drop down menu in the GECK. Edited November 20, 2018 by user826 Link to comment Share on other sites More sharing options...
FiftyTifty Posted November 20, 2018 Share Posted November 20, 2018 (edited) Try setting their aggression to 0, then calling ResetAI. int iDefaultAggression int iTempAggression let iDefaultAggression := Victim.GetAV Aggression let iTempAggression := 0 Victim.SetAV Aggression iTempAggression Victim.StopCombat Victim.ResetAI if (Timer >= 30) Victim.SetAV Aggression iOldAggression Victim.ResetAI endif Edited November 20, 2018 by FiftyTifty Link to comment Share on other sites More sharing options...
user826 Posted November 20, 2018 Author Share Posted November 20, 2018 I think I cracked it a different way. I created a new Base Effect (Self, Touch, Target, No Magnitude) using the following script: scn aaaSCPTStopCombatEffect begin ScriptEffectStart StopCombat end begin ScriptEffectUpdate StopCombat end begin ScriptEffectFinish StopCombat endI then made a new Actor Effect with the new "Stop Combat" base effect, setting the Duration for 30 seconds. It seems to work! NPCs hit with the dart still run around with their weapons drawn, but they don't attack. I'd call that a win. Thanks for your help and input all the same, though! Link to comment Share on other sites More sharing options...
dubiousintent Posted November 20, 2018 Share Posted November 20, 2018 An Actor determines if they will attack using both Aggression AND Confidence as well as Faction relationships, based upon the resulting "Threat Ratio" at the time. Lower their Confidence as well to make them "more passive". Note that "Stop Combat" does nothing to affect the "Threat Ratio" and an Actor may resume fighting shortly thereafter. -Dubious- Link to comment Share on other sites More sharing options...
user826 Posted November 21, 2018 Author Share Posted November 21, 2018 I didn't want to mess with the Confidence AV because I don't want them to flee, just to not attack for 30 seconds. I fully intended for them to become hostile again as soon as the Stop Combat effect wears off. Link to comment Share on other sites More sharing options...
dubiousintent Posted November 21, 2018 Share Posted November 21, 2018 It's a matrix of ranges for both stats. Don't drop either to zero; just "damage"/reduce them until you get the effect you want. You can also preserve the initial values (but I doubt that is necessary if you use the "DamageAV" function) before you start the timer, and RestoreAV after the timer expires. But it's just a suggestion based upon the evidence that over-confidence can override some aggression settings. -Dubious- Link to comment Share on other sites More sharing options...
user826 Posted November 21, 2018 Author Share Posted November 21, 2018 I'll certainly keep this in mind for next time. It sounds like a much more elegant solution than mine, and maybe I can adapt it for something else later on. Thanks for the tip! Link to comment Share on other sites More sharing options...
Recommended Posts