How to use Advance random plugin ?

0 favourites
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • I usually use blackhornet's SMART RANDOM plugin. I tried to use Official Advance Random Plugin but don't get the the idea how to use this.

    I only want to generate random numbers between 0-9 how to do this with this plugin?

    Thanks

    Tagged:

  • First you create a table:

    -> AdvancedRandom: Create permutation with 52 values starting at 1

    Then you select value as if it was a shuffled deck:

    AdvancedRandom.Permutation(index)

    Where index 0 is the first card, and 51 is the last.

  • No, I'm not getting it.

    Why value 52?

    i am getting only single number in the result

  • It creates an array of values between the 2 numbers you give, and then shuffles it. I presume they chose 52 because it's the number of playing cards in a deck.

    The expression tells you what card is in that location. If you want the next then just increment your index.

  • sprite "dots" has 10 frames and i copied it 10 times in layout Now i want each instance with different frame. I am unable to get this.

  • Example usage:

    ...and the resulting log message...

  • oh! Its very complicated for me

    I should stay with blackhornet's "SMART RANDOM" that's very easy to use

  • Should be as simple as having a loop and a counter variable. Something like this should work:

    It assumes that there's 10 instances, and 10 animation frames but you could put safety checks in place for that.

  • yup, now i got the result

    Thanks

    still smart random is easier than official plugin but i'll be continue with official advanced random.

  • We did look at the black hornets "smart random" plugin when adding the permutation tables. They fulfil a slightly different purpose, but can be used to produce non-repeating random numbers like "smart random" does. If your happier with the way "smart random" works then I encourage you to keep using it for that, but it's worth knowing what "Advanced Random" offers as well.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I like "Smart Random" plugin but still i want to learn"Advance Random". Today i did research and tried to understand what is "permutation table" and "probability table" unfortunately i did not found enough but i got some ideas about them.

    there are also "octave" and "gradient" which i don't know what these features does, i have seen example files but they are out mind.

    But i'm sure in the future i'll also got them too.

  • If you haven't read it I would recommend looking at my tutorial on using the advanced random plugin. It doesn't cover the complete feature set, but it's a good starting place.

    A "permutation" refers to an arrangement of values. Hence a "permutation table" is an "table" / "array" /"list" of values that have been rearranged. In this case we are "shuffling" them, so arranging them in a random order.

    It has 2 main uses that I have come across. The first is to produce a non-repeating random sequence of values like your trying to. The second is when you wish to associate a value with a random value in a repeatable way. "Perlin noise" uses a permutation table to give specific "random" values for a location.

    Probability tables are basically for doing random drops in games. You can specify a value ( string or number ) and the chance it will be chosen. Then the expression for it will choose one of the values for you.

    Octaves are related to a concept called "fractional brownian motion" which we use with the various "noise" algorithms to improve the quality. Each octave is an additional layer of noise that is applied on top. There's some diagrams demonstrating it in the tutorial.

    Gradient are linear gradients with support for multiple value stops. They support both colours and values.

    All the features have notes and explanations on the manual page, but the ideas that the Advanced Random plugin cover tend to be a bit more complicated than others.

  • Hi Nepeo

    is there a way to create multiple permutation table?

    i have 2 different objects which needs 2 different permutation table.

    if i create a new permutation table then how can i follow both old and new sequence?

  • luckyrawatlucky you can't create multiple ones at the moment I'm afraid. The easiest solution is probably to store the values into an array object. The only thing you lose doing this is the index wrap around when trying to read values, but I'm guessing not many people are relying on that.

  • another question

    How to i set gradient to sprite?

    i did follow steps

    create color gradient called "myColor"

    add stop point at 0 with value rgbEX(255,0,0)

    add stop point at 1 with value rgbEX(0,255,0)

    Now how to apply this gradient in Sprite

    i tried with expression AdvancedRandom.Gradient()

    but it only requires numbers in the ()

    if i gave it 0 it gave color rgbEX(255,0,0) and if i gave it 1 then rgbEX(0,255,0)

    how do i give sprite gradient?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)