Page 2 of 2

Re: Switching Scenes Using Sequence

Posted: Fri Feb 03, 2017 9:41 pm
by harumin
Please do. That would be much appreciated :)

Re: Switching Scenes Using Sequence

Posted: Fri Feb 03, 2017 11:49 pm
by Tony Li
Here's an example: SInventoryConversationExample_2017-02-03.unitypackage

It has a _README.txt file that explains how it's set up.

Re: Switching Scenes Using Sequence

Posted: Sat Feb 04, 2017 7:52 am
by harumin
Thanks Tony :) This is exactly what I've been looking for. As for the "LastItem", how do I make a condition? For example, there is a specific vendor that sells a specific Item. If the player bought that specific Item, it will trigger a specific conversation. Can I compare it to a lua variable from the variables tab in the Dialogue Manager? or do I have to make a script for those?

Re: Switching Scenes Using Sequence

Posted: Sat Feb 04, 2017 9:12 am
by Tony Li
Hi,

To make a condition on the last (most recent) item that the player bought:

1. Add a variable named "LastItem" (with that exact spelling) to your dialogue database. This step is optional, but it makes it easier to use the Lua wizard to make a condition.

2. Check that variable in a Condition field in your conversation.

Here's an updated example that does this: SInventoryConversationExample_2017-02-04.unitypackage


On the other hand, to check if the player has an item, regardless of when he bought it or picked it up, use the GetItemAmount() Lua function. For example, you could put this in the Conditions field:

Code: Select all

GetItemAmount("Player", "Shield") >= 1
This checks if the Player has at least one Shield item.

Re: Switching Scenes Using Sequence

Posted: Sun Feb 05, 2017 4:28 am
by harumin
Thanks a lot Tony! :D I also used the same method to tell the player that they sold the right Item to the vendor :D Thank you very much

Re: Switching Scenes Using Sequence

Posted: Sun Feb 05, 2017 9:17 am
by Tony Li
Glad to help!