FCS: Dialogue

### Overview

This is where individual lines of dialogue are connected in order to control what lines a character says and any character interactions associated with those lines. However the Dialogue category does not control when it gets triggered, that is usually handled through Dialogue Packages with a few other exceptions.

### Data

* **General**
	+ **Name:** The name of the Dialogue
	+ **Can Talk to Enemy:**
	+ **Run only Once:**
	+ **Conditions:** Conditions affect whether a given line of dialogue will play or be skipped over, depending on whether all the given conditions are true or not. [Cattrina]: To my experience it looks more like an OR clause, not AND
	+ **Effects:** Effects added to a line can be used to perform different actions on the player or the person speaking the line.
	+ **Sidebar Addons:** Additional conditions and effects that can be added to a line of dialogue, with a target or property that can be specified by the user.
* **Dialogue Line Data**
	+ *Line Data marked with \* only appears for the very first line of the Dialogue window.*
	+ **General**
		- **For Enemies\*:** True if this dialogue can still be triggered by player if enemies.
		- **Monologue\*:** True if this has no player lines. Every line is the speaker. [Cattrina]: use this if you have a custom race that does not create a portrait. Can't make them have a conversation with the player, but at least you can make them say something to player, or trigger DA\_talk\_to\_leader
	+ **Main**
		- **Chance Permanent:** Percentage chance that the character will HAVE this dialogue option. Not "use", "have". It's a permanent assignment or absence, and is saved forever. Used to make rare and occasional choices. Rarely used.
		- **Chance Temporary:** Percentage chance that the character will USE this dialogue option. It can be used for things like random decisions.
		- **Repetition Limit:** Sets a timed limit on how frequently this line can be played.
		- **Score Bonus:** Sets the priority of this line. A line with a higher score will be played over a line with a lower score assuming all its conditions are true.
		- **Target is Type:** Only plays if the ***target*** is of this type.
	+ **Misc**
		- **Only Once\*:** Not used.
		- **Speaker\*:** Not used
		- **Owner:** Not used
	+ **Text**
		- This is where lines of dialogue are added. If there are multiple text lines, one will be chosen at random.
	+ **Special**
		- **Locked\*:** If this dialogue is locked, then it will only play once it has been unlocked by another line via the "unlocks" action on the sidebar.
		- **One at a Time\*:** Prevents more than one person at a time from running this dialogue.

### Sidebar Addons

This is a list of additional conditions and effects that can be given to a dialogue line. They have editable values that gives you an additional level of control.

* **AI Contract**
	+ “Activates the given AI package as a contract job, val0 is the number of hours it lasts for.”

* **Change AI**
	+ “Permanently changes the AI package, doesn’t affect the AI Contract. BE CAREFUL, remember it will change the whole squad, slaves and masters. May want to use with DA\_SEPERATE\_TO\_OWN\_SQUAD”

* **Change Relations**
	+ “Adjusts the relations with the given faction by this amount.”

* **Crowd Trigger**
	+ “Triggers the given dialogue to start on all other squad members. Use this for things like group cheering, laughing, and war cries. Should usually be 1 liners. The number is % of squad members to trigger.”

* **Give Item**
	+ “Action: Give target this item. Will conjure the item out of thin air.
	+ Will provide the player with a “received item” notification, even when the item was given to an NPC instead.
	+ Items such as weapons, armor, and limbs cannot be selected

* **Has Package**
	+ “Condition: Has a specific dialogue package. Refers to speaker only, unless its on an interjection node.”

* **In Town Of**
	+ “Adds a condition: That we must currently be in town/base belonging to the given faction.”
	+ True when inside or near a town owned by the given faction

* **Interrupt**
	+ “If the player interrupts us with a talking event, this will be the conversation chosen. Reset at the end of conversation, or until changed.”
	+ Commonly used for characters that are trying to talk with the player, such as guards when they want to search you.

* **Is Character**
	+ “Condition: Is a specific character. Refers to speaker only, unless its an interjection node.”

* **Lock Campaign**
	+ “Essentially sets the campaign’s [territorial] setting to false.”

* **Locks**
	+ “Locks the given dialogue, use for special cases when you gotta lock something?”
	+ Commonly used to relock dialogue that was previously unlocked

* **My Faction**
	+ “Adds a condition: I belong to the given faction.”

* **My Race**
	+ “Adds a condition: My race is any of the given races. Multiple races are treated as an OR condition.”

* **My Subrace**
	+ “My specific sub-race. Multiple races are treated as an OR condition.”

