Switching Scenes Using Sequence

Announcements, support questions, and discussion for the Dialogue System.
harumin
Posts: 29
Joined: Fri Dec 30, 2016 10:43 am

Re: Switching Scenes Using Sequence

Post by harumin »

Please do. That would be much appreciated :)
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching Scenes Using Sequence

Post 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.
harumin
Posts: 29
Joined: Fri Dec 30, 2016 10:43 am

Re: Switching Scenes Using Sequence

Post 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?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching Scenes Using Sequence

Post 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.
harumin
Posts: 29
Joined: Fri Dec 30, 2016 10:43 am

Re: Switching Scenes Using Sequence

Post 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
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching Scenes Using Sequence

Post by Tony Li »

Glad to help!
Post Reply