A good place to start learning about factions is the faction section of the lexicon:
http://www.nwnlexicon.com/compiled/categoryfunction.reputationfaction.ht...
Factions are controlled in the Factions window. To view this page in NWN2 go to View > Factions. Here you will see a table showing how factions feel about each other.
Each row shows how the faction listed to the left feels about the faction in each column. To adjust how a faction feels about each faction, change the values in a row.
Note that there is no Player row. This is because the Player faction cannot have feelings one way or another for other factions. Note also that, by default, all factions except for hostile are 100% friendly to Players. This is a change from NWN1 defaults.
Faction is measured on a scale from 0 to 100. Anything 10 or lower means the creatures of a faction are hostile to the creatures in the target faction. Anything 90 or above means the creatures of a faction are friendly to the creatures of the target faction.
Hostile creatures attack on sight. Friendly creatures can share buffs (such as bless and other area of effect spells), and will usually not be affected by area of effect attacks (such as fireballs). Note that area of affect damage will be determined by server and campaign settings.
You can check to see how one faction feels about another using GetReputation():
int GetReputation(
object oSource,
object oTarget
);
You can dynamically adjust how one faction feels about another using the following functions.
| AdjustFactionReputation | Adjusts all factions members reputation in relation to another faction. |
| AdjustReputation | Adjusts positively or negatively how a whole faction views a specific person. |
| AdjustReputationWithFaction | Adjusts reputation of each member in PC's party with NPC's faction |
From the lexicon page on Adjust Reputation:
One method of maximizing the versatility of the AdjustReputation function in conjunction with custom factions is to create an inaccesible area devoted to holding custom faction holders. Let's say your custom faction is titled "CLO" . You would give a creature the tag "CustomFactionHolderCLO", set "CLO" as the faction on the creature and place it in the custom faction holder bed. Keep it isolated from all other custom faction holders. Do not check the "plot" flag on your creature (or this won't work). You are using a creature rather than a placeable because AdjustReputation does not work with placeables. Now, for example, if you want the entire custom faction to turn hostile against your PC, you would script:
AdjustReputation(PC, GetObjectByTag("CustomFactionHolderCLO"), -100)
You can even create a custom faction holder for a standard faction so that you can easily use AdjustReputation with that standard faction.
Also, you may want to read this thread:
http://nwn2forums.bioware.com/forums/viewtopic.html?topic=569037&forum=1...
In it, they are talking about the need to set UsesPersonalReactions to TRUE in the campaign settings. This requires you to use a campaign folder if you want to do any serious work with factions.
Create new a new faction by first going to View > Factions and openin the factions page.
One of the things that trip new builders up when dealing with factions is the "global" setting. If a faction is global, any faction adjustments for a creature will affect the entire faction.
So if you make a commoner go hostile, all creatures in the Commoner faction will go hostile across the whole module. Most builders find this annoying and most players are confused when this happens. The first response is that the module is broken.
Thanks to Parat for this post about factions in the Toolset forums, where he pointed out that the four standard factions cannot be changed from being global. This is a change from NWN1.
His solution is to "switch all commoners to a new commoner faction, which is not global, as it seems that you cannot deactivate the global setting for the existing factions?
While this may be a pain, it gives you more options for dealing with factions in general. It is obviously best to consider this at the start of developing your module.
Note that this will only affect you if you've scripted faction changes or if your pvp settings are set to allow players to hurt or otherwise anger Commoners, Defenders and Merchants.
Also, you may want to read this thread:
http://nwn2forums.bioware.com/forums/viewtopic.html?topic=569037&forum=1...
In it, they are talking about the need to set UsePersonalReactions to TRUE in the campaign settings. This requires you to use a campaign folder if you want to do any serious work with factions.
There is an issue where SetIsTemporaryEnemy and AdjustReputation don't work unless the campaign-level variable UsesPersonalReputations is set to TRUE. Follow these steps to make these work:
Quote: by TanisGorion
ok i found how it works, i must1-open campaign editor
2-create a new campagin
3-insert the new module created
3-put personal reputation on TRUE
4-click save campaign
5-Click on use this campaign on the module selected.
6-close and reopen the module.
Also note that you probably want to create custom factions, because the four static factions cannot act as non-global factions.
See more about both of these issues here:
http://nwn2forums.bioware.com/forums/viewtopic.html?topic=569037&forum=1...