I giv up. spawn an object after one is destroyed and have it work properly?
StormyStudio
United KingdomMember Posts: 3,989
Ok, I've been trying this for a total of 6 hours now. and my head is starting to implode.
Basic Info:
Gravity is affecting the scene.
I need a spawned object to follow the rules inside it properly!!
Want to keep the memory needed to a minimum if possible
I have tried numerous ways...and I'm 99% of the way there.
What I wanted (and nearly have):
I have an actor (a block) which when pressed, displays a countdown when it reaches 0 it is destroyed and plays a short png sequence of it being destroyed.
After 2 seconds a new actor block (the same sort) is spawned and falls from the top of the screen.
This all works fine. But the timer on the new spawned block displays '0' rather than the starting value of 15.
If I tell the block to change the value of the object_timer.attribute to 15 before being destroyed, the new spawned block shows '15' but the timer does not go down when touched. Even though the rule exists.
If timer = 15 , for 15 seconds, every 1 second go down 1 number. (it works on the first block).
Originally I had the block actor spawn the new one before being destroyed, and the 1st new spawned actor block worked as it should, but the next one generated after the new one is destroyed did not work. (showed 0 or 15 on spawning as above). I beleive this went wrong because Destroying the actor causes some issues.
now i have it so a separate actor 'sceneControl' which sees if an 'block spawn attribute' goes above 0 it spawns a new block, and minuses 1 from the 'block spawn attribute'. When the block is destroyed after countdown of 15 secs it adds 1 to the 'block spawn attribute'
But the new spawned block does not count down when pressed?
The exploding animation spawns and plays fine.
Anyone, get there head round all the words I've just typed, any ideas?
many many thanks
D3000
Basic Info:
Gravity is affecting the scene.
I need a spawned object to follow the rules inside it properly!!
Want to keep the memory needed to a minimum if possible
I have tried numerous ways...and I'm 99% of the way there.
What I wanted (and nearly have):
I have an actor (a block) which when pressed, displays a countdown when it reaches 0 it is destroyed and plays a short png sequence of it being destroyed.
After 2 seconds a new actor block (the same sort) is spawned and falls from the top of the screen.
This all works fine. But the timer on the new spawned block displays '0' rather than the starting value of 15.
If I tell the block to change the value of the object_timer.attribute to 15 before being destroyed, the new spawned block shows '15' but the timer does not go down when touched. Even though the rule exists.
If timer = 15 , for 15 seconds, every 1 second go down 1 number. (it works on the first block).
Originally I had the block actor spawn the new one before being destroyed, and the 1st new spawned actor block worked as it should, but the next one generated after the new one is destroyed did not work. (showed 0 or 15 on spawning as above). I beleive this went wrong because Destroying the actor causes some issues.
now i have it so a separate actor 'sceneControl' which sees if an 'block spawn attribute' goes above 0 it spawns a new block, and minuses 1 from the 'block spawn attribute'. When the block is destroyed after countdown of 15 secs it adds 1 to the 'block spawn attribute'
But the new spawned block does not count down when pressed?
The exploding animation spawns and plays fine.
Anyone, get there head round all the words I've just typed, any ideas?
many many thanks
D3000
Comments
Cheers firemaple. Will give that a go tomorow.
Sounds like it would work fine with some tinkering changing some attributes.
If plan of attack 1 doesn't work after a while...
scrap it and try a different route. Usually, after the first attempt...that knowledge will assist you in finding a more logical and more elegant way to approach the problem plus if forces you to rethink the steps needed and possibly simplify those step sequences.
Don't get stuck in a rut...be flexible.
I've been coding for 10 years now...rarely is the first approach the best approach...even now after that experience.
smoother now. Keep tryig to look at it from a fresh perspective. Does it look good, is it fun to play. What can I add? Take away? Etc etc. Still holdin off making the next levels. Just want to get it as spot on as I can.