I want the NPC to give the player an item for completing a quest. How can I set this up? Is there a tutorial on this?
Does this need to be connected with my third person controller inventory? I assume it would.
But maybe I need to set up some sort of inventory system first?
Present Reward item successful quest - give gun
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Present Reward item successful quest - give gun
Last edited by supadupa64 on Sat Apr 02, 2016 11:10 pm, edited 1 time in total.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: Present Reward item successful quest - give gun
Hi,
First make sure you've followed the Third Person Controller Support Player Character Setup.
When the player completes a quest during a conversation -- for example, when the NPC says something like: "Thanks! Here's a pistol." -- use the tpcPickupItem() Lua function in the dialogue entry node's Script field. The TPC Lua functions are defined here.
Unfortunately you can't use the Lua wizard ("..." button) for this. You'll have to type in the command manually into the Script field, such as:
The first argument is the character name. If you leave it blank, the player will get the item.
The second argument is the name of the item as defined in TPC's inventory system.
The third argument can be true or false. If it's true, the character (player) switches to the item immediately without playing an equip animation. If it's false, the character plays a complete equip animation before equipping the weapon.
If the player completes a quest outside of a conversation, you can use a Lua Trigger to call tpcPickupItem().
First make sure you've followed the Third Person Controller Support Player Character Setup.
When the player completes a quest during a conversation -- for example, when the NPC says something like: "Thanks! Here's a pistol." -- use the tpcPickupItem() Lua function in the dialogue entry node's Script field. The TPC Lua functions are defined here.
Unfortunately you can't use the Lua wizard ("..." button) for this. You'll have to type in the command manually into the Script field, such as:
Code: Select all
tpcPickupItem("", "Pistol", true)
The second argument is the name of the item as defined in TPC's inventory system.
The third argument can be true or false. If it's true, the character (player) switches to the item immediately without playing an equip animation. If it's false, the character plays a complete equip animation before equipping the weapon.
If the player completes a quest outside of a conversation, you can use a Lua Trigger to call tpcPickupItem().