for example ...
The player wants to sell a weapon
NPC Will ask him ..how much do want ....
Then the player writes the price in inputfield
If the price that the player wrote, for example, is greater than 50
Npc will refuse
If the price is less than 50 ...Npc Will accpet
unity inputfield with Dialogue System Varibles
Re: unity inputfield with Dialogue System Varibles
Hi,
You can use the TextInput() sequencer command to show an input field. Most of the prefab dialogue UIs include an input field named "Text Field UI". It accepts any kind of text. You can either change its Unity UI InputField component to only accept numbers, or make a new one that only accepts numbers. Let's say you copy Text Field UI to a new one named "Number Field UI". Then use this Sequence:
Link an empty node after this. The empty node is required to make the conversation delay one node before checking the value. This is because conversations have to check one node ahead to support certain continue button modes.
The link two nodes from the empty node. Node 1:
You can use the TextInput() sequencer command to show an input field. Most of the prefab dialogue UIs include an input field named "Text Field UI". It accepts any kind of text. You can either change its Unity UI InputField component to only accept numbers, or make a new one that only accepts numbers. Let's say you copy Text Field UI to a new one named "Number Field UI". Then use this Sequence:
- Dialogue Text: "How much do you want?"
- Sequence: TextInput(Number Field UI, Amount, price)
Link an empty node after this. The empty node is required to make the conversation delay one node before checking the value. This is because conversations have to check one node ahead to support certain continue button modes.
The link two nodes from the empty node. Node 1:
- Dialogue Text: "Okay, I accept."
- Conditions: tonumber(Variable["price"]) <= 50
- Dialogue Text: "I refuse. That's too expensive."
- Conditions: tonumber(Variable["price"]) > 50
Re: unity inputfield with Dialogue System Varibles
thank you Very Much .
Re: unity inputfield with Dialogue System Varibles
Happy to help!