It seems to me that I could use the Dialogue System to set up a small lever puzzle by setting a bool condition on one lever and requiring the player to press a different lever before the confition is met by having a script on the second lever to set the bool to true. Am I far off and would I use an Alert or a short dialogue?
Any help is appreciated. Thanks
Lever puzzle
-
- Posts: 46
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Lever puzzle
Hi,
Sure, you can use an alert or a bark.
You don't need any scripting at all. You could use these steps:
1. Add a DS Boolean variable such as "PulledFirstLever" whose Initial Value is false.
2. On the first lever, add a Usable component and a Dialogue System Trigger set to OnUse. Select Add Action > Run Lua Code. Set the Lua Code field to: You could also use Add Action > Play Sequencer to play audio (e.g., maybe a click audio), or Add Action > Show Alert for some visual feedback.
3. On the second lever, add a Usable component and a Dialogue System Trigger set to OnUse. Set the Conditions > Lua Conditions to: Then select Add Action and some action such as Bark or Alert or Play Sequence to do something when the second lever is pulled.
4. On the second lever, you could also add another Dialogue System Trigger set to OnUse -- but this time set the Conditions > Lua Conditions to: Then select Add Action and some action such as Show Alert: "You must pull the first lever before pulling this lever."
5. Use a Selector or Proximity Selector to interact with these Dialogue System Triggers. If you're using your own interaction system instead, you can configure your interaction system to call the Dialogue System Triggers' OnUse() methods.
Sure, you can use an alert or a bark.
You don't need any scripting at all. You could use these steps:
1. Add a DS Boolean variable such as "PulledFirstLever" whose Initial Value is false.
2. On the first lever, add a Usable component and a Dialogue System Trigger set to OnUse. Select Add Action > Run Lua Code. Set the Lua Code field to:
Code: Select all
Variable["PulledFirstLeverl"] = true
3. On the second lever, add a Usable component and a Dialogue System Trigger set to OnUse. Set the Conditions > Lua Conditions to:
Code: Select all
Variable["PulledFirstLeverl"] == true
4. On the second lever, you could also add another Dialogue System Trigger set to OnUse -- but this time set the Conditions > Lua Conditions to:
Code: Select all
Variable["PulledFirstLeverl"] ~= true
5. Use a Selector or Proximity Selector to interact with these Dialogue System Triggers. If you're using your own interaction system instead, you can configure your interaction system to call the Dialogue System Triggers' OnUse() methods.
-
- Posts: 46
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Lever puzzle
That seems so easy! I've been torturing players for years with all sorts of lever puzzles and secret switches and so happy not to have to use script. Thanks so much for your wonderful help and for the Dialogue System.