How to write this attribute condition
3absh
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
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
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
. . . . or a high beer count ?
Just you wait @Lost_Oasis_Games ,
@Socks is going to follow this up with his notorious "//" damned-if-I-know symbol.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
...
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
Did it work out ok for you ?
yes it did
I always seem to resolve my problem 5 minutes after I post it here
Good !
Good !
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 ...
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS