How do I solve this...

Get help using Construct 2

Post » Sat Dec 17, 2016 10:42 pm

Message: ziadhorat can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Now for some odd reason, when i go from the main menu into the random gen map, it doesnt want to work.
Normally when i run the layout it does work, but the second i come from another layout it bugs out.
I've busted my head for hours to no avail, im definitely missing something because ive done it before, and it worked.

Please take a look at the source code, the rand gen procedure isnt what ive come up with but it works.
Note: please try to let me know via screenshot/telling me the error instead of actually updating the capx as my team and i haven't updated yet.
Thanks alot.

.CAPX Here: https://goo.gl/UjSY3y
B
5
S
1
Posts: 44
Reputation: 494

Post » Sat Dec 17, 2016 10:56 pm

It's because the randomgen relies on tickcount, which is the number of ticks since the game started. It's only going to work in its current state if its the first thing to load in the game. You'll need to change the tickcount checks under randomgen and add in your own counter I guess.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sat Dec 17, 2016 11:29 pm

plinkie wrote:It's because the randomgen relies on tickcount, which is the number of ticks since the game started. It's only going to work in its current state if its the first thing to load in the game. You'll need to change the tickcount checks under randomgen and add in your own counter I guess.

Well that was probably really obvious lol. Thanks alot! I guess since i was staring at it for so long, it didnt occur to me, thanks a ton thou!
B
5
S
1
Posts: 44
Reputation: 494

Post » Sat Dec 17, 2016 11:44 pm

plinkie wrote:It's because the randomgen relies on tickcount, which is the number of ticks since the game started. It's only going to work in its current state if its the first thing to load in the game. You'll need to change the tickcount checks under randomgen and add in your own counter I guess.

Okay, so ive tried variables, using 1 second breaks and incrementing, but i cannot get it to work for the life of me...Does anybody have any other ideas?
B
5
S
1
Posts: 44
Reputation: 494

Post » Sat Dec 17, 2016 11:50 pm

Not 1 second breaks, every tick. Set a global variable on RandGen to 0. Add an event every tick add 1 to global variable. Replace all of the tickcount checks with global variable.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sun Dec 18, 2016 12:04 am

plinkie wrote:Not 1 second breaks, every tick. Set a global variable on RandGen to 0. Add an event every tick add 1 to global variable. Replace all of the tickcount checks with global variable.

It worked :D
Dont know why i thought the 1 second break would work, probably because it would be longer, not sure really. But you where right.
Thanks again :)
B
5
S
1
Posts: 44
Reputation: 494


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests