Trying to Randomize Murderer Selection #811
Replies: 1 comment 1 reply
-
Ah! I figured it out! Just needed a simple if bracket thing. It doesn't feel elegant, but this is what I have! { } Now I have it so the killer has the name of the character. There's much more to do so I may be back if I get stumped again. |
Beta Was this translation helpful? Give feedback.
-
I'm creating a basic murder mystery game. I've set it up where players select a character and so each VAR character_name will equal the number of what order they were chosen in.
Example:
VAR char_1 = 0
VAR char_2 = 0
VAR character = 1
=== character_selection ===
Select character:
~ char_1 += character
~ character += 1
-> character_selection
~ char_2 += character
~ character += 1
-> character_selection
Now I want to randomly select the character who is the murderer, but how do I do that when the information about the characters is in variable? I've gotten:
VAR killer_selection = 0
~ killer_selection = RANDOM(1,character)
So it will have a number, but how can I make it search through the variables to select the one that has that number and name it the killer?
Let me know if you need more info.
Beta Was this translation helpful? Give feedback.
All reactions