Police questioning system

S

Swegm

Guest
hi !

does anyone have an idea of how to create a question system. my game is setup with
characters 1-10 (when system finished this will be like 50)

you wikk try to find a serialkiller among this characters which will be random everytime game starts

I think of a system with positiv and negatively affecting questions and answers that will subtract or add to a controller and when you finally reach 0 some how you wikk arrest this person.

hmm weird but i hope you guys understand what i want to do... the game is just on a oieve of paper right now at this moment

have a nice day!
 

Corey

Member
You'll most likely be using arrays for your questions and answers. If any of what I'm about to mention looks confusing, I highly suggest you research arrays and condition statements.

Manual References:
Arrays
Expressions
Strings

For example:

//positive question
positiveQ[0] = "This is positive question 1.";
positiveQ[1] = "This is positive question 2.";

//negative question
negativeQ[0] = "This is negative question 1.";
negativeQ[1] = "This is negative question 2.";

You'll also want to use arrays for the player's choice.

//positive answer
postiveA[0] = "This is a positive answer.";

//negative answer
negativeA[0] = "This is a negative answer.";

You'll need to assign a global variable for the controller. Like:

global.checkController = 0;

If the player chooses a positive answer, you'll increase the global controller += 1. If it's a negative, decrease the global controller by -= 1.

Set up condition statements if the global controller reaches a certain value, and then display the arrays using the draw event.

I was doing some coding to try and grasp on what I'm talking about. It's not fully functional code but it'll give you an example:

Create Event:
Code:
questionCheck = false;
answerCheck = false;
intraction = false;
positiveQuestion = false;
negativeQuestion = false;

global.checkController = 0;

maxPositive = 10;
maxNegative = 0

qPositiveVar = 0;
maxQPosVar = 1;
positiveQ[0] = "This is positive question 1.";
positiveQ[1] = "This is positive question 2.";

qNegativeVar = 0;
maxQNegVar = 1;
negativeQ[0] = "This is negative question 1.";
negativeQ[1] = "This is negative question 2.";

aPositiveVar = 0;
maxAPosVar = 0;
postiveA[0] = "This is a positive answer.";

aNegativeVar = 0;
maxANegVar = 0;
negativeA[0] = "This is a negative answer.";

playerChoice = 0;
questionChoice = 0;
Step Event:
Code:
if (global.checkController < 0)
{
    global.checkController = maxNegative;
}
if (global.checkController > 10)
{
    global.checkController = maxPositive;
}
if (intraction == true)
{
    questionCheck = true;
}
if (questionCheck == true)
{
    if (global.checkController > 0) //if positive
    {
        positiveQuestion = true;
        negativeQuestion = false;
        questionChoice = irandom(maxQPosVar); //randomly choose a number
        positiveQ = [questionChoice];
        answerCheck = true;
    }
    if (global.checkController < 10) //if negative
    {
        positiveQuestion = false;
        negativeQuestion = true;
        questionChoice = irandom(maxQNegVar); //randomly choose a number
        negativeQ = [questionChoice];
        answerCheck = true;
    }
}
Draw Event:
Code:
if (questionCheck == true) //if we start the question sequence
{
    if (positiveQuestion == true) //is positive question
    {
        draw_text(x-70,y-70,positiveQ[questionChoice]);
    }
    if (negativeQuestion == true) //is negative question
    {
        draw_text(x-70,y-70,negativeQ[questionChoice]);
    }
}
 
Last edited:
S

Swegm

Guest
Thanks a lot! I kind of understand it, but guess i need to learn some more before i can do something fully functional.

I guess I will have to write down a schedule of some sort with questions and answers and their impact on the situations to come. this won't be an easy task for me but ill do my best hehe

thanks again for your answer and example code !
 

Corey

Member
I like the idea of planning ahead. It's best to have the building materials ready before you start building. If you need further assistance, please let me know!
 
Top