-
Notifications
You must be signed in to change notification settings - Fork 9
Factions
Factions describe relationship between NPCs and players in terms of three attitudes: aggressive, neutral and friendly. Factions can be used to configure NPCs hostility toward players, other NPCs or even regular mobs.
You can use it to create foes for the players and their allies. Under the hood, factions are just player states that are stored using pattern factions.FACTION_ID
. You can manipulate factions using /mp faction
command, or check faction scores using faction expression functions.
Factions can be managed in Mappet dashboard. The seventh panel in the left sidebar opens faction editor.
Once you pick or create a faction, you'd see an editor like this:
These two fields allow you to customize faction title's appearance in the player journal. In these case with lawyers
faction, it would look like this:
Visible expression allows you to configure the visibility of factions in the player journal. If it's empty, or evaluates to a non-zero value then the faction will be visible in the journal.
Default score determines what is the default score of the faction does player receive when it first time interacts with the faction (i.e. when the faction score is updated using /mp faction add
command). That is its only use.
Default attitude allows you to change the default attitude of NPCs toward other mobs excluding players, while Default attitude toward players allows you to change the default attitude of NPCs toward players.
Relations allow you setting up attitudes among NPCs with different factions. You can add a relation to other faction using by clicking on the ➕ icon from the right of the Relations label. It will open an overlay where you would be able to pick other factions, but only if there are other factions to choose from.
Once the relation to other faction was added, you can toggle the attitude. To remove an attitude toward other faction, simply right click on the faction's label, and click ➖ Remove this relation.
By clicking Configure its own relation... button, an overlay will popup. There you can edit the relationship for the player depending on the threshold scores.
You can create new thresholds by right clicking on the left part of the overlay under Faction relation editor title. There you can also remove currently selected relation threshold. You can also sort the position of threshold by drag-and-dropping them in the list.
Every threshold has title, color, score and attitude options, which should be self explanatory by now. These values will be used to display the progress of the faction progression in the player's journal, as well as determining which attitude do NPCs of the same faction as a player have.
The way it works is that every threshold's score provides the highest score, meaning player's faction score BELOW (less than, this doesn't affect the highest threshold in the list) a threshold's score will determine the final attitude. Consider following threshold setup:
Here would be the results of picking different faction scores:
Player's faction score | Resulted faction | Resulted attitude |
---|---|---|
-10 |
EVIL! | Aggressive |
0 |
Hostile | Aggressive |
99 |
Hostile | Aggressive |
100 |
Neutral | Passive |
199 |
Neutral | Passive |
200 |
Good | Friendly |
499 |
Good | Friendly |
500 |
Friendly | Friendly |
5000 |
Friendly | Friendly |
>1000000 |
Friendly | Friendly |
Hopefully that properly demonstrated this threshold system. Having multiple threshold systems is optional. 2 thresholds is a bare minimum, 3 is optimal and 4 and above is mostly decorative.
Here is a list of faction attitudes and what they do:
-
Aggressive
makes the NPCs attack the target entity -
Passive
ignores everything and everyone -
Friendly
(not used yet) immune to damage dealt by allies and protects allies
If parts of the wiki don't make sense with Mappet's latest version, or you weren't able to recreate examples (i.e. outdated information), feel free to report the page and section that is out of date on community's Discord server (make sure to mention which Mappet’s version did you use).