Global Point system Help

Get help using Construct 2

Post » Sun Oct 20, 2013 8:34 pm

Hey guys i've been following this tutorials"

Since i cant send links ill just write his name. ConstructDude and this is the tutorial name LevelSelect Tutorial In Construct 2 | Level Selection


And theres something i want to do that they dont do in the videos. so i was wandering if anyone in here would know i have a star point system that shows how many stars i've gotten in that certain level.

I want a system that counts all the stars i have not only for 1 level. but i dont want people to be able to lets say play the same level over and over again to get infinite stars.

I want it so if i replay lvl 1 it deletes the ammount of stars i got previously in that level and replaces it with the new ammount of stars if its a higher number "Max is 3" i got.

Can anyone help me?
B
6
S
2
Posts: 10
Reputation: 516

Post » Sun Oct 20, 2013 9:16 pm

You probably need an array for that. 1 dimension should be enough.

When the star progress is saved, instead of saving them to a global variable, save them to the array.

Set Array at (level-1) = stars (with the condition that stars > array at (level-1))

This way each level got his "stars obtained"-number saved in the array and it only increases if you obtain more stars in the level than last time. Make sure to set the width of the array to the number of levels you have.

And to obtain the total stars obtained over all levels:
-(some event that triggers the total stars counting)
--subevent: set totalstars(globalvariable) to 0
--another subevent: array->for each element (X) -> add to totalstars: array.curvaluemindfaQ2013-10-20 21:17:58
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 11:45 pm

Hello can i get you to explain it with more detail?. im new to the program so i dont really understand this
B
6
S
2
Posts: 10
Reputation: 516

Post » Tue Oct 22, 2013 1:33 am

http://s000.tinyupload.com/index.php?file_id=04480511110361237799
maybe this helps

array.at(x) will get you the amount of stars of lvl x+1.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue Oct 22, 2013 3:31 am

Hello :), i cannot thank you enough for making that for me. it works now and im still so happy that you actually did this thank you so much
B
6
S
2
Posts: 10
Reputation: 516


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests