[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
46
S
17
G
18
Posts: 847
Reputation: 13,802

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
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Oct 16, 2011 11:48 pm

No go in r62.:(
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Oct 17, 2011 2:24 pm

What "recently" changed in the SDK ? Recently being between r55 and the current one.
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

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
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Oct 22, 2011 7:28 pm

Nice. Works like a charm now.
Thanks.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Oct 25, 2011 10:36 pm

Glad to hear that !
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

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
75
S
16
G
12
Posts: 322
Reputation: 11,608

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
46
S
17
G
18
Posts: 847
Reputation: 13,802

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
75
S
16
G
12
Posts: 322
Reputation: 11,608

Next

Return to Completed Addons

Who is online

Users browsing this forum: gamecorpstudio and 1 guest