Jump to content

Actor.getfactions() - anyone made such a function they care to share?


PJMail

Recommended Posts

Missing in both Papyrus and F4SE.

I don't want to have to create a bunch of formlists for all 600+ factions if someone else has already done it...

And Incrementing through all possible 'getformfromfile(int,"Fallout4.esm") is faction' sort of thing sounds slow and crude.

 

For some background, I am trying to find out why my NPC attacks the robots at General Atomics Galleria (when the player or companions don't).

My NPC is only in 2 factions PlayerFaction and a mod only one FPVfaction (no crime faction)

 

Dumping the status of these when my NPC starts combat shows ("me" is the NPC in this dump):

 

- Combat Target: [DN049_RobotSelfDestructScript < (000E524E)>] Hostile to me? True am I hostile to them? True (using Actor.IsHostileToActor)
- Their Factions consider me Neutral mine consider them Enemy (using Actor.GetFactionReaction)
- They consider me Acquaintance I consider them Acquaintance (using Actor.GetRelationshipRank)
- Their Crime Faction is [Faction < (000E5251)>] and considers me Neutral (using Faction.GetFactionReaction)
- PlayerFaction considers them Enemy (using Faction.GetFactionReaction)

- FPVFaction considers them Neutral
- RobotFaction considers me Neutral Player Enemy? False (using Faction.IsPlayerEnemy)
- They are in RobotFaction (using Actor.IsInFaction)

That Galleria robot (000E524E) is NOT in PlayerEnemyfaction

So I am trying to work out what faction they are in that is considered an enemy of "Playerfaction" (it isn't any of the Galleria factions - I tested that).

 

Also if PlayerFaction considers them an enemy, why don't they appear as an enemy to me (player)?

They don't attack me, even when my NPC is mowing them down.

 

Crazy...

Link to comment
Share on other sites

Nope, I made a f*** off big formlist of all the base game factions and cycled though it checking IsInFaction()

 

; takes 80 seconds to complete on a single script thread with 690 entries.

Link to comment
Share on other sites

I thought about doing that but assumed someone must have already done it or better.

How did you 'automate' generating the formlist?

FO4edit doesn't have any 'cut and paste' into a Formlist, and I am not going to type them all in.

Link to comment
Share on other sites

I thought about doing that but assumed someone must have already done it or better.

How did you 'automate' generating the formlist?

FO4edit doesn't have any 'cut and paste' into a Formlist, and I am not going to type them all in.

 

I have never really done patches with CK but in CK, you can select multiple objects from the object window and you can drag/move them to a formlist window that you have open. You can also click then shift + click to select from top to bottom.

Edited by NoCashNoExp
Link to comment
Share on other sites

To make a function that "returned" and array with all the factions that an npc is part of the papyrus scripting language would need to support vectors!

(A vector is basically a "at runtime resizeable" array)

Functions like getplayerfollowers() returns a dynamic array of actors (Actor[]).

Are you saying something like the following will not compile? I have not tried it...

 

Faction[] Function GetFactions(Actor akActor)

faction[] factions = new faction[0]

; fill in the factions array

return factions

Endfunction

Link to comment
Share on other sites

  • Recently Browsing   0 members

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