If you are requesting technical assistance with Twine, please specify:
Twine Version: Twine version 2.3.16
Story Format: Harlowe 3.2.3
Hello.
So, Is there a way to print out text once the player selects a dropdown option (without them needing to click on a link)?
This is my Passage so far:
(The variables and text are placeholders to illustrate better what I’m trying to accomplish)
(Set: $ColorList to (a: "yellow", "blue", "red"))
(dropdown: bind $DropdownColor, "Choose a Color", ...$ColorList)[
(link-rerun:"Color:")[(unless: $ColorList is "Choose a Color")[
You have chosen (link-rerun: '$DropdownColor')[
(if: $DropdownColor is "blue")[. "Ah, the color of the ocean"]
(if: $DropdownColor is "red")[. "The beautiful shades of fire"]
(if: $DropdownColor is "yellow")[. "Yellow like the sun"]] ]
]
]
(link:"Im Done")[(goto:"Somewhere else")]
In this cas, the player needs to click on the link “Color:” to get some text and a return of the DropdownColor variable
And I’m aiming for something like this or similar :
(Set: $ColorList to (a: "yellow", "blue", "red"))
(dropdown: bind $DropdownColor, "Choose a Color", ...$ColorList)[
(unless: $ColorList is "Choose a Color")[
(replace: ?ColorSelected)[
(print: $DropdownColor)]]
You have chosen: []<ColorSelected|
]
(link:"Im Done")[(goto:"Somewhere else")]
But even if the DropdownColor variable changes it’s value, it doesn’t return any text.
It doesn’t print the DropdownColor or replace the ColorSelected hook
My goal would be for the dropdown, once a value was selected, displays some text, or shows or replaces a hook, or gives any visual indication that the value was indeed changed.
Reasoning:
I’m making a test-game with magic and stuff, where a mage player can prepare a series of spells to fight enemies. I was going to use the dropdown macro to select a spell and then text would appear at the bottom with the description of the spell (this is what I’m trying to do). Then the player had the option to “>link: Prepare the spell” or “>link: Empty Spells Slots”
If the dropdown macro cant display any text and I’m just doing a wild goose chase please let me know.
(If doing something like-a-dropdown in CSS is easier to work with than the built-in dropdown macro please let me know as well)
Any help is appreciated