[Plugin] RandomArray

Post your completed addons to share with the community

Post » Fri Oct 14, 2011 10:49 pm

Hi,

I modified the Plugin "Array" a little so that you get an array of unique random numbers. You can also set a startvalue for the randomnumbers via the Properties panel.

_________________
[Update 2] v 1.1
[Add] Action "set size" Number
Plugin Random Array (1.1) - demo,capx,plugin
_________________
[Update1]
HowtTo - Plugin Random Array
Plugin
Scramble Cards Example
_________________

Plugin randomArray - old version

All suggestions are welcome. Joe72012-04-09 21:47:48
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sat Oct 29, 2011 1:20 pm

Thanks ! Exactly what I needed for one of my project.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sun Oct 30, 2011 4:51 pm

You're welcome.

I've updated the plugin and made two examples.
Have fun. Joe7
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Nov 02, 2011 10:09 am

Just to point a quick problem : you seems to have changed the namespace or something between the two iterations. I made a project with the first version you posted, and we trying to reopen it with the new version, I have a text box saying that there's a name problem with the plugin.
I opened the project XML file, and saw that the first version was declared as something like :
[quote]
        <object-type name="RandomArray">
            <plugin id="rL" name="Random Array" />
        </object-type>
[/quote]
and the new version declares something like :
[quote]
        <object-type name="RandomArray">
            <plugin id="rA" name="Random Array" />
        </object-type>
[/quote]
Just editing the change inside the XML doesn't allows Construct to load the project. I reverted back to the old version for the moment, and when I have the time, I'm going to copy/paste in a new project, with the new version, but it's a little problem for the moment...Pode2011-11-02 10:09:35
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed Nov 02, 2011 11:02 am

Hello Pode,
yes, i've changed nearly all in the new version and the versions are incompatible - they have a different datastructure for saving values.

1) The new version uses an array with only one dimension - width.

2) The old version is based on the Array-Plugin (you have a 3d-array but random array-Plugin uses only the first dimension).

=> But you can use both versions together, when you need it - ie to port your project to use the new plugin version or to stick with one project at the old version.





Joe7 Joe72011-11-02 11:14:05
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Nov 02, 2011 12:32 pm

Okay ! I didin't think of that solution. It's a bit dirty, but quick. Thanks ;)
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sun Nov 13, 2011 3:34 pm

very powerful...tnx Joe
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Sun Apr 08, 2012 4:16 pm

Joe - yet another plugin of yours that I've found extremely useful! I was just wondering if there was a way to dynamically set the size of the array.

Thanks a ton

TNewhook
B
12
S
3
G
4
Posts: 55
Reputation: 3,186

Post » Sun Apr 08, 2012 6:10 pm

@tnewhook: Nope. Isn't implemented, it's a very simple plugin. Possible with "normal" arrays?

[Edit]
@tnewhook: Random array has a "New size" action. Joe72012-04-10 08:52:00
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Apr 11, 2012 7:08 am

Wow, Joe! Thanks a ton! I did figure out how to do it with normal arrays, though.
B
12
S
3
G
4
Posts: 55
Reputation: 3,186

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests