How to use the menu system that is on the extras page

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the menu system that is on the extras page

Post by Tony Li »

Hi,

Yes, you can use the LoadLevel() sequencer command to change scenes. Keep in mind that changing a scene won't, by itself, end the conversation. But if the LoadLevel() command is on an end node, the conversation will naturally end, like this example:

checkItemLoadLevel.png
checkItemLoadLevel.png (31.66 KiB) Viewed 409 times

I don't recall if you mentioned using any particular inventory system, so the example above uses the Dialogue System's Inventory Engine integration. The player response on the left checks if the player has zero of the required item. The response on the right checks if the player has the required item; if so, it loads the scene named "Schmargonrog".
User avatar
Bond of Blood
Posts: 21
Joined: Wed Mar 22, 2023 7:59 pm

Re: How to use the menu system that is on the extras page

Post by Bond of Blood »

User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the menu system that is on the extras page

Post by Tony Li »

Perfect! That's what I used for the example screenshot above.
User avatar
Bond of Blood
Posts: 21
Joined: Wed Mar 22, 2023 7:59 pm

Re: How to use the menu system that is on the extras page

Post by Bond of Blood »

Ok thank you, how would I use this to say take money from a player or give them money or another item. Also should I not have a dialogue system prefab in each scene and just have the one from the main menu just persist like I think it does, same with the save system.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the menu system that is on the extras page

Post by Tony Li »

Assuming you define an item type (e.g., "gold") to use as money, use the Lua functions to give or take money.

You can have a Dialogue Manager prefab in every scene. This makes it easier to playtest a scene directly instead of having to play from the main menu scene. To set this up, I recommend configuring the main menu scene's Dialogue Manager prefab just the way you want. Then drag this prefab from the Hierarchy view into the Project view. This will let you create a Prefab Variant, which is a prefab that inherits its values from the original prefab, except for any customizations you've made to the prefab variant.

Then add this same prefab variant to your other scenes. This way, if you make a change to the prefab variant in the Project view, that change will be reflected in the Dialogue Managers in all of your scenes.
User avatar
Bond of Blood
Posts: 21
Joined: Wed Mar 22, 2023 7:59 pm

Re: How to use the menu system that is on the extras page

Post by Bond of Blood »

Ok how would say I click on a door and load another scene?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the menu system that is on the extras page

Post by Tony Li »

If you're using the Dialogue System's Selector / Proximity Selector interaction system:
  • Add a collider, Usable component, and Dialogue System Trigger to the door.
  • If you're using a Selector, make sure the door's layer is set to a layer that's in the Selector's Layer Mask list.
  • On the Dialogue System Trigger, select Add Action > Play Sequence.
  • In the Sequence field, enter:

    Code: Select all

    LoadLevel(yourScene)
    where yourScene is the name of the scene to load.
  • If you want the player to appear in the scene at the position of a specific GameObject (typically an empty GameObject) in the scene, use:

    Code: Select all

    LoadLevel(yourScene, spawnpoint)
    where spawnpoint is the name of the GameObject. Then add a PositionSaver component to the player GameObject in the scene, and tick its Use Player Spawnpoint checkbox.
  • More info: LoadLevel()
User avatar
Bond of Blood
Posts: 21
Joined: Wed Mar 22, 2023 7:59 pm

Re: How to use the menu system that is on the extras page

Post by Bond of Blood »

When I walk up to the door I put the stuff on I don't get an interact to enter and nothing happens. I am not sure what I am doing wrong.
Attachments
image (7).png
image (7).png (62.61 KiB) Viewed 398 times
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the menu system that is on the extras page

Post by Tony Li »

Hi,

Are you using a Selector component whose Select At dropdown is set to Mouse Position?

If not, there are other options. But my instructions above assume that this is what you're doing.
User avatar
Bond of Blood
Posts: 21
Joined: Wed Mar 22, 2023 7:59 pm

Re: How to use the menu system that is on the extras page

Post by Bond of Blood »

Yes it was already like that. So I don't know what I am doing wrong.
Attachments
image (8).png
image (8).png (71.31 KiB) Viewed 390 times
Post Reply