Is there a resource for Faction functionsmemberships

Post » Thu Jun 21, 2012 8:10 pm

Hey guys -- complete and utter noob here so I appreciate any time you can take to answer my questions :)

I'm trying to build what should be a very simple mod. If you're wearing imperial armor, Stormcloaks will attack you on sight and v.v. It seems absurd to walk past a Stormcloak patrol wearing legion armor and for them just to walk on by. Conversely, if you're not wearing faction armor, there should be little or no response.

I'd assumed the logic behind this would be simple:

initialize: get currently equiped player armor -- call faction modifier function


Listener function: armor onChange get equiped armor -- call faction modifier function


Faction modifier function {

if armor == imperial, add stormcloaks to player enemy list

else if armor == stormcloak, add Imperials to player enemy list

else clear stormcloak & imperial from player enemy list

}



To start off, I thought I'd just try getting any stormcloak to attack me as I'm on the imperial side of the CW quests so should be a member of an imperial faction. I did achieve this by adding a whole bunch of imperial factions to the stormcloak faction as enemies, but this seems overly complicated. Surely there's one parent faction that distinguishes active stormcloak soldiers and active imperial soldiers which would make them fight if set to enemies?

... but there are SO many factions --all named similarly -- and I can't find a reference that spells out the differences.

For example, what's the difference between CWSonsFaction and CWSonsFactionNPC?

And to be honest, although I can code for web (php, javascript etc) I have no idea where to start with this.

Any and all help would be greatly appreciated.

THANKS!
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am

Post » Thu Jun 21, 2012 9:18 pm

Often Factions are used - by modders and by Beth - as temporary things to do exactly what you want (or to do the exact opposite, sometimes) - So you will see a confusing Faction or two in the lists.

You are attempting to do this the correct way ... But you will often be defeated by a few of the "temporary" factions that are intended (by Beth) to stop Imperials and Stormcloaks fighting at every single opportunity.

There is no such thing as a Master Faction. All factions are equal and their behaviour towards other factions controlled by the simple Ally/Friend/Enemy settings in Faction Relationships.

So ... Basically you must trawl through it all (and sometimes within Quest scripts and so on) to check what is being added to what faction and what that factions' relationship is with another (and whether that is changed by script following events)

So ... it's easy (ish) to do ... but dull and time-consuming
User avatar
how solid
 
Posts: 3434
Joined: Mon Apr 23, 2007 5:27 am

Post » Thu Jun 21, 2012 11:23 pm

thanks h4vent -- I spent some time playing around and discovered what you're saying. There seem to be a lot of overlapping factions, guards which are imperial, guards which are rebels, both which are members of a guard faction. Seems convoluted. And also difficult to decipher why/when those factions come into play.

:blink:

Seems I need a check in the logic to also query if the npc is a member of a guard faction; I think npcs should probably be a guard first, then aligned to either stormcloak or imperial. In otherwords, a guard should put personal feelings to one side, and just do their job.

However, without knowing what all the factions do in terms of gameplay, I'm still stuck as to what to check for. *sigh*

???
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Thu Jun 21, 2012 8:01 pm

Stormcloacks and imperial factions are enemy factions. If an aggresive member of one of the factions see a member of the other one, a combat will start.

This is alos true for any other enemy faction of NPC, so if you make that you or player faction are set to enemy of one faction when equipping a given armor, aggresive members of that faction will attack you on sight.

Non aggresive members won't attack you despite being enemies and very aggresive ones will attack any NPC not being friend or ally (yet by themselves or by faction allegiance). This is what happens with bandits. They are not enemies of you or your faction, but as they are very aggresive ane you are not their friend, they will attack you.

I don't think guards should be guards first. After all, if they see someone committing a murder and do nothing the immediate consecuences aren't as serious as if they do nothing when an enemy group appear.
User avatar
Danielle Brown
 
Posts: 3380
Joined: Wed Sep 27, 2006 6:03 am

Post » Thu Jun 21, 2012 11:48 am

As h4 has pointed out Factions are often used to force situations so you might want to do the same. That is... create your own factions. :) Ignore what other ones are defined and simply add your own to the Actors you decide to affect.

Amgepo is pointing out another issue you're going to encounter: Aggression. Each Actor has their own setting on the http://www.creationkit.com/AI_Data_Tab to consider. In one of my mods I discovered an interesting (annoying) fact... you cannot change an actor's aggression except through a spell effect that used either the Calm or Frenzy Archetype.
User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Thu Jun 21, 2012 8:01 am

Thanks for all the help guys!!!

This seemed like such a simple idea :)

I'd thought about custom factions, but then thought I'd need to somehow query who was around the player character and add them to the new faction. Seemed overly complicated considering there are all these factions already in-game. But I'll defer to experience if you think it's the best way to go. However, I've no idea how to create a custom faction

I'd also thought about using a spell on the imperial armor to increase aggression. Now this I can do :)
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Thu Jun 21, 2012 9:31 am

There are various approaches, but your original method seems like it should work, with some caveats (notably that there are certain scenes and quests where Imperials and Stormcloaks need to both be on-screen without one group attacking the other, or the player).

You can double-click on the factions in the CK to see what they do. There are not true "master" factions but there is a hierarchy; what you're thinking of as master factions, Bethesda tends to splt up into two or three different factions to control 1) who is allied to the group, 2) who is an enemy to the group, and (sometimes) 3) what the group does about criminals. This allows relationships like "actor X is sympathetic to a faction, but members of the opposite faction shouldn't attack them on sight."

The key factions seem to be CWImperialFaction/CWImperialFactionNPC and CWSonsFaction/CWSonsFactionNPC. The "NPC" factions are what define hostility to the opposing faction, so those are the first ones I'd suggest trying SetPlayerEnemy() on.
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Thu Jun 21, 2012 2:41 pm

Great info. Thank you!

I was indeed getting good results with setting xxxFactionnpc to enemy in my simple test, so that looks like it may be the easiest route to take.

The next issue is really a gameplay one: should guards be guards first and leave their CW sympathies to one side -- or should they be sympathisers first and disregard their duties to the town?

I't seems plausible whichever way, but the latter seems less prone to intefering with anything quest related. However, I'm a slow player so haven't taken in a lot of quests.

So new question to the knoweldgeable :)

Would adding StormcloakFactionNPC to playerEnemy when wearing imperial armour break anything?

Again, many thanks!!!!
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Thu Jun 21, 2012 6:38 pm

That isn't really a valid question ... Making any change will break something ... But then the point of mods is to give people different game experiences than Vanilla.

FROM MEMORY: What you are proposing is unlikely to break any of the main quests, but it may make some of them harder to complete (or even to start) - walking into the wrong town is going to mean a fight, that wouldn't necessarily break a quest ... though it could ... but it will effect it

Only testing is going to show up what exactly has changed, and you are making a fundemental change, so lots of testing ...

In the end, it's up to you ... If you believe the game would be better/different with a more realistic Civil War then that is the mod you should make.

:)
User avatar
Lillian Cawfield
 
Posts: 3387
Joined: Thu Nov 30, 2006 6:22 pm


Return to V - Skyrim