[Plugin] RandomPlus

Post your completed addons to share with the community

Post » Thu May 23, 2013 7:26 pm

@cow_trix
Apologies for bringing this old thread up, but I can't figure the plugin out.

It takes three parameters, Seed/Min/Max.
If I set a seed and a Min/Max range, it should produce a persistent number for that seed, shouldn't it?
It doesn't, however. It produces random numbers within the range. Doesn't this defeat the point? My interest is in persistent seeded world generation.

Also, if I set min 10 and Max 100, it doesn't give me numbers from 10-99 (isn't that what the range is about?)

What am I missing? (running C2 r132)
Is there a new way to do this since then?

Is it best to use http://www.scirra.com/forum/plugin-seedrandom_topic60194.html ?christina2013-05-23 19:29:58
B
25
S
11
G
4
Posts: 191
Reputation: 4,402

Post » Thu May 23, 2013 8:02 pm

@christina

Seed gives you a repeatable random number. That means that every number generated with that seed will come out in the same order when you use that seed again.
Image ImageImage
B
165
S
49
G
146
Posts: 8,037
Reputation: 96,064

Post » Thu May 23, 2013 8:09 pm

@newt you're right! The example made me think the number is each time you hit the generate button.

Oh cool, this is perfect. Do you maybe know what RandomPlus-> Set Count to 0 means? It doesn't seem to do anything

Edit: ah got it, it returns the N randomly seeded number.

Thanks so much newt!christina2013-05-23 20:11:07
B
25
S
11
G
4
Posts: 191
Reputation: 4,402

Post » Thu May 23, 2013 8:12 pm

Its like another seed.
So if you were to set the count to 4, and the seed to 5 you would get different values than if you were to set the count to say 3, and seed to 5.
Image ImageImage
B
165
S
49
G
146
Posts: 8,037
Reputation: 96,064

Post » Thu May 23, 2013 8:30 pm

@newt you lifesaver :)

It seems however that min=0 means 0 and min=1 means 10 and min=2 means 20

@cow_trix are you sure you're not multiplying min*10 somewhere inside the plugin?
B
25
S
11
G
4
Posts: 191
Reputation: 4,402

Post » Sat Jul 13, 2013 11:28 am

Hey @christina, sorry for the late reply, I've been travelling for the past few months. Newt is correct on all counts except for what "Set Count to 0" does. This event basically resets the generator. For instance, the generator may output the following:

4 8 6 3 1 4 3 1

Resetting the count after all these values are generated means that the next value generated will be 4, then 8, and then so on and so forth. Basically the same numbers will be generated.

As for the problem with min/max, give me a bit to work it out. It's been over a year since I wrote this plugin and trying to understand old code is... fun.
B
55
S
12
G
8
Posts: 339
Reputation: 9,334

Post » Mon Apr 10, 2017 11:54 am

Hate to bump, sorry about that. Been setting up a new computer and one of my games uses this plugin, which I just tried to download right now.

So Avast is going nuts when I try to download this from OP; apparently it's ransomware? If it's somehow been infected, any chance of a mirror?
B
5
S
1
Posts: 4
Reputation: 373

Post » Mon Apr 10, 2017 12:19 pm

Jayextee wrote:Hate to bump, sorry about that. Been setting up a new computer and one of my games uses this plugin, which I just tried to download right now.

So Avast is going nuts when I try to download this from OP; apparently it's ransomware? If it's somehow been infected, any chance of a mirror?


Avast is not good, prone to false positives.

I've just downloaded the zip from OP and it downloaded and unzipped fine.

I then uploaded zip to https://virusscan.jotti.org which scans with all of the industry scanners and found nothing.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
74
Posts: 5,140
Reputation: 52,685

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests