I have been going through the forums for the past few days and I am amazed by the quality of the advice provided here. I am trying to make a choice-based game and have seen some similar examples in the forum (for instance ) which have been of great help, especially — However, I am still unclear of what the best method is, so I am starting this thread.
My intention is to create a game as follows; the player is prompted a question (Q1) such as "You have encountered a bear. What do you want to do?" He is given two possible answers (1a and 1b), which could be 1a="fight!" and 1b="run!". Upon choosing an answer, I would like three things to happen:
1. Feedback is given to the player (for instance, if he chose 1b: "run!", output "player starts running towards the river")
2. After the feedback (on tap or click) the next question is presented, where answer 1a leads to question Q2 and 1b to Q3 (for instance: "You have reached the river, what do you want to do?"). Also, the possible answers to the Question should be displayed (3a:"Keep running" and 3b: "Jump into the river").
3. Points are assigned to 5 categories depending on the answer. For instance, answer 1a: "fight!" would give +2 points to strength and -3 to sanity.
From what I have read, I am guessing that the best option is to have a 2D array of feedbacks and questions and a 2D array with answers and their corresponding scores.
Feedback 1a Q2
Feedback 1b Q3
Feedback 2a Q4...
1a +2 -3 +0 +0 +0
1b -1 +4 +0 +1 +0
There is obviously a mathematical relationship:
Answer 1a (row 1) leads to feedback 1a and Q2 (row 2)
1b (row 2) leads to Q3 (row 3)
2a (row 3) leads to Q4 (row 4)
2b (row 4) leads to Q5 (row 5)
Therefore the relationship is:
Row of Answer chosen leads to row of Feedback and Question +1
The problem is that I do not know how to link the two arrays using Construct 2. I only started with C2 recently, and have not explored all the possibilities yet, but I am guessing it would be necessary to have 3 text boxes, 1 for Qs and 2 for answers, and another layout with a feedback text box.
On click of answer 1a, the scores should be added to global variables and the layout should change to the feedback text box. On another click the Q text box should be updated to Q2 and the answer text boxes to 2a and 2b.
I am guessing I would have to use for loops to connect the arrays, but any guidance on how to do this would be greatly appreciated.
In case this method does not work, how bad it would be to do the game question by question (for approximately 500 questions)? For example, have the same 3 text boxes and writing down as events all the consequences of clicking one answer, in a sort of cumulative sub-events (I think)?
I apologise for the long post, I have tried to keep it abstract, just in case I get the help I need it will also help other people who are trying to find a way to relate the data of two different arrays.