Page 2 of 4

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

Posted: Mon Apr 10, 2023 7:46 pm
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 390 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".

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

Posted: Mon Apr 10, 2023 10:23 pm
by Bond of Blood

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

Posted: Mon Apr 10, 2023 10:27 pm
by Tony Li
Perfect! That's what I used for the example screenshot above.

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

Posted: Mon Apr 10, 2023 10:41 pm
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.

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

Posted: Mon Apr 10, 2023 10:50 pm
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.

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

Posted: Mon Apr 17, 2023 9:38 pm
by Bond of Blood
Ok how would say I click on a door and load another scene?

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

Posted: Mon Apr 17, 2023 9:47 pm
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()

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

Posted: Tue Apr 18, 2023 1:44 am
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.

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

Posted: Tue Apr 18, 2023 8:00 am
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.

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

Posted: Tue Apr 18, 2023 11:57 pm
by Bond of Blood
Yes it was already like that. So I don't know what I am doing wrong.