How to Implement Choice Paths and Conditional Endings in CoSpaces Edu

Hey everyone,

I’m working on a game in CoSpaces and need some advice on setting up choice paths that lead to different endings based on the player’s responses to questions. Here’s a bit about the game:

Game Details:

  1. Interrogation Scene: The player is in an interrogation room and is asked multiple-choice questions by an interrogator.
  2. Unique Responses: Depending on the player’s choice, the interrogator responds differently. For example:
    • If the player chooses “Yes, I know who I am,” the interrogator responds with, “Good, then we can skip the pleasantries.”
    • If the player stays silent, the interrogator says, “Your silence speaks volumes.”
  3. Ending Paths: The player’s choices throughout the interrogation lead to different endings, such as escaping the room, being judged, or finding a secret path.

Choice Paths:

The game uses a system of choice paths to determine the ending based on the player’s responses. For example:

  • Choice Path: 1B, 2C, and 3A
    • Ending: Assigned to the unique sequence of choices

We want the player’s dialogue choices to lead to different endings based on the paths they take. We’ve tried using the Choice Panel in CoSpaces, but we need help on how to implement a system that can track the player’s choice paths and assign the appropriate endings. How can we achieve this in CoSpaces using CoBlocks or any other method that does not require physical items or objects for the player to interact with?

Any ideas or examples would be greatly appreciated!

Thanks!

I think a variable may record the choices with 0/1/2 and towards different scene for ending.
After that, only 1 variable is used for each choosing.

For example,
0 for 1B then go to scene 2
1 for 2C then go to scene 3
2 for 3A then go to scene 4


A sample and don’t aware of the disabled code
you may add the code after choosing/time is out
“restart cospaces” is my example and you may change it

You can use an info panel to told player the choices
I am new to Cospaces and I wish I could help you!

Apologies for the INCREDIBLY late reply, could you try to configure this in such a form where it can be applied to these types of question sets as shown in the image? Thanks in advance.


I edit something in my sample.

First, I found that using variables for actions after choices are tiring so I decided to use it
(“myVar” is changed to “Paths”) only for preventing users from selecting choice B after A etc.
Therefore, you would only need to add the code after choices/time is out

The part with maths (“Waiting Secs” =< 10) is a timer for time out counting

A very simple sample video

A Sample CoSpaces for you to remixing and viewing

Here’s my question, are we able to do this exact same thing but with each individual option you choose from the choice panel? I am not sure if using A and B keys on a keyboard is what we’re going for, but if it’s the only way, then I guess we’ll use it.

It would be all fine to use choice panel for choices
However, since it will not close with code (Only if you selected or CoSpaces is restarted or closed) , a closing with time is not possible as I know.

You can also use the “choice panel” seen below to easily allow the player to make choices. You can remix this quick example project I made to see the full code.

You can remove all the events from forever loops and run parallel - events only need to be declared once, at the beginning of your code (unless setting up events based on a condition or other programming).

Hi @Job_Diaz_Villegas,

I suggest you explore setting up your choices in a list variable, and storing your choice paths in list variables - this would give you flexibility. You can have lists of lists, so a possible structure is:

list choices =

  • choice 1
    • choice 1a
    • choice 1b
    • choice 1c
  • choice 2
    • choice 2a
    • choice 2b
    • choice 2c

You can do this by going to Data > Lists and setting up a structure like so:

Note that the values for each item in choices are lists, and the values in each of those choice lists are text strings.

Then you could access these items in the choice panel with the variable value block:

Then, if you wanna get real fancy, throw that in a function so you can access it any time:

Called like so:

I’m storing the userChoices in a string (text) variable, and then would just check that string at some point to send them off in another direction.

Probably getting a little complex now, so I’ll back off, but sing out if you have any questions.

Cheers,
Geoff @ TechLeap