How do I modify this (capx attached)

Get help using Construct 2

Post » Tue Sep 09, 2014 1:59 pm

Thanks for the response @Kyatric but the stars are not showing properly. I even added something to work for the arrows. May be I am doing something wrong.

For the Question 1: What @Wisdoms posted second time was fine BUT a small bug. If I finish my level 1 with one stars, Total stars collected says 1 stars. Again if i play the "level 1" and finishes with 3 stars, It should shows as 3 stars, but it is adding with that previous 1 star and says 4 stars.

For the question 2: I even added 3 new sprites, arrow 1,2,3 in your file. And given cmd says, if I click the arrow 1,set value arrow =1.but the stars are not changing. Just showing one arrow always.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Tue Sep 09, 2014 4:23 pm

Well post the current capx you're working with, it will make it easier to edit and add what you want.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Tue Sep 09, 2014 5:13 pm

First Question. Getting Total Star counts in the Levels Page. I have attached the current Capx file here. For more details check the attached file, Layout LevelMenu.

I think the second issue was solved @Kyatric. I made some simple changes with your file.
You do not have the required permissions to view the files attached to this post.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Wed Sep 10, 2014 6:56 am

It seems the video tutorial you're using shows a confusing way of using array, which makes it very complicated to achieve the total star count. This tricks and hacks does work work but it causes beginner to misunderstand on how the array should be used.

There's no easy way to help you based on what you currently have except from restarting. However, I written a tutorial to show a proper usage of array at least, using your capx, go ahead and look at it.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Sep 10, 2014 7:16 am

Thanks @DuckfaceNinja. Thanks for taking the time. This is going to help lots of beginners.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Wed Sep 10, 2014 7:25 am

Harishankar wrote:Thanks @DuckfaceNinja. Thanks for taking the time. This is going to help lots of beginners.

You're welcomed! It just that, there's a lot of question like this before repeatedly, somebody gotta put an end to it :D .
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Thu Sep 11, 2014 9:33 am

WebStorage Question with the above file:

I am trying to store and restore the values from the above file. As I use the browser to test, once I refresh, the total collected stars is zero again. I wanted to save the data.

I have tried using webstorage here. But it is not working properly.

* I one which used "On start of layout" condition is to restore
* and on the "Win level" condition, I tried to save the total collected stars.

But it is not working.

Help!!!
You do not have the required permissions to view the files attached to this post.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Thu Sep 11, 2014 1:55 pm

While saving to webstorage you create a string..
To convert it back to a numerical value use int(webstorage.localvalue())..
It might also be wise to add a subevent to check if webstorage exists before setting the global value, for else it could give unexpected results when first played..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Previous

Return to How do I....?

Who is online

Users browsing this forum: luvleggs and 43 guests