Problem with Timer
alexulle
Member Posts: 27
Hi there,
I would be pleased if you can help me.
I'd like to drop objects during gameplay every X seconds. And the Timeperiod between the drops should became shorter and shorter. But in this case it doesn't work and I don't know why.
I made it this way:
Timer
every 1/game.gamespeed seconds
spawn actor
...
change Attribute
game.gamespeed = game.gamespeed+0.1
(spawn actor and change Attribute are part of Timer)
but the time period sill keeps at 1 second but it should became shorter
With using the display text atribute I know, that game.gamespeed gets higher over a time.
there is also an other object using Timer 1/gamespeed and that does its job correctly.
I would be pleased if you can help
Thanks
I would be pleased if you can help me.
I'd like to drop objects during gameplay every X seconds. And the Timeperiod between the drops should became shorter and shorter. But in this case it doesn't work and I don't know why.
I made it this way:
Timer
every 1/game.gamespeed seconds
spawn actor
...
change Attribute
game.gamespeed = game.gamespeed+0.1
(spawn actor and change Attribute are part of Timer)
but the time period sill keeps at 1 second but it should became shorter
With using the display text atribute I know, that game.gamespeed gets higher over a time.
there is also an other object using Timer 1/gamespeed and that does its job correctly.
I would be pleased if you can help
Thanks
Comments
This is a HUGE PROBLEM that I hope GS fixes.
What I am doing now (which seems to be a bit buggy) is to have rules that say
Have atimer that counts up
When timer = 0
For 20 secs
Spawn every 5 secs
When timer = 20
For 20 seconds
Spawn every 4 secs
and on and on
Does anybody know of a way to have a changing attribute in the timer that actually makes the timer rate change during the scene? Devs?
http://gamesalad.com/wiki/how_tos:gsc_variable_timer_speed
Thanks in advance!
The truth is that I'm still not too clear on how to implement the self.currentInterval and self.newInterval. Maybe a working demo tutorial with open source can help.
In the meantime, I believe I should be publishing an optimised Mozart To Three soon. Will announce my findings then.
But I've done it a little bit different from the example in the How to's
Here it is:
When the game starts, game.GameSpeed is set to 1 and game.OldGameSpeed is set to 0.8
Rule
When:
Attriute game.GameSpeed > game.OldGameSpeed
Timer
Every 1/game.GameSpeed seconds
Spawn Actor
Change Atribute game.OldGameSpeed to game.GameSpeed
otherwise:
ChangeAtribute: game.GameSpeed to game.GameSpeed * 1.1 (Here you can put in your new gamespeed)
Hope you can use it for your projects
Codemonkey, can we get a little love, man?
I guess the only way to adjust the timer speed is to reset the timer with the new speed, so i think the wiki page is kinda forcing the reset?
In my games I did it the lazy way
if progress > 100
spawn every 5
if progress is > 300
spawn every 3
if progress is > 500
spawn every 1
something like that anyways.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
http://gamesalad.com/game/play/43385
here's my test. it just keeps a steady pace.
Do you know if it is possible to open your testproject so I can look at it in detail. I only can play it in the moment.
http://gamesalad.com/game/play/43395
:->
should be the same link:
http://gamesalad.com/game/play/43395
Thanks for making this demo. Just can't get it to work when I do it - makes no sense!
I would have a look at your project but I cant open it.
I would have a look at your project but I cant open it.
I only get a Chess Game every time