[PLUGIN] While-loop

Forum Home Forum Home > Construct 2 Development > Plugins for Construct 2
 Post Reply Post Reply Page  123 4>
Author
10,250 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Topic: [PLUGIN] While-loop
    Posted: 18 Jan 2012 at 7:12am
While-loop
(Update: 2012/02/15)

A very small plugin.
While-loop will repeat if the "condition value" is larger then 0.
while (condition value > 0)
{
    do something...
}


Example



Remember to set initialize condition value before entering while-loop, and don't forget to set the condition value equal or less then 0 to leave while-loop.

Using more then one while-loop object to implement multi-layer while-loop.

Edited by rexrainbow - 15 Feb 2012 at 3:08am
Back to Top
3,857 Rep
Post Options Post Options   Quote eyeliner Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jan 2012 at 11:52am
Very useful! And long overdue.
Back to Top
3,046 Rep
Post Options Post Options   Quote ayzhong Quote  Post ReplyReply Direct Link To This Post Posted: 20 Jan 2012 at 2:44am
^thanks! i love this (and your function plugin)
Back to Top
9,635 Rep
Post Options Post Options   Quote gammabeam Quote  Post ReplyReply Direct Link To This Post Posted: 20 Jan 2012 at 6:36am
Yeah! This will be very handy!
Thanks rex!
Back to Top
1,698 Rep
Post Options Post Options   Quote Khaz Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 12:50am
How could one implement a time based trigger?

System --> wait makes the plug in break down.

><

Thanks!
Back to Top
10,250 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 1:06am
@Khaz

Try Timeline plugin, or Timer behavior.

Edited by rexrainbow - 28 Jan 2012 at 1:11am
Back to Top
1,698 Rep
Post Options Post Options   Quote Khaz Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 1:54am
I keep getting a 'trigger found as subevent to loop::not allowed' error

mind pointing out what is wrong?



Thanks a lot for your help. :)
Back to Top
10,250 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 3:19am
@Khaz
Uh, I'm not sure...
I guess that C2 editor does not allow add a sub-condition with "condition:while", so you can put sub-condition into sub-event.
Back to Top
1,698 Rep
Post Options Post Options   Quote Khaz Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 3:45am
Would you mind taking a look at my .capx

Appreciated. :)
Back to Top
10,250 Rep
Post Options Post Options   Quote rexrainbow Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2012 at 5:03am
@Khaz

This problem is caused by "function plugin", you can not put "Condition:on function" into sub-event.

Condition with green arrow like "start of layout" can not be put in sub-event.

Edited by rexrainbow - 28 Jan 2012 at 5:04am
Back to Top
 Post Reply Post Reply Page  123 4>

Forum Jump Forum Permissions View Drop Down