What is 10%?

xAnaMorphine

Active Member
Reaction score
43
Hello thehelper.net,

I want my ability to trigger 10%/15%/20% of the time; so
Trigger:
  • (Random real number between 1.00 and 100.00) greater equal 90.00)
= 10%?

and for 15% it would be;

Trigger:
  • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_2">
    • <li class="lasttree"><span class="default">(Random real number between 1.00 and 100.00) greater equal 85.00)</span></li>
    • </ul>
    • </div></div>
    • I am not sure about this, can anyone confirm?
 

Lifee

New Member
Reaction score
46
Hello thehelper.net,

I want my ability to trigger 10%/15%/20% of the time; so
Trigger:
  • (Random real number between 1.00 and 100.00) greater equal 90.00)
= 10%?

and for 15% it would be;

Trigger:
  • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_5">
    • <li class="lasttree"><span class="default">(Random real number between 1.00 and 100.00) greater equal 85.00)</span></li>
    • </ul>
    • </div></div>
    • I am not sure about this, can anyone confirm?
Trigger:
  • The first trigger : it is greater equal than 90.00,so if the random number is 90 it wont trigger your ability = 9% chance
    • Same for second trigger = 14% chance
 

decored

New Member
Reaction score
3
Random 1-100 less than or equal to 10=10%
Lower values are mostly favoured
Yours can also be correct but use it alongwith 'or equal to'
 

Inflicted

Currently inactive
Reaction score
63
Yours can also be correct but use it alongwith 'or equal to'

i think thats what this is: "greater equal" - just a mere spelling/grammer error.

The first trigger : it is greater equal than 90.00,so if the random number is 90 it wont trigger your ability = 9% chance

check here:
JASS:
90 91 92 93 94 95 96 97 98 99 100 [Number]
1  2  3  4  5  6  7  8  9  10 11 [%]



it's actually 11% so you could make it (more than or equal to 91) if u wanted 10%.

EDIT: i just proved myself wrong :/
lol ok i also advise making it:
Trigger:
  • (Random real number between 1.00 and 100.00) less than or equal to 10)

its just simpler and easier to grasp what is going on..
 

perkeyone

something clever
Reaction score
71
i recommend using integers since they are less confusing.

for integers... 10% can be written either of these ways
Trigger:
  • (Random integer number between 1 and 100) greater than 90)
Trigger:
  • (Random integer number between 1 and 100) less than or equal to 10)


if you insist on using reals... 10% can be written either of these ways
Trigger:
  • (Random integer number between 0.01 and 100.00) greater than 90.00)
Trigger:
  • (Random integer number between 0.01 and 100.00) less than or equal to 10.00)

to understand why we should start at 0.01 instead of 1.00, try to imagine whole numbers instead of decimals...
so instead of 100.00, think of 10000. logically you would want the range to start at 0.01 (think of 1) and not 1.00 (think of 100)

the code you posted
Trigger:
  • (Random real number between 1.00 and 100.00) greater equal 90.00)
Trigger:
  • (Random real number between 1.00 and 100.00) greater equal 85.00)
in the first one, the range of values is 9901 and the number of values that work is 1001... or about 10.1%
in the second one, the range of values is 9901 and the number of values that work is 1501... or about 15.1%
only a tiny bit off from what you wanted but it seems like you want to be precise.
 

Inflicted

Currently inactive
Reaction score
63
yeah i agree, integers are "better".. but ag does that 0.1% really make a difference? doubt its even noticable. but if you want to be precise then use that stated above.
 

xAnaMorphine

Active Member
Reaction score
43
i recommend using integers since they are less confusing.

for integers... 10% can be written either of these ways
Trigger:
  • (Random integer number between 1 and 100) greater than 90)
Trigger:
  • (Random integer number between 1 and 100) less than or equal to 10)


if you insist on using reals... 10% can be written either of these ways
Trigger:
  • (Random integer number between 0.01 and 100.00) greater than 90.00)
Trigger:
  • (Random integer number between 0.01 and 100.00) less than or equal to 10.00)

to understand why we should start at 0.01 instead of 1.00, try to imagine whole numbers instead of decimals...
so instead of 100.00, think of 10000. logically you would want the range to start at 0.01 (think of 1) and not 1.00 (think of 100)

the code you posted
in the first one, the range of values is 9901 and the number of values that work is 1001... or about 10.1%
in the second one, the range of values is 9901 and the number of values that work is 1501... or about 15.1%
only a tiny bit off from what you wanted but it seems like you want to be precise.

Trigger:
  • (Random real number between 0.01 and 10.0) greater equal 9.0)


So, I will use this?
 

dabum

New Member
Reaction score
0
Trigger:
  • (Random real number between 0.01 and 10.0) greater equal 9.0)


So, I will use this?

No, what you posted is (Random Number between 1% and 1000%) Greater than or equal to 900%

Trigger:
  • (Random real number between 0.01 and 1.0) greater equal .90)
This will give you 10%
 

Inflicted

Currently inactive
Reaction score
63
(Random number between [1 and 100]) less than or equal to 10)

is the simplest in my opinion..

just keep it in integer's, alot cleaner and same effect.
 

perkeyone

something clever
Reaction score
71
keep it simple
use integers
use "less than or equal to"

(Random integer number between 1 and 100) less than or equal to 10) = 10%
(Random integer number between 1 and 100) less than or equal to 15) = 15%

EDIT: NooB_GameMkR has the same idea, i agree entirely.
 

Bogrim

y hello thar
Reaction score
154
It's a lot easier to use "less than or equal to", for example: Random number between 0.01 and 10.00 less than or equal to 1.50 (15%)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top