[Plugin] Data structures in associative lists

Post your completed addons to share with the community

Post » Wed Aug 17, 2011 7:42 pm

Hi all !

I used my spare time at work to mess around with the plugin SDK. I decided to give a go at data structures and this little plugin was born !

I basically implemented the basic JavaScript's array functions (pop, shift, splice, etc.) for vectors, with all vectors stored in an associative list. Actions add data, and expressions remove it, although you can still remove data with an action (but without retrieving it).

Descriptions, names and such are a mess, but I think it's still pretty usable. If someone feels like cleaning the descriptions and giving more significative names to conditions, actions and expressions, or even adding more functionalities to the plugin, please do ! I did this just for kicks, but if it can be helpful for someone, then by all means use it !Magistross2011-08-17 19:43:39
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Mon Oct 10, 2011 3:54 pm

Wow, I totally overlooked this. And was actually about to try my hand at a plugin with the exact same functionality!

This is very helpful indeed, one of the things I was missing in C2 so far the most. I agree that some of the names/descriptions could be more intuitive for users that don't know the actual javascript terminology. Maybe I'll do something about that.

Very well done, thanks for this!
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Sun Oct 16, 2011 11:48 pm

No go in r62.:(
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Mon Oct 17, 2011 2:24 pm

What "recently" changed in the SDK ? Recently being between r55 and the current one.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Sat Oct 22, 2011 5:46 pm

It seems to work fine with current C2 versions if you edit the runtime.js a little.

Search for all occurences of "cr.plugins" and add an underscore, so it'll be "cr.plugins_". I think it just appears four times at the beginning of the file.
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Sat Oct 22, 2011 7:28 pm

Nice. Works like a charm now.
Thanks.
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Tue Oct 25, 2011 10:36 pm

Glad to hear that !
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Fri Oct 28, 2011 2:49 pm

Magistross, do you have a quick example you could post showing how to use this plugin?
Don't see the fnords and they won't eat you!
B
79
S
17
G
12
Posts: 323
Reputation: 11,850

Post » Tue Nov 01, 2011 4:45 pm

There you go !

I cooked this up in a hurry. Most of the functionnalities can be tested. It's all pretty basic, but might seem a bit hard to grasp if you're new to all this popping and shifting.

Note that you need to add data with push or unshift before you can do anything. (Inserting at index 0 in an empty data structure won't cut it)Magistross2011-11-01 16:45:39
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Wed Nov 02, 2011 11:15 am

Thank you, sir! This is exactly what I needed for a current project.
Don't see the fnords and they won't eat you!
B
79
S
17
G
12
Posts: 323
Reputation: 11,850

Next

Return to Completed Addons

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests