Hi! I’m planning on making a popup that shows a random potion that is located in my option set. The random item will then show its icon and display text in the popup. I’ve attached a sample picture of what I’m planning to do below:
My parent group is Items which has a field name potion that is an option set. Whenever I test it out, it brings out an empty popup.
I’ve set the parent group’s type to be Items since I’ll be adding the potions the user received to his Inventory, which is a list of items. Thank you!
But are you displaying any Item in this popup? Or you leave the field empty?
Can you share a screenshot of your popup configuration?
To get a random option set you can “get an option” selecting “all options”, then use “sorted” selecting “random sorting”, and the pick “first item”.
Every time you want a random option in the popup use the “display data” action with this expression.
Here’s what came up. I set this to my popup group.
This is not working?
Hi,
Try using a custom state on the page (any name and your OptionSet).
Also set a text element on the page (set to that state) so that every time you click the popup button you can see that its actually working.
Then when you trigger the popup do a Set State the values would be your option set all options :random item
Then a go to page (your current page)
The popup won’t have any data but the element inside of the popup would point to the custom state. This way you can see them both working at the same time.
Let me know if you need more help.
yes, it shows a blank popup like this:
I’ll try this one! Thank you!
Thanks to everyone who helped. Solved this by making the potion (option set) a list in my user’s inventory instead of creating a separate data type which is items that has potion (option set) as the field.
This expression will give you a random option set “potion” as you asked. The problem is that you want to assign a “potion” to a group with data type “items”.
Anyway I’m happy that you resolved it.
This topic was automatically closed after 70 days. New replies are no longer allowed.