Jump to content

Script to make a shot Actor friendly?


Halstrom

Recommended Posts

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

 

 

Link to comment

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.)

Link to comment

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?

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use