Inline Repeat Extension - any need?
Anyone think they'd use an Inline Repeat Extension?
It's a more straightforward fastloop, it works like this:
Repeat 12 times:
-- Actions go here
And voila, it fastloops 12 times. Functionality is identical to this:
Always
-- Start loop 12 times
On Loop
-- Actions go here
Think anyone'd use it? It's super-simple to make, and can be combined with other conditions as follows:
Repeat 12 times
+ Counter < 5
-- Add 1 to counter
The counter stops at 5
Note that it's not the same as the existing repeat function, which is an Always that switches off after X continuous triggers.
Re: Inline Repeat Extension - any need?
Sure,I would gladly use it.
Marv
Re: Inline Repeat Extension - any need?
Quote:
Originally Posted by Dines
It's super-simple to make
Really? Go on then.
EDIT: I actually have an idea how it could work, but I'm pretty sure you're not allowed to call triggered conditions from inside a condition.
EDIT2: RFUNCTION_PUSHEVENT might allow it to work, assuming that you can call EVFLAGS_ALWAYS conditions with it.
Re: Inline Repeat Extension - any need?
Can't you call triggered conditions from the part of the extension that runs every frame? I never have used the extension SDK but from what I understand that seems possible.
Re: Inline Repeat Extension - any need?
You could do, but how would you know how many times to call it?
Re: Inline Repeat Extension - any need?
I guess you could.. trigger it once every frame, and then inside the condition that's triggered, trigger it for the number of times specified - 1. But please don't do that.
Re: Inline Repeat Extension - any need?
If you wouldn't mind, could you teach me how you did this (when you do it?)
Re: Inline Repeat Extension - any need?
This sounds interesting, it could be interesting to have some actions that effect the repeat also like stop and pause/wait.
So like
Repeat "Run" 12 times:
Add random value to counter
Counter is Greater Than 150:
Stop Repeat "Run"
These repeats would be nameable like a fastloop? or would you just directly use them to run actions?
Re: Inline Repeat Extension - any need?
It doesn't quite work like that - each repeat repeats only its own event. So for instance:
1. Repeat 12 times:
....[actions]
2. Repeat 3 times:
....[actions]
Will repeat line 1 twelve times and then go on to line 2 which will repeat 3 times.
So one possible use may be:
Repeat nObjects("Bad Guys") times
+ BadGuy's ID = index("Repeat")
--- [Do some AI stuff]
Would loop each badguy. In practice the new foreach object would do that too, but this is just an example.
You'll be able to retrieve your current index as an expression, and hopefully be able to prematurely stop the loop.
Re: Inline Repeat Extension - any need?
Quote:
Originally Posted by Dines
and hopefully be able to prematurely stop the loop.
How would we do that? Sub conditions? :p
Well, actually, I just thought, you could use a function object o fastloop call to evaluate more conditions :)