Possible to run timer off TableCellValue?
RabidParrot
Formally RabidParrot.Member Posts: 956
Hey guys,
I am trying to run a timer that states,
Every x seconds spawn actor. X is equal to (Main.table, Level, Spawn Interval)
As the level increases the spawn time decreases.
I am able to successfully pull the value from the table through a display text attribute, it just seems like the timer isn't accepting the value. The timer isn't spawning at the correct intervals.
I have provided screenshots below.
Thanks
Comments
I may be wrong on this but it looks like it's not working based off how you have your table cell value expression written out in the constrain attribute. I feel like your making it more complicated than it needs to be but kind of confusing how you are wanting this to work. Maybe if you could explain what you are trying to accomplish different than what you have already.
Thanks, @KillerPenguinStudios. I am trying to keep most of my data in tables because I feel like the app is less cluttered.
Anyways, every 10 seconds the level increases by one. The "Level" value is TableCellValue(Main.tb,1,8).
The spawn time value is TableCellValue(Main.tb, "Level" ,7)
Therefore I took the "Level" value and moved it into the spawn time value.
I got, TableCellValue(Main.tb,TableCellValue(Main.tb,1,8),7)
So if my level is:
1 the Spawn time changes to TableCellValue(Main.tb,1,7)
2 the Spawn time changes to TableCellValue(Main.tb,2,7)
3 the Spawn time changes to TableCellValue(Main.tb,3,7)
Like I said, I don't have an issue pulling the Spawn Time value and placing it in a display text attribute, but the timer doesn't spawn at the correct times.
ie. If the level is 2 and the spawn value is 4, the timer should spawn every 4 seconds.
The timer will end up spawning every random(3,6) seconds.
Thanks
I think once the timer starts running you can not change its time value. Try to stop and start it by switching the rule it is in on and off. If the timer keeps running which it probably does this won't work you might be better off destroying it and spawning a new one.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
Right. A timer expression is only evaluated once. In order to have a variable timer, you'll have to use something like this: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ok, thanks all!