Rules Question (not reacting as intended?)
Hello,
It is really strange but I thought a rule always runs while the conditions hold true.
Example:
When All Conditions Are Valid
enemies > 0
Spawn New Enemy
The above is just an example but I would assume that it will keep spawning enemies until enemies=0.
It doesnt work with me. The only thing I can think of is that the methods I have in the rule are "actions" and not "behaviors" and are only executing once.
Do I really need to use timers for this? Or did I miss something obvious :S
Thanks for any help I can get on this
It is really strange but I thought a rule always runs while the conditions hold true.
Example:
When All Conditions Are Valid
enemies > 0
Spawn New Enemy
The above is just an example but I would assume that it will keep spawning enemies until enemies=0.
It doesnt work with me. The only thing I can think of is that the methods I have in the rule are "actions" and not "behaviors" and are only executing once.
Do I really need to use timers for this? Or did I miss something obvious :S
Thanks for any help I can get on this
Best Answer
-
xforce Posts: 187
you need the timer. the spawn actor behaviour only fires off once unless you give it conditions to keep triggering. so you could do something like
timer every 0 seconds spawn actor enemy
which will work but it will spawn them like crazy unless you have another rule to stop it when it hits a certain number. make the timer a smaller number if its spawning too fast. 0.1, 0.05, etc
so yes if you want it constant add the timer
Answers
did you have a counter for your enemies?
(to count how many enemies you have)
And yup, I do have a counter
So what you are asking is that spawning doesn't stop at 0?
Just to clarify ~
~~
But it was only firing off once as xforce stated despite my conditions not having been met. I did use a time to resolve it but wondered why action would not keep executing until the conditions have been met (in my case reaching x squares)
From a technical standpoint it seems the rule has a state Boolean to see if it is a rule governed by behaviors or by actions....a behavior inside the rule will set that state to active till the conditions are met but not so in the case of actions in the rule....
Does that sound about right?
but, to have a rule fire till all conditions are met … without using Timer behavior:
demo: http://www.mediafire.com/?32suav885g8p0j6