inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.11k stars 491 forks source link

Ink/Unity issue: need random choices from a list of choices #518

Open connorcarson opened 5 years ago

connorcarson commented 5 years ago

Hi everyone!

I'm working on a project with Ink and Unity. I need to have three choices appear for the player, but they need to be three random choices from a list of twenty. Also, ideally there would never be the same choice listed more than once in a set of three and once a choice has been used it will not appear again during the game. I'm aware of the ~ or shuffle method for pseudo random choice and of the * for only showing a choice once, but that doesn't seem to have the choices talking to each other, so there's no way to guarantee that the same choice won't be listed twice. Does any of that make sense? I wish I could provide some sample code, but I have none since I haven't found anything that comes even remotely close to doing what I need. I really appreciate any help anyone can offer!

lcizzle commented 5 years ago

Hello,

I don't quiet understand the issue here? This is not a bug or an issue with functionalty. Just like any other programming language you have to put in work to get the desired output.

Use LIST_RANDOM(list) to select items at random for the choices list you made. Validate the choice select is not already in the list of 3 choices you are building. Validate that the choice selected hasn't been used before. Add the choicies to some list so you can track what has been used.

There is a massive discord and forums for these types of of questions. Github is for functionality issues and bugs.

Discord, please join the community for help and suggestions. https://t.co/OVdjl1rZhL