Skip to content

Commit

Permalink
Updated Factions Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
muit committed Aug 8, 2018
1 parent a2f0e23 commit a0d6e91
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Factions Extension Documentation

* [Implementation](implementation.md)
- Documentation
* [Implementation](documentation/implementation.md)
* [Usage](documentation/usage.md)
* [Installation](installation.md)
* [Usage](usage.md)
Binary file added Docs/documentation/img/relations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/documentation/img/rename-faction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/documentation/img/settings-factions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/documentation/img/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Docs/documentation/implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Implementation

## Blueprints

*Check the **[Test Project](https://mega.nz/#!JMowlKCA!wZv-L6oNSJCwDw1CUbTFyjPOXvd6viB-QLgK-u36xtY)** for an in-engine example*

### Adding the interface

For an actor to have a faction, we need to add a FactionAgentInterface.
This will allow the system to set and get the current interface.

<img align="right" width="300" height="100%" src="https://i.imgur.com/adet7y6.png"> <img align="right" width="200" height="100%" src="https://i.imgur.com/IJS8qG6.png">

To add an interface we have to go into **Class Settings**

From here we click on **Add**, inside Interfaces and search for FactionAgentInterface

### Getting and Settings the Faction

Factions require your actor to define how to get and set a faction. That can be done overriding **GetFaction** and **SetFaction**.

A common implementation would be to have a **class variable** (of type *"Faction"*), and then return it at GetFaction and set it at SetFaction:

![](https://i.imgur.com/imuFDXn.png)

![](https://i.imgur.com/Cf7QZju.png)

### Factions in Controllers

Sometimes you may want a controller to share a faction with its controlled pawn or character.

This process is exactly the same as before, except that instead of getting and setting a variable, we will get and set the faction from our pawn.

## C++
34 changes: 25 additions & 9 deletions Docs/documentation/usage.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
# Usage

Factions can be edited from *Project Settings*, inside *Game* category, *Factions* tab.
All settings can be edited from **Project Settings -> Game -> Factions** tab.

<img width="600" height="100%" src="https://i.imgur.com/5hKfoHF.png">
![Settings](img\settings.png)



### Editing Factions
## Factions

Factions are defined as an array to be edited and every faction will have its own properties like color or default attitudes.
Factions settings are defined by right and left areas.

<img width="400" height="100%" src="https://i.imgur.com/YRl4Kmk.png">
**At the left** you have a list of all factions, with a little search box in case you have more than you can deal with.

This information is available on runtime though
**At the right** you will find all the properties of a selected faction (which was selected by just clicking on it on the list).

![Factions Settings](img\settings-factions.png)



You can also rename factions by double clicking on them.

![Rename Faction](img\rename-faction.gif)



All Faction information can be read on runtime too:

<img width="200" height="100%" src="https://i.imgur.com/4SOhCGb.png">



### Editing Relations
## Relations

Relations define how will two factions interact to each other.
<img width="400" height="100%" src="https://i.imgur.com/ihngM3D.png">

By default there are three possible attitudes: **Hostile**, **Neutral** and **Friendly**
In this example, Brotherhood and Triggermen are enemies:

![Relations](img\relations.png)

By default there are three possible attitudes: **Hostile**, **Neutral** and **Friendly**

Binary file modified Docs/downloads/book.epub
Binary file not shown.
Binary file modified Docs/downloads/book.mobi
Binary file not shown.
Binary file modified Docs/downloads/book.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion FactionsExtension.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Category": "Piperift",
"CreatedBy": "Piperift",
"CreatedByURL": "http://piperift.com/",
"DocsURL": "",
"DocsURL": "https://piperift.com/FactionsExtension/",
"SupportURL": "[email protected]",
"EngineVersion": "4.19.0",
"EnabledByDefault": true,
Expand Down

0 comments on commit a0d6e91

Please sign in to comment.