Announcement

Collapse
No announcement yet.

How can I detect a change in an integer variable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I detect a change in an integer variable?

    Hi everyone,

    So basically what I need to do is detect when there has been a change in my day variable so I can trigger a custom event/function for something to happen. My day is an integer and gets reset to 1 at the end of every month. Is it possible to do this or will I need to come up with another solution?

    Thanks in advance

    #2
    I'm not 100% sure of what your asking but here are two ways of doing a day check.

    Screen 1 goes off the game start clock. You'll have to calculate how many seconds are in a minute, hour etc.

    Click image for larger version

Name:	screen 1.png
Views:	1
Size:	268.9 KB
ID:	1125131


    For screen 2 it goes off your computers calendar. Just move the "==" to hours and replace 59 with 24.

    Click image for larger version

Name:	screen 2.png
Views:	1
Size:	460.4 KB
ID:	1125132

    Comment


      #3
      Originally posted by Jippolatta View Post
      Hi everyone,

      So basically what I need to do is detect when there has been a change in my day variable so I can trigger a custom event/function for something to happen. My day is an integer and gets reset to 1 at the end of every month. Is it possible to do this or will I need to come up with another solution?

      Thanks in advance
      Why don't you just fire an event whenever your day variable changes?
      Simply send the day integer to this event so you can have different behaviour for differetn days.

      Comment


        #4
        Repnotify on the int with branch looking at itself for the correct value to launch an event.
        Inphidel / Brian - Developer of Ultraball
        http://www.ultraballgame.com

        Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

        Comment


          #5
          Whenever you need to change the day variable, instead of setting it directly; execute a function that changes the variable. Inside that function you also do queries.

          Comment

          Working...
          X