* **No Target Race**
	+ “Adds a condition: Target squad has NO member who is any of the given races. Multiple races is treated as an OR condition.”

* **Target Carrying Character**
	+ “Adds a condition: Target is carrying a specific character. Refers to target.”

* **Target Faction**
	+ “Adds a condition: Target belongs to the given faction.”

* **Target Has Item**
	+ “Adds a condition: Target has this item, or any of these items.”
	+ Items such as weapons, armor, and limbs cannot be selected

* **Target Has Item Type**
	+ “Adds a condition: Does the target have an item of the same TYPE as this one (eg. narcotics, meds, food)”
	+ Items such as weapons, armor, and limbs cannot be selected

* **Target Race**
	+ “Adds a condition: Target squad has a member who is any of the given races. Multiple races is treated as an OR condition.”

* **Trigger Campaign**
	+ “Triggers the given campaign, which will start after a random number of hours between val0-val1, val2 is %chance (is absolute chance, so if you list 2 things which total to less than 100, then there is a chance of nothing)”

* **Unlock But Keep Me**
	+ “Unlocks the given dialogue, must be actually in the NPC’s dialogue package somewhere for it to work. Will NOT cause the dialogue to then become locked.”

* **Unlock Campaign**
	+ “Essentially sets the campaign’s [territorial] setting to true, so doesn’t actually trigger it, just makes it possible.”

* **Unlocks**
	+ “Unlocks the given dialogue, must be actually in the NPC’s dialogue package somewhere for it to work. Will cause THIS dialogue to then become locked. Used for conversations that progress to other conversations in stages.”

* **World State**
	+ “Adds this world state as an AND condition. 1=true, 0=false”

### Conditions

A list of conditions that can be added to a line to determine if it plays. If all the conditions are met, then the line will be considered valid and can play. Note that some conditions rely on a true/false value. In these cases 1=true and 0=false.

* **DC\_Relations**

* **DC\_Playermoney**
	+ Returns the number of cats the player has

* **DC\_Reputation**

* **DC\_Carrying\_Bounty\_Alive**
	+ Should return true if the character is carrying someone with a bounty on them that is alive

* **DC\_Carrying\_Bounty\_Dead**
	+ Should return true if the character is carrying someone with a bounty on them that is dead

* **DC\_Faction\_Variable**

* **DC\_Imprisoned\_By\_Target**

* **DC\_Imprisoned\_By\_Other**
* **DC\_Is\_A\_Trader**
* **DC\_Faction\_Rank**
	+ Returns the character's rank in the given faction.
* **DC\_Building\_Is\_Closed\_And\_Secured**
* **DC\_Player\_Tech\_Level**
	+ Returns the highest tech level researched by the player.
* **DC\_Num\_Dialogue\_Events\_Repeats**
* **DC\_Is\_Imprisoned**
* **DC\_Imprisonment\_Is\_Deathrow**
* **DC\_Target\_In\_Talking\_Range**
	+ Checks to see if the ***Target*** is nearby. Used for NPCs such as gate guards to prevent them from attempting to talk to the player when they are spotted from far away.
* **DC\_In\_My\_Building**
* **DC\_Target\_Last\_Seen\_X\_Hours\_Ago**

* **DC\_Is\_Leader**
	+ Returns true if the character is the squad leader
	+ For example the squad leader of a trade caravan is usually the main trader that all the animals and caravan guards follow
* **DC\_Met\_Target\_Before**
* **DC\_Weaker\_Than\_Me**
	+ True if this character has lower stats than ***Me***
	+ Unclear how exactly this is calculated.
* **DC\_Stronger\_Than\_Me**
	+ True if this character has higher stats than ***Me***
	+ Unclear how exactly this is calculated.
* **DC\_Has\_Tag**
	+ Checks to see if the selected character has this tag. Some may only be applied to the ***Target***.
	+ **None:**
	+ **My Intruder:**
	+ **My Lifesaver:**
	+ **Freed Me:**
	+ **Stole From Me:** True if the ***Target*** (usually player) has previously tried to steal from ***Me***
	+ **My Captor:**
	+ **Friendly Aquiantence:**
	+ **Defeated My Squad:**
	+ **Squad Lost to Me:**
	+ **Killed My Friend:**
	+ **I Screwed this Guy:**
	+ **Max:**
* **DC\_Is\_Ally**
* **DC\_Is\_Enemy**
* **DC\_Personality\_Tag**
	+ Can chose a personality tag that a character can have. True if the selected character has that tag.

