Triggering rule every 5 minutes

games4fungames4fun Member Posts: 185
edited July 2012 in Working with GS (Mac)
Hi Everybody,

So im working with the device clock and have it set up to count the minutes. Im wondering how I can have a rule refire every 5 minutes based on the device time. The device time keeps going and will not stop. Is there a way to set up a rule that when the device time is 5 minutes to fire rule and then when device time is 10 minutes, 15, 20 ect and keep going up in increments of 5. I cant have it be with a timer but with a math solution if possible.

Thanks

Comments

  • iCreationZiCreationZ Member Posts: 158
    Perhaps a rule with 12 conditions... eg,


    When *Any* of the following are happening:

    attribute-devices.clock.minute = 5
    attribute-devices.clock.minute = 10
    attribute-devices.clock.minute = 15
    attribute-devices.clock.minute = 20
    attribute-devices.clock.minute = 25
    attribute-devices.clock.minute = 30
    attribute-devices.clock.minute = 35
    attribute-devices.clock.minute = 40
    attribute-devices.clock.minute = 45
    attribute-devices.clock.minute = 50
    attribute-devices.clock.minute = 55
    attribute-devices.clock.minute = 60

    FIRE!!!
  • KodeRiter722KodeRiter722 Member Posts: 42
    edited July 2012
    In whatever actor you need this rule, create an integer attribute, called "Time Check" or something like that, and give it the value zero. Then, add a Rule:

    RULE:
    When self.Time Check = game.Clock.Minute%5

    - Add Behaviors here you want to fire every 5 minutes

    If you want to change the time, just change the value 5 to the number of minutes you would like for each interval.

  • games4fungames4fun Member Posts: 185
    How could I go about changing it if it was now every lets say 2 hours since the time to fire rule will be different and dependent on other numbers. Could I have a constrain attribute to device time%120 so when it equals 120 fire rule and then also it will restart timer back to 0 and count up to 120 again. Would that work?

    Thanks
  • games4fungames4fun Member Posts: 185
    How could I set the rule up to have it be every 5 minutes from the time the person touches a actor. So if the current time is 17 minutes. I want it to trigger the rule at the 17,22,27,32,37,42,47,52,57,2,7,12 minute marks.

    Thanks
Sign In or Register to comment.