Spawning Rate Issues
I am having a small issue with spawning objects. Basically, using a real attribute called spawnRate, I have a timer going that spawns 1 of 25 random objects every 0.7 seconds. Everytime a particular event occurs, I want that amount of time to decrease by 0.05. I thought this would be as simple as change attribute with the values game.spawnRate to game.spawnRate - 0.05.
The problem is that while that value of spawnRate does decrease, the objects do not actually spawn at a faster rate.
Any ideas will be greatly appreciated.
The problem is that while that value of spawnRate does decrease, the objects do not actually spawn at a faster rate.
Any ideas will be greatly appreciated.
Comments
Go into GS creator and look in the new section for "Timer with Variable Rate". You'll need to copy that into your project exactly as it is in the demo. You'll need to recreate the attributes in your project. Be sure to check the "otherwise" sections in the spawner rules.
If you have deep blue designs project merger use that. If you don't have it GET IT!
create a boolean gameAttribute called something like Spawn
and a real gameAttribute spawnRate
on your trigger actor Rule
touch is pressed
spawnRate > 0
changeAttribute game.Spawn To: false
changeAttribute game.spawnRate To: game.spawnRate-0.05
Timer After 0.01 seconds changeAttribute game.Spawn To: true
on your Spawner actor
enclose the Timer in a Rule when game.Spawn is true
Every expression: game.spawnRate seconds
and do NOT check Run to Completion... as that will not allow for changes as long as the Spawn is true
---
think when you tell the computer to do something in programming Every... it does so regardless of trigger events initiated by user input... unless a condition is controlling the Every.
MH