Strange bugs (with global variables) in an almost ready game

Get help using Construct 2

Post » Mon Aug 10, 2015 11:56 am

Hello everybody!

I'm finally in the final stages of the development of my game, but unfortunately I'm running into some boring and unexpected bugs. :(

My game is a similar mini-game collection like Wario Ware Inc. and the Dumb ways to die, where I developed each mini-game in separate CAPX projects. The basic mechanics consists of mini-games of different genres whose difficulty increases as the player progresses.

Prior to integrate them into one project, each mini-game contained a variable "level" for test the increased difficulty, which consisted in increasing the speed of enemies, enemies emergence of intensity and others things. When they were in their own CAPX, every game worked perfectly on any difficulty level. In the integration of the project, I left alone a global variable "level", which increases as the global variable "victory" gained 3 points.

It turns out that from the second level of difficulty or when a mini-game is revisited, some mini-games are presenting unexpected strange behaviors, related to own global variables.

I created a "RestartVars" function for each mini-game, whose function is to restart the main own global variables and this function is called at the Start of the Layout, but I cannot understand why this isn't working in some games.

Does anyone have an idea what might be going on?

I thank once again the participation and collaboration of you!
B
39
S
9
G
3
Posts: 259
Reputation: 4,355

Post » Mon Aug 10, 2015 2:07 pm

add on top of your restartvars function a "wait 0 seconds" event.

calling functions and setting variables on start of the layout needs this extra 0second wait event to load probaly
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Mon Aug 10, 2015 2:59 pm

Your suggestion didn't work, @EyeForcz. :(
B
39
S
9
G
3
Posts: 259
Reputation: 4,355

Post » Mon Aug 10, 2015 3:10 pm

is it possible that you would share your capx or just make some screenshot of your event sheet with the parts that are important for this problem?
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Mon Aug 10, 2015 4:58 pm

@EyeForcz After testing the game project in debug mode, I realized that the mini-games global variables aren't really being reset by the "ResetVar" of their respective Event Sheets.

Where am I going wrong in these functions?

Below two screenshots of one of the mini-games:

Image

Image
B
39
S
9
G
3
Posts: 259
Reputation: 4,355

Post » Mon Aug 10, 2015 4:59 pm

@blackhornet, can you take a look in the two screenshots above of one of the mini-games? :)
B
39
S
9
G
3
Posts: 259
Reputation: 4,355

Post » Mon Aug 10, 2015 6:25 pm

Looks fine.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Aug 10, 2015 7:02 pm

Are those two screenshots on the same layout?
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Mon Aug 10, 2015 7:56 pm

gumshoe2029 wrote:Are those two screenshots on the same layout?


Yes, @gumshoe2029. ;)
B
39
S
9
G
3
Posts: 259
Reputation: 4,355

Post » Mon Aug 10, 2015 8:43 pm

I apologize to the forum fellas by constant recurrences, but I'm doing this game alone and at the end of his development, I'm so exhausted and stressed I can not think clearly.

The problem is even with the groups. The variables :)

Of course, it would also be a problem with the variables, but I anticipated that. I didn't know that the states of the groups weren't restarted when we went out of the layouts. Living and learning with good teachers, sure. ;)
B
39
S
9
G
3
Posts: 259
Reputation: 4,355


Return to How do I....?

Who is online

Users browsing this forum: MassimoF, Microbex and 22 guests