• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] (Random integer between x and y)

Status
Not open for further replies.
Alright. I have one question.
Does this action:
  • Set Temp_Integer = (Random integer between 1 and 100)
Really give you 100 integers? Or just give you integers from 2, 3, 4, 5, 6, [...] 95, 96, 97, 98, 99? So in total there are only 98 integers. Meaning there are only 98 possible integers instead of 100.

For % chance triggers, like this:
  • Item Drop Chance
    • Events
      • Unit - A unit dies
    • Conditions
      • (Unit-type of (Triggering Unit)) Equal to Footman
    • Actions
      • Set Temp_Integer = (Random integer between 1 and 100)
      • If (All Conditions) are True, Then (Then Actions), Else (Else Actions)
        • If - Conditions
          • Temp_Integer Less than 6 // Simply a 5% chance
        • Then - Actions
          • Item - Create Claws of Attack +3 at (Position of (Triggering unit))
        • Else - Actions
          • Game - Game - Show a text message to (All Players): Haha you suck; you didn't get an item.
So since the integers start at 2, you won't get the 5% you hoped for. You'll only get a 4% chance.

Hence, using:
  • Set Temp_Integer = (Random integer between 0 and 101)
Should give you all of the 100 integers you need.

Am I right? Or does using (Random integer between 1 and 100) work and gives you all 100 integers?
 
Level 13
Joined
Sep 13, 2010
Messages
550
It will give you only one Random integer between the intervals you set. Like a 6 cube you roll and you will get a number. Random Integer between 1 and 6 The thing which gives you 1, 2, 3, 4, 5, etc 99 is the
  • Do Multiple ActionsFor each (Integer A) from 1 to 10, do (Actions)
 
Status
Not open for further replies.
Top