[Behavior] duration

Post your completed addons to share with the community

Post » Fri Jun 15, 2012 3:37 pm

Document, plugin and sample capx are included.

It is used to "run trigger every X second, persist Y second", or "turn on the switch, then turn off after Y second".
Last edited by rexrainbow on Thu Jul 31, 2014 4:37 pm, edited 2 times in total.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri Jun 15, 2012 4:50 pm

I try to download updating your repository of c2
and see a lot user upload also him plugins and Behavior
but I not see this
B
61
S
9
G
7
Posts: 176
Reputation: 8,824

Post » Fri Jun 15, 2012 11:55 pm

@felixsg

This behavior is named "rex_duration" in behavior list.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Sat Jun 16, 2012 12:31 am

Update:

- Fix bugs.
- Delete timer after duration finished.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Sun Jun 17, 2012 9:39 am

[QUOTE=rexrainbow] Duration behavior
(Update: 2012/06/16)

The idea of this behavior was came from @00Rez.
"Duration behavior" is a timer-like behavior. It will execute callbacks during duration. Like timer behavior, duration need to connect to timeline plugin and function plugin.

See sample capx for more detail.



Left side is the setting of duration:
Duration time = 1 second : start at 0, end at 1
Interval time = 0.3 second : intervals for each 0.3

Right side is the execution result:
0 -> execute callback "start"
0.3 -> execute callback "interval"
0.6 -> execute callback "interval"
0.9 -> execute callback "interval"
1 -> execute callback "end"

Set callback to "" (empty string) could skip this callback.[/QUOTE]

This is very good. There's one or two things missing so I'll upload my example and PM you a link to my behavior with a simple example to show you exactly what I mean. Thanks a lot for your time on this Rex!
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sun Jun 17, 2012 10:11 am

[QUOTE=00Rez] [QUOTE=rexrainbow] Duration behavior
(Update: 2012/06/16)

The idea of this behavior was came from @00Rez.
"Duration behavior" is a timer-like behavior. It will execute callbacks during duration. Like timer behavior, duration need to connect to timeline plugin and function plugin.

See sample capx for more detail.



Left side is the setting of duration:
Duration time = 1 second : start at 0, end at 1
Interval time = 0.3 second : intervals for each 0.3

Right side is the execution result:
0 -> execute callback "start"
0.3 -> execute callback "interval"
0.6 -> execute callback "interval"
0.9 -> execute callback "interval"
1 -> execute callback "end"

Set callback to "" (empty string) could skip this callback.[/QUOTE]

This is very good. There's one or two things missing so I'll upload my example and PM you a link to my behavior with a simple example to show you exactly what I mean. Thanks a lot for your time on this Rex![/QUOTE]

Here is the example to show you my behavior. Left click to move, left click and hold on enemy to attack. Wait till night to get stronger.00Rez2012-06-17 10:14:37
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Wed Jun 20, 2012 7:11 am

Update:

Allow setting interval time larger then duration time. In this case, duration behavior will only trigger "on start" and "on end" callback. It could replace one-shot timer behavior.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Thu Jul 31, 2014 4:31 pm

Update

- rewrite document.
- add feature to sync with object's timescale. (User need update timeline plugin first)
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Thu May 19, 2016 8:40 pm

Would it be possible to change timescale sync at runtime?
If it's not easy, I can just use a second behavior.
Already tested.
Image Image
B
161
S
48
G
91
Posts: 7,357
Reputation: 67,269

Post » Fri May 20, 2016 2:15 am

Update

Add "Action:Sync timescale" to enable or disable timescale synchronization in runtime.


@newt
Try this new updating.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Next

Return to Completed Addons

Who is online

Users browsing this forum: gamecorpstudio and 2 guests