selecting random skill to level up

0 favourites
  • 4 posts
From the Asset Store
A set of retro 16-Bit Neon UI elements to make your menus pop!
  • Hello, i have an issue. After leveling up i want the window to pop up with 3 different abilities to choose from ( from total 9), how to make shure that these 3 will be chosen randomly from those 9 and ensure that if skill is leveled up fully it is not shown in slelection

  • My initial approach would be to store all skills in an array. A second column could be used for the level of the skill if required.

    When you want to generate the skills, using advanced random object, create a permutation table of length array.width. This creates a random order of numbers from 0 to the last row of the array.

    Then the first three skills would be the first 3 numbers i.e. if 271840536 is generated then the skills to show are at array rows 2, 7 and 1.

    Every time you can pick the skills with, array.at(advancedrandom.permutation(0)), array.at(advancedrandom.permutation(1)), array.at(advancedrandom.permutation(2)).

    Any skills that are levelled up you would delete from the array before all of this so they can never be picked.

  • dropmefiles.com.ua/en/G5EZWc

    Wrote a simple example where you can level up a player. And after the increase there is an opportunity to choose 1 of three skills of which there are only 9.

    There is a variable that is responsible for the maximum level of skills.

    I tried to comment the code.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks for the help will try!

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