Unknown Gvar problem

For questions about using Classic.

Post » Sat Aug 29, 2009 6:09 pm

I have it set up currently so that every time MonthInYear = 13, (the game is turn-based with each month being a turn), it sets Year.old to Year, adds one to Year, then sets MonthInYear to one. Later I have it set so that if Year.old is different then year, it will do something. This is vital to my game. The problem is, this process only works once. I had it working earlier, but I threw a bunch of new code at it and now it doesn't work. I recreated the function twice. The months still count up properly and cycle back to 1, and the years even cycle correctly, but the functions that I have set up to do every year don't run.

What would be a better way to do this?
B
4
G
3
Posts: 25
Reputation: 975

Post » Sat Aug 29, 2009 6:48 pm

it sounds like the year old thing is unnecesary, since year.old will always equal year-1
but there's nothing about what you said that sounds like it shouldn't work
we'd need to see your code to see why it's not working
you can post a cap
or post a screenshot and black out the unrelated actions if you don't want people to see your code
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Aug 29, 2009 7:16 pm

No it doesn't always = year - 1 because when the function is finished year.old = year.

Here's the CAP--copyright me--produced for the LD48 competition.
By the way, the code is all basically the last 24 hours, that's why it's messy. I know that. I just want to know why it doesn't work.

To see the problem, press "Nuke 'em", then press "Space" to pass turns. When "Year" goes up, the red wave of radiation is supposed to move down and a random population operation is supposed to happen. They don't.
UPDATE: I might have fixed the problem. I deleted the other qualifying arguments. Why is this happening?
UPDATE2: I think it's fixed. I'll post the CAP again if I need more help.
B
4
G
3
Posts: 25
Reputation: 975


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests