Dialogue system Quest Reward direct to Invector inventory ?
Dialogue system Quest Reward direct to Invector inventory ?
Compatible to give a reward of Dialogue system Quest direct Invector inventory ?
Re: Dialogue system Quest Reward direct to Invector inventory ?
Hi,
There is no built-in way to give an Invector inventory item. Not all of the Invector controllers have an inventory system, so it's not included in the Dialogue System integration. To add a reward, you must write a little code. Here are some different ways to do it:
1. Use the SendMessage() sequencer command. Add a script to the player that has a method named GiveInvectorItem:
In a dialogue entry node, use it like this:
2. Or you can register a C# method with Lua:
Use it in a dialogue entry node like this:
There is no built-in way to give an Invector inventory item. Not all of the Invector controllers have an inventory system, so it's not included in the Dialogue System integration. To add a reward, you must write a little code. Here are some different ways to do it:
1. Use the SendMessage() sequencer command. Add a script to the player that has a method named GiveInvectorItem:
Code: Select all
public string GiveInvectorItem(string itemName)
{
// Your code here to add Invector item to inventory.
}
- Speaker (actor): NPC quest giver
- Listener (conversant): Player
- Dialogue Text: "Here is a Fire Sword."
- Sequence: {{default}}; SendMessage(GiveInvectorItem, Fire Sword, listener)
2. Or you can register a C# method with Lua:
Code: Select all
void OnEnable()
{
Lua.RegisterFunction("GiveInvectorItemToPlayer", this, SymbolExtensions.GetMethodInfo(() => GiveInvectorItemToPlayer(string.Empty)));
}
public void GiveInvectorItemToPlayer(string itemName)
{
var player = GameObject.FindObjectWithTag("Player");
// Your code here to add itemName to player.
}
- Speaker (actor): NPC quest giver
- Dialogue Text: "Here is a Fire Sword."
- Script: GiveInvectorItemToPlayer("Fire Sword")