How to write this attribute condition

3absh3absh Member Posts: 601

I'm trying to make this particular number sequence (3,6,9,13,16,19,23,26,29...) and so on
I know it has something to do with Mod and maybe adding +1 every 10 days
but I can't seem to figure out the formula

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2016

    I'm not 100% about the context of the question, but the pattern is +3/+3/+4 ... (repeat) ... but I suspect you already know that part !

    Depending on how you are using this pattern or how it's being applied you can get +3/+3/+4 from adding 3.333 (10/3) to a starting value and flooring the result.

    So for example if you start with a real attribute (let's call it 'A'), and give it a value of 3 (the starting number in your sequence), you can then have a rule that says:

    When touch is pressed - or when some other condition is met . . . .

    Change A to A + (10/3)

    And then floor the results of A, so for example if you were using a Display text behaviour you would say Display floor(A), which would give you . . .

    3 - 6 - 9 - 13 - 16 - 19 - 23 - 26 - 29 . . . .

    But this, for basic mathematical reasons, breaks down at 92, but this might be good enough for your needs ? Hold on I have an idea . . . I can't think of the right math function right now (I've not got access to GS at the moment), but if you chop off the decimal points, without rounding, then you can continue this sequence passed 92, for as long as you need +3/+3/+4 . . . I will have a think, it should come to me . . .

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @Socks said:
    I'm not 100% about the context of the question, but the pattern is +3/+3/+4 ... (repeat) ... but I suspect you already know that part !

    Depending on how you are using this pattern or how it's being applied you can get +3/+3/+4 from adding 3.333 (10/3) to a starting value and flooring the result.

    So for example if you start with a real attribute (let's call it 'A'), and give it a value of 3 (the starting number in your sequence), you can then have a rule that says:

    When touch is pressed - or when some other condition is met . . . .

    Change A to A + (10/3)

    And then floor the results of A, so for example if you were using a Display text behaviour you would say Display floor(A), which would give you . . .

    3 - 6 - 9 - 13 - 16 - 19 - 23 - 26 - 29 . . . .

    But this, for basic mathematical reasons, breaks down at 92, but this might be good enough for your needs ? Hold on I have an idea . . . I can't think of the right math function right now (I've not got access to GS at the moment), but if you chop off the decimal points, without rounding, then you can continue this sequence passed 92, for as long as you need +3/+3/+4 . . . I will have a think, it should come to me . . .

    Wow this is the first time I've seen socks have to ponder......must be a low neuron count day :#

  • SocksSocks London, UK.Member Posts: 12,822

    @Lost_Oasis_Games said:
    Wow this is the first time I've seen socks have to ponder......must be a low neuron count day :#

    . . . . or a high beer count ?

    :blush:

  • HopscotchHopscotch Member, PRO Posts: 2,782
  • SocksSocks London, UK.Member Posts: 12,822

    @Hopscotch said:
    Just you wait @Lost_Oasis_Games ,
    @Socks is going to follow this up with his notorious "//" damned-if-I-know symbol. :D

    ...

  • 3absh3absh Member Posts: 601

    This is what I did

    Numeric Expression:
    mod( scene.Background.Day Count.Day number -floor( scene.Background.Day Count.Day number /10),3) = 0

    Numeric Expression:
    mod( scene.Background.Day Count.Day number ,10) ≠ 0

  • SocksSocks London, UK.Member Posts: 12,822

    @abuabed84 said:
    This is what I did

    Did it work out ok for you ?

  • 3absh3absh Member Posts: 601

    @Socks said:

    @abuabed84 said:
    This is what I did

    Did it work out ok for you ?

    yes it did

  • 3absh3absh Member Posts: 601

    I always seem to resolve my problem 5 minutes after I post it here

  • SocksSocks London, UK.Member Posts: 12,822

    @abuabed84 said:

    @Socks said:

    @abuabed84 said:
    This is what I did

    Did it work out ok for you ?

    yes it did

    Good ! :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2016

    Good ! :)

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @Hopscotch said:
    Just you wait @Lost_Oasis_Games ,
    @Socks is going to follow this up with his notorious "//" damned-if-I-know symbol. :D

    You have to speak socks. "//" means I want to cuss at you for being an idiot but I changed my mind.

    ... Means I have no idea. I could see how you miss that as rarely does @socks need to use ...

Sign In or Register to comment.