How do I save the progress

Get help using Construct 2

Post » Wed Mar 04, 2015 9:25 am

Hi Yall,

I have a quiz like system but i want all my questions to be shown only once.

To do this i want to save it in a webstorage.
Though i am not able to get this right with my current script.

Can any one help me out? The script itself works perfectly and i get random questions every time.
The thing is that i really want to only show them once and after that never again.

The script:
Image

The way it fetches the questions ( from txt file ):
Code: Select all
This is a question;
Answer1;
Answer2;
Answer3;
Answer4;
Answer2;
1;
|
This is a question;
Answer1;
Answer2;
Answer3;
Answer4;
Answer2;
2;


This way it takes line 1 as question, line 2,3,4,5 as answers you can give and line 6 as correct answer.

I tried to save them on level, which is line 7 i added.

Line 6 will be stored in the global variable currentNumber. Though i think i might mess up webstoragewise with the incorrect order of calling my functions.

Any 1 here who can lighten me up?

Thanks in advance!
B
10
S
4
G
3
Posts: 163
Reputation: 2,507

Post » Wed Mar 04, 2015 12:18 pm

Ok so i was thinking.

I am not very good with Arrays but i think the next thing in my mind could fix my problem.

Is there a way to check if a specific value is written into the array and if that matches the webstorage to delete it from the array?

In my webstorage i will save: level1,level2 etc.
In my questions file i will set the 6th line to level1,level2 etc.

So if i'm right in my Array there will be all level values ( the 6th line ).

Am i correct? And if yes could any 1 help me further with that technique? I know the logic behind it but i'm really not sure how to make it working.
B
10
S
4
G
3
Posts: 163
Reputation: 2,507


Return to How do I....?

Who is online

Users browsing this forum: mmercerc, Yahoo [Bot] and 9 guests