Funny bug that can occur when making large project watch out

Get help using Construct 2

Post » Mon May 23, 2016 10:39 am

Currently I'am working on a semi-large project and of course use save features to store information. The save feature basically saves the game whenever you beat a mission and it unlocks access to the next level. To make my life easier I have a global variable that is linked to a localstorage key. Both are linked to each sprite that represents my level selection menu.
</br>
Now for the bug in Construct2 that randomly occurs. I put the code in to each sprite that if the global variable = a certain amount that sprite changes animation, plus its unlocked. For some odd reason Construct2 changes my global variable code randomly to another global variable, so when I run the game the next level is not unlocked. At 1st I thought it was me but now its happened right in front of my face. I save the game and the code changes right after I saved. 1st time I saw it I was like what the fack LOL.
</br>
So if your save keys and variable somehow don't work, check over your code real quick before going nuts. It doesn't happen all the time but when making a large project it will start to happen, at least with me it does.

Image
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 24, 2016 4:52 am

Hey Pixel,

I have worked on a lot of large projects and haven't run into this before. I am inclined to think that it is a problem with your code but you might be right. If you are sure you should definitely lodge a bug report.

What I normally do when I run into something that 'should' be working but isn't is to place stops in your connecting events so you can inspect what all the variables are at each point. So if you have an event that handles saving or loading, disable your function call or whatever style you use to link events and see if it is consistent.
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Tue May 24, 2016 5:47 am

GenkiGenga wrote:Hey Pixel,

I have worked on a lot of large projects and haven't run into this before. I am inclined to think that it is a problem with your code but you might be right. If you are sure you should definitely lodge a bug report.

What I normally do when I run into something that 'should' be working but isn't is to place stops in your connecting events so you can inspect what all the variables are at each point. So if you have an event that handles saving or loading, disable your function call or whatever style you use to link events and see if it is consistent.


Thanks GG it was a wierd bug and I never seen it before. But it happened right in front of me so thats how I knew it wasn't me. I just posted this just in case someone else encounters their save variable changing when they save, so they don't go nuts. I know when I was a beginner I would go crazy just to find out it was something simple. Now that Iam experience I don't go crazy , I slow down so that I can double check everything.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 24, 2016 9:26 am

PixelPower wrote:I just posted this just in case someone else encounters their save variable changing when they save, so they don't go nuts. I know when I was a beginner I would go crazy just to find out it was something simple. Now that Iam experience I don't go crazy , I slow down so that I can double check everything.


"double check everything" but assumes that Construct "magically" changes values.
Right, makes sense.

Consider posting your project so other pair of eyes can investigate and see if they also "encounter the random issue".
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,313
Reputation: 71,094

Post » Tue May 24, 2016 10:27 am

Kyatric wrote:
PixelPower wrote:I just posted this just in case someone else encounters their save variable changing when they save, so they don't go nuts. I know when I was a beginner I would go crazy just to find out it was something simple. Now that Iam experience I don't go crazy , I slow down so that I can double check everything.


"double check everything" but assumes that Construct "magically" changes values.
Right, makes sense.

Consider posting your project so other pair of eyes can investigate and see if they also "encounter the random issue".


Ok so after all this time on Construct2 you think I just all of a sudden make something up? I didn't post my project because its the game I just released for android. I would be very dumb to post that project for someone to steal it and post it themselves on googleplay after I spent time making it.
So thats in response to your "smart" statement.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 24, 2016 10:44 am

Of course, it would be dumb to post a proof, but just having to take your "long time expert veteran" word for it is good enough.
I don't doubt you are encountering an issue. But your assumption that it is a magical Construct 2 bug rather then something not coherent in your code is what bugs me.

I have been using C2 for the double of your lengthy experience, and I still prefer to think that my code is at fault when encountering an issue.
And guess what, in most case it is. And when it is indeed a Construct failure, I do make a bug report, following the report guidelines to make sure.

But your advice here is "don't doubt your code, blame a magical bug and do nothing about it".

By doubting your code that's how you get even further in depth into C2 and go from the intermediate user that you are to the expert that I dare to say I am.

And if it is actually really a C2 bug, it would help every one to have it fixed and so to provide some code for it.
At worst you can post your code "privately" to Scirra directly. But tbh, it is more likely there is an issue in your events then a bug with the local storage that worked now for years...
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,313
Reputation: 71,094

Post » Tue May 24, 2016 12:37 pm

@Kyatric
</br>
1) Press button to save project 2) My variable was GameSave and the moment I pressed the button it changed to the Health variable. I was looking at it with my own eyes.
The reason I don't post bug report but in the forum is to see if it happened to anyone else. If not I will just uninstall Construct2 and then reinstall it again because maybe it got downloaded wrong and there is a random bug that normally isn't there. Unlike what you did jumping the gun and basically trying to bully me , I posted and waited to see if anyone has encountered the bug. I don't go posting bug reports everytime something goes wrong. Actually I never posted a bug report. If my problem isn't solved, I just unistall Construct2 and go to a version that didn't have problems. Its you who jumped the gun , not me.
As for banning me from the forums, which you mentioned in the other thread, Iam not the one going to get hurt by it. I actually go to other forums and tell them about Construct2 so Iam not the one losing out.
But what not going to happen is a moderator feels like he is going to bully and make fun of someone and think I'am a pushover. There was no reason for you to come in with slick comments, I just responded how you came at me.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 24, 2016 1:19 pm

I am supposed to be the harsh one in here. Plz dont steal that status from me. Thank you verry much.

Pixel, just a question. Could it be possible that you (in the previous version of your code) stored things in a differend way (differend then the current version) ?

I had big problems whit that. I code a lot with trial and error. Now, when i use local storage, i have a 'clear local storage' mapped under a key. Call it a emergency key. And that works fine for me.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 24, 2016 1:34 pm

99Instances2Go wrote:I am supposed to be the harsh one in here. Plz dont steal that status from me. Thank you verry much.

Pixel, just a question. Could it be possible that you (in the previous version of your code) stored things in a differend way (differend then the current version) ?

I had big problems whit that. I code a lot with trial and error. Now, when i use local storage, i have a 'clear local storage' mapped under a key. Call it a emergency key. And that works fine for me.


No I just pressed the save button to save the project and my global variable changed in my code block. At 1st I thought I was seeing things, I was like what the fack. But then it happened again I was like ok now I know what I saw.So I came to the forums to see if anyone else had the issue and no one else had it then I just uninstall and reinstalled Construct2. I come back to the forums and then a Moderator see's fit to make fun of me and try to bully me tying to be funny but it was a bad joke. Then I responded an eye for an eye. Thats what happened.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 24, 2016 1:38 pm

I had that issue, under the circumstances as discribed.

*** i rest my case ***
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 10 guests