Unknown Gvar problem

This forum is currently in read-only mode.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)