* **DC\_Broken\_Leg**
	+ True if the character has a leg with health below 0

* **DC\_Broken\_Arm**
	+ True if the character has an arm with health below 0
* **DC\_Damaged\_Head**
	+ True if the character's head has health below 0
* **DC\_Nearly\_KO**
	+ Checks if the character is low on health and is close to being KOed. Not affected by hunger meter.
	+ Do not mistake this for **DC\_Is\_Nearly\_KO**, which is broken.
* **DC\_In\_A\_Non\_Player\_Town**
	+ Checks if the character is in a town, not including ones owned by the player.

* **DC\_Is\_Running**
	+ True if the character is both at a running speed and is moving away from ***Me***
	+ Always returns true when run on ***Me***

* **DC\_Cops\_Around**
	+ Returns true if there are law-enforcing guards or patrols nearby
* **Null\_Null\_\_\_DC\_Target\_Squad\_Size**
	+ Not used?
* **DC\_Squad\_Size**
	+ Returns the number of people in that person’s squad

* **DC\_Is\_Player**
	+ Returns true if the character is a member of the player’s faction
* **DC\_Num\_of\_Backpacks**
	+ Returns the total number of backpacks that the character's squad is carrying.
* **DC\_Squad\_Only\_Animals**
	+ True if the character's squad only contains animals.
* **DC\_Is\_Outnumbered**
	+ Checks to see if this character's squad is outnumbered by the other character's squad.
* **DC\_Bounty\_Amount\_Percieved**
* **DC\_Is\_KO**
	+ True if the character is currently KOed.
* **DC\_Is\_Nearly\_KO**
	+ Not used. Always returns true.
* **DC\_Squad\_Is\_Down**
* **DC\_Is\_Dead**
	+ True if the character is dead.
* **DC\_Is\_Female**
	+ Returns true if the character is female, or false if they are male. Genderless races such as Hivers are considered to be male.
* **DC\_Carrying\_Someone\_To\_Enslave**
	+ True if the character is carrying another character that can be enslaved. Commonly used with the **Enslave\_Target\_Carried\_Person** effect.
* **DC\_Bounty\_Amount\_Actual**
* **DC\_Im\_Unarmed**
* **DC\_Town\_Has\_Fortification\_Walls**
* **DC\_Target\_Is\_My\_Mission\_Target**
	+ Likely checks to see if the ***Target*** is the same ***Target*** as the character's current contract.
* **DC\_My\_Mission\_Is\_Friendly**
* **DC\_I\_Love\_This\_Guy**
* **DC\_I\_Hate\_This\_Guy**
* **DC\_I\_Should\_Screw\_This\_Guy\_Over**
* **DC\_I\_Should\_Help\_This\_Guy**
* **DC\_In\_Combat**
	+ True if the character is currently in the middle of combat.
* **DC\_Within\_Town\_Walls**
	+ True if this character is inside a town's walls. The walls seem to have to be completely enclosed for this to work.
* **DC\_Town\_Walls\_Locked\_Up**
* **DC\_Is\_Slave**
	+ True if the character is a slave.
* **DC\_Has\_A\_Base\_Nearby**
* **DC\_Target\_Is\_Slave\_Of\_My\_Faction**
* **DC\_Is\_Escaped\_Slave**
* **DC\_Is\_In\_Locked\_Cage**
* **DC\_Wearing\_Locked\_Shackles**
	+ True if the character is currently wearing locked shackles.
* **DC\_Is\_Same\_Race\_As\_Me**
	+ True if the character is the same race as ***Me***.
* **DC\_Can\_Afford\_Bounty**

* **DC\_Is\_Sneaking**
	+ Should return true if the character is sneaking.

* **DC\_Is\_Indoors**
	+ Returns true if the character is inside a building.

* **DC\_Has\_Illegal\_Item**
	+ Returns true if the character has hashish in their inventory
* **DC\_Using\_My\_Training\_Equipment**
	+ True if the character is using training equipment owned by ***Me***'s faction

* **DC\_Starving**
	+ Returns true if the character has low hunger (hunger meter is below 200).

* **DC\_Mixed\_Gender\_Group**
	+ Should return true if the squad has both male and female characters in it.
* **DC\_Town\_Level\_Current\_Location**
* **DC\_Players\_Best\_Town\_Level**
* **DC\_In\_A\_Player\_Town**
	+ True if the character is inside a town owned by the player.
