[PLUGIN] Instance Group

Post your completed addons to share with the community

Post » Thu Mar 01, 2012 9:52 am

Instance Group
(Update: 2013/05/05)

This plugin contains groups indexed by name. Each group stored instances by UID. The group supports two kinds of data structures:
- set: union,complement,intersection
- list: sorting

In actions of this plugin, you can
- add/remove uid to/from a group
- union,complement,intersection
- shuffle a group
- sort by custom function
- pick instances from a group (using uid)
In conditions, you can
- retrieve a group
- test if a uid is in a group
In expressions, you can
- get uid from index (since group is a list)
- get index by uid

When instance destroyed, plugin will remove uid from groups automatically.



Here is an example.


You can sort the group by custom function.
1. Declare sorting function by "Condition: On sorting".
2. In this function, you can get two values from "Expression: CmpUIDA" and "Expression: CmpUIDB", using these two uid to pick up instances and compare them by your rule.
3. Finally, using "Action: Set compared result" to tell plugin which one is larger.


Advance: private group
"Expression: PrivateGroup" can return a special group name formatted by [code]"@" + uid + "$" + name[/code]. Group which created by these name will be destroyed automatically when instance had been destroyed.
For example, group "@10$aa","@10$bb" will be destroyed automatically when instance with (uid=10) has been destroyed.



PS. There is a small plugin which can provide "action:pick instance by UID". It can save events.rexrainbow2013-05-05 07:14:00
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Post » Thu Mar 01, 2012 9:20 pm

so powerful!!!
B
114
S
19
G
11
Posts: 186
Reputation: 13,498

Post » Fri Mar 02, 2012 1:01 am

Sorry, I put wrong image in the first thread. Fix it.rexrainbow2012-03-02 01:01:14
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Post » Fri Mar 02, 2012 4:27 am

I was working on a node-based path plugin, but I may just try something with this instead. Thanks!
B
13
S
5
G
2
Posts: 13
Reputation: 1,822

Post » Fri Mar 02, 2012 4:45 am

@unlikely

I made this plugin for storing/retrieving a group of instances in event sheet. It could be an input/output for other plugins.

For example, a kind of "filter" (plugin) will get instances from a (instance) group, do some computing, then put the result in another (instance) group.
So that user could get the result group to do their jobs in event sheet.

I'll need to define an api for this purpose.rexrainbow2012-03-02 04:53:57
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Post » Fri Mar 02, 2012 4:55 am

Yes, I see.

I'm still trying to figure out the best way to implement a path (not pathfinding, just path) system. I have started working on a plugin, but I am not sure I can get it to do exactly what I want. I'm also not sure precisely how to implement it, whether it be simply an array of points that also contain information about smoothness of the path there and relative speed adjustments, or something more simple.

I guess ideally I would have a path object with nodes that define the path and how the path is parametrized... I could ask the path for the position at a specific "time" along the path--a parametrized curve.

Sorry, I don't know if any of that ramble made sense, but that is my goal.unlikely2012-03-02 04:59:17
B
13
S
5
G
2
Posts: 13
Reputation: 1,822

Post » Fri Mar 02, 2012 5:05 am

@unlikely

I made Zigzag behavior before. It used a LOGO-like script to describe a path, like "F 100;R 60".
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Post » Fri Mar 02, 2012 5:08 am

Ah, yes, that looks fairly close to essentially what I'm after. It's not exactly what would be ideal in my situation, but it will certainly be helpful--I'll check it out. Thank you!
B
13
S
5
G
2
Posts: 13
Reputation: 1,822

Post » Fri Mar 02, 2012 11:48 pm

Nice Plugin rex...
B
38
S
12
G
11
Posts: 241
Reputation: 8,788

Post » Sat Mar 03, 2012 5:45 am

Update:

- Add missing expression description.
- Add "private group" feature to simulate private group of instance. Using "expression: PrivateGroup" to get private group name when getting a group. See the first post for more detail.rexrainbow2012-03-03 09:23:24
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Next

Return to Completed Addons

Who is online

Users browsing this forum: rexrainbow and 0 guests