# Should I use Less than or equal to or just Equal to?

Status
Not open for further replies.

#### Player

Level 7
- See the link http://www.hiveworkshop.com/forums/world-editor-help-zone-98/gamble-32509/
See what Xarwin shows - at the line If Conditions: ... less than or equal to...

1. How to understand this "...less than or equal to..." and just "...equal to..."???

2. Which is better if you wish to make a % random chance for every Item? is it "less than or equal to" or "equal to" better?

- Someone just explain me the difference between the two cause I don't know how to understand this!?

#### defskull

Level 33
• (Random integer number between 10 and 100) Less than or equal to 30
This means it will enumerate values from 10 to 30 out of 100 (30%)

• (Random integer number between 10 and 100) Equal to 30
This means it will enumerate values just 30 meaning it is 1%

#### Bannar

Code Reviewer
Level 26
Remember to avoid using 'from 0', it's better to use positive values (like 1 or 10) because it's incorrect in most proc cases (although you can reduce the maximum value too )

+ remove Do nothing from linked trigger if you gonna use it, it sucks

#### Player

Level 7
What if it is between 1 and 100 not between 10 and 100?!
So "less than or equal to" is the better choice under this conditions.

- And what is this - "Then - Actions: Item - Create (Random level 1 item-type) at (your position)" good for?! The Items I use are of levels different than lvl 1!?! <- This I don't understand!?!?

#### Bannar

Code Reviewer
Level 26
• (Random integer number between 1 and 100) (...)
Whats the problem?

#### Player

Level 7
1. Between 1 and 100 you have 100 numbers and between 10 and 100 you have 90 numbers; do I get it right? If yes than I understand this correctly.
If no, explain please.

2. The thing I don't understand is:
If "less than of equal to" means a number between 1 and 30 (in this case) does it mean that any number from 1 to 30 is included in this 30% chance?

3. And what if I have few other items with less than 30%, let's say 10%,15%,20% isn't there gonna be a conflict which item to give to the Player's unit?!?!?!

Buddies I already found a better solution but I need this things explained just to understand how they work - I might need them in future!

Status
Not open for further replies.

Replies
6
Views
458
Replies
7
Views
334
Replies
2
Views
603
Replies
3
Views
2K
Replies
6
Views
791