• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[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?
 
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.
Back
Top