* **DC\_Target\_Character\_Exists**
* **DC\_Is\_Recruitable**
	+ True if the character meets the leveling conditions for recruitment.

* **DC\_Has\_AI\_Contract**
	+ Returns true if the character currently has an AI contract (when hiring mercenaries, when finding the broken ones, etc.)
	+ Sometimes only the squad leader will have the contract, such as with mercenaries. In these cases the condition should also be run along with DC\_IS\_LEADER in order to work.

* **DC\_Has\_Robot\_Limbs**
	+ Returns true if the character has robotic limbs attached.
* **DC\_End**

### Effects

Effects are actions that can be used on the speaker or the player.

* **DA\_None**
* **DA\_Trade**
	+ Opens the trade window for the player to trade with the character they are talking to.

* **DA\_Talk\_To\_Leader**
* **DA\_Join\_Squad\_With\_Edit**
	+ Character joins squad, opens the character editor for that character. (make sure this is at the end of the dialogue or it will lock the game.)

* **DA\_Affect\_Relations**
* **DA\_Affect\_Reputation**
* **DA\_Attack\_Chase\_Forever**
	+ Tells this character to chase down and attack the character they are talking to.
* **DA\_Go\_Home**
* **DA\_Take\_Money**
	+ Takes away the specified number of cats from the player.
* **DA\_Give\_Money**
	+ Gives the player the specified number of cats.
* **DA\_Pay\_Bounty**
* **DA\_Character\_Editor**
* **DA\_Force\_Speech\_Timer**
	+ Makes the line of dialogue appear for a set amount of time before continuing the conversation.
* **DA\_Declare\_War**
* **DA\_End\_War**
* **DA\_Clear\_AI**
* **DA\_Follow\_While\_Talking**
	+ Causes character to say following dialogue at the target while following them.
* **DA\_Thug\_Hunter**
* **DA\_Join\_Squad\_Fast**
	+ Character joins squad without opening the character editor for that character.
* **DA\_Remember\_Character**
* **DA\_Flag\_Temp\_Ally**
	+ Temporarily marks this character as an ally.
* **DA\_Flag\_Temp\_Enemy**
	+ Temporarily marks this character as an enemy.
* **DA\_Mates\_Kill\_Me**
* **DA\_Make\_Target\_Run\_Faster**
* **DA\_Give\_Target\_My\_Slaves**
* **DA\_Tag\_Escaped\_Slave**
* **DA\_Free\_Target\_Slave**
* **DA\_Merge\_With\_Similar\_Squads**
* **DA\_Seperate\_To\_My\_Own\_Squad**
* **DA\_Arrest\_Target**
	+ Causes the character to try and arrest the target by attacking them and bringing them to a cage
* **DA\_Arrest\_Targets\_Carried\_Person**
	+ Arrest the person that the ***Target*** is carrying. Used for submitting bounties.
* **DA\_Attack\_Town**
* **DA\_Assign\_Bounty**
* **DA\_Crime\_Alarm**

* **DA\_Run\_Away**
	+ Causes the character to run away from the other speaker.
* **DA\_Increase\_Faction\_Rank**
* **DA\_Lock\_This\_Dialogue**
* **DA\_Assault\_Phase**
* **DA\_Retreat\_Phase**
* **DA\_Victory\_Phase**
* **DA\_Enslave\_Target\_Carried\_Person**
	+ Tells ***Me*** to enslave the person that the ***Target*** is carrying.
* **Choose\_Slaves\_Selling**
	+ Opens the player's UI window to sell their characters as slaves.
* **Choose\_Slaves\_Buying**
	+ Opens the player's UI window to buy slave's freedom.
* **Choose\_Prisoner\_Bail**
	+ Opens the player's UI window to choose a prisoner to bail out.
* **Choose\_Conscription**
* **Choose\_Recruiting**
* **Choose\_Hiring\_Contract**
* **Surrender\_Non\_Humans**
* **Choose\_Animal\_Buying**
* **DA\_Clear\_Bounty**
* **DA\_Player\_Sell\_Prisoners**
* **DA\_Player\_Surrender\_Different\_Race**
* **DA\_Summon\_My\_Squad**
* **DA\_Remove\_Slave\_Status**
* **DA\_Open\_Nearest\_Gate**
* **DA\_Attack\_Stay\_Near\_Home**
	+ Tells the character to attack the character they are speaking to, but not to travel too far away from their home town.
* **DA\_Massive\_Alarm**
* **DA\_Attack\_If\_No\_Coexist**
* **DA\_Knockout**
* **DA\_End**