Modify Affinity using Dialogue System & LUA
Posted: Thu Jul 27, 2017 3:02 pm
Hello!
I'm implementing a very simple Affinity System using Love/Hate and Dialogue System on a prototype, where I have an NPC (with it's own faction) and the conversation branches where some options will modify the affinity with the player (just for testing, so it's a really simple Dialogue Tree) and modify which branch of dialogue will appear to the player.
I'm using LUA Scripting at certain dialogues that will modify the Affinity, but It appears as they are only Setting, not Modifying the value. For example, I have a dialogue where the NPC will decrease the Affinity for the player by 1, and another that will increase by 1. But even if I always choose one or the other, the affinity never goes different than 1 or -1. It doesn't even go to Zero! I'm probably missing something here. Can anyone help?
Below are scripts being used at the Player Dialogues:
Scripts:
ModifyAffinity("RedInmate", "Player", -1)
ModifyAffinity("RedInmate", "Player", 1)
Thanks!
I'm implementing a very simple Affinity System using Love/Hate and Dialogue System on a prototype, where I have an NPC (with it's own faction) and the conversation branches where some options will modify the affinity with the player (just for testing, so it's a really simple Dialogue Tree) and modify which branch of dialogue will appear to the player.
I'm using LUA Scripting at certain dialogues that will modify the Affinity, but It appears as they are only Setting, not Modifying the value. For example, I have a dialogue where the NPC will decrease the Affinity for the player by 1, and another that will increase by 1. But even if I always choose one or the other, the affinity never goes different than 1 or -1. It doesn't even go to Zero! I'm probably missing something here. Can anyone help?
Below are scripts being used at the Player Dialogues:
Scripts:
ModifyAffinity("RedInmate", "Player", -1)
ModifyAffinity("RedInmate", "Player", 1)
Thanks!