Halstrom Posted March 16, 2013 Posted March 16, 2013 I'm trying negate the negative faction effect from shooting an NPC with a Tranquilizer dart, the dart is working fine it adds the Sleep drug and it works knocking the actor out in a few seconds. I'm also adding a one shot token to fix the faction relation but I need to know the victims factions I guess or possibly all the factions they are so I can clear the enemy flag for each one, the only way I can think of is to add all the factions to a formlist then check IsInFaction for each one. Or am I doing this the hard way? scn SexoutSCRS7DrugTokenClearEnemyFlag ref rZActor int iDebug int iCount int iRemoving int iFatigue ref rActorFaction Begin GameMode Set rZActor to GetContainer Set iCount to iCount + 1 if rZActor && iCount > 99 && SexoutSQVAR.iSCRStartCounter > 11 && iRemoving < 1 Set iCount to 0 Set iFatigue to rZActor.GetActorValue Fatigue ; Set rActorFaction to rZActor.GetFactionsSomeHow if iFatigue < 1 ; rZActor.ClearFactionPlayerEnemyFlag rActorFaction ; rZActor.SetEnemy rActorFaction PlayerFaction 0 0 ; rZActor.SetAlly rActorFaction PlayerFaction 1 1 Set iRemoving to 1 RemoveMe endif endif End
DoctaSax Posted March 16, 2013 Posted March 16, 2013 SetEnemy & SetAlly aren't called from a reference. Same goes for ClearFactionPlayerEnemyFlag probably.But yeah, checking for all possible factions is gonna be a drag. And wouldn't it overturn a pre-existing enemy status with a faction? Maybe it were better if you could find a way to avoid making enemies with a tranq dart in the first place, rather than undoing everything. For one thing, you could unflag the base spell as hostile. But that's probably not enough. Maybe you could toggle the actor's AI in the impact script so the crime's not reported by the victim at least? (If his buddies see ya, well... you shoulda been more stealthy.)
Halstrom Posted March 16, 2013 Author Posted March 16, 2013 Yeah, I like the idea of it not antagonising others unless seen. I'm also wondering if this could be used in a chloroform rag too later. Hmm there aren't any base effects associated with weapons & ammo unfortunately, the closet I've found is a Minor Crime option in weapons but it just restricts the hostility to the victim rather than the factions. The other option is to perhaps work out some way of getting dialogue happening with unconscious aggressive victims so we could give them collars or shackles to wear, or just rob them. Maybe I need an updating Formlist that contains all the factions aggressive to the player and watch for the last one's added. Perhaps adding the NPC to the Player Faction may help?
DoctaSax Posted March 16, 2013 Posted March 16, 2013 Another avenue: there's a 'special combat' flag on factions - a leftover from oblivion, I guess, so that actors could train against each other without it being seen as aggro. If that still works, you might add an npc (and the player of course) to a faction that has that. Before any aggro takes place, like when you're aiming (getcrosshairref). No easy solutions though. SOFO has a small option to kill one actor, & I had to remove him from all factions he was in, as well as add him to a custom one flagged as evil to avoid everyone from going bananas. And that's just for one guy.
Halstrom Posted March 16, 2013 Author Posted March 16, 2013 Hmm there's an option, there is a RemoveFromAllFactions command then I add them to a Special Combat Faction, though that may cause issues when they are undrugged & no longer in their normal faction I guess.
sen4mi Posted March 22, 2013 Posted March 22, 2013 If you can halt the animations and events that will damage things when they complete (and your sleep dart sounds like it should work), setDisposition might work? http://geck.bethsoft.com/index.php/SetDisposition Also, depending on how you want the NPC to act, forcing their equipped weapon to be something that does no damage could also help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.