How can I do multiple tests and return the number of succesful tests?

0 favourites
  • 4 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Hello, guys! Hope you are all doing well.

    I'm working on a "Table RPG" like D&D for mobile app.

    And I'm trying to do the following:

    - a test based on player's atributes. for example:

    1) Player has 3 points on Intelligence attribute

    2) So "3x 10-face" dice should be "rolled".

    3) If the result of each dice is higher than 6, it is a succesful test.

    4) So, I'm trying to generate 3 random round numbers from 1 to 10 simultaneously, and the result of this action should return the numbers of the scucesful tests. Is it possible to do it in a single action and return it to a variable?

    I have no clue on how to do it. Thank you so much for your help and time!

    Wish you all the best :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have no clue then it's going to be difficult to explain but you can use choose("1","2"..."10") to pick a random number and set a local variable to that value, then in a sub event check if variable is greater than 6, if so add 1 to a different variable. At the start of that event you would use a for loop or repeat to run it 3 times and if the second variable you're adding to = 3 then you can return that it passed.

  • I got it, thank you so much guys!

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