Set an attribute in multiples of a value
Gamepenciler
Artist/Game DeveloperMember, PRO Posts: 326
Hello sorry to bug the awesome people in here. I just have logical question
If I want a value that triggers in muliplication like 5 (5,10,15,20) without any triggering other numbers, what function will I use or is it just logical? how?
An example to where will I use this is when a player collects every 5 coins he will automatically unleash a power up.
-thanks people
If I want a value that triggers in muliplication like 5 (5,10,15,20) without any triggering other numbers, what function will I use or is it just logical? how?
An example to where will I use this is when a player collects every 5 coins he will automatically unleash a power up.
-thanks people
Artist/Game Developer / Animator at your service..
Comments
set score to (score+1)%5
score will continue to incvrement to infinity, but the %5 will group it in groups of 5, and score display values of 0,1,2,3,4,0,1,2,3,4,0,1,2,3,4
play around with it and it should do what you want.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Artist/Game Developer / Animator at your service..
The issue with this is the player would get a powerup as the game starts. So some logic is needed to prevent that.
So the code for the modulate would be.
Constrain game.powerUp to game.coins%5
Then a rule that says. 'All' conditions match
if game.coins (is greater than or equal) to 1.
and if game.powerUp = 0
Then perform powerUp.
That way the player has to have collected a coin for it to perform.
And the powerUp will hit 0 on the fifth coin every single time.
This should work for you - I just did this in my head so if you have problems let me know
Cheers, M@
Artist/Game Developer / Animator at your service..
Artist/Game Developer / Animator at your service..
Artist/Game Developer / Animator at your service..