• 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.

[Trigger] Where is the funtion %?

Status
Not open for further replies.
Level 5
Joined
Jul 14, 2008
Messages
121
Like this :

  • Levels
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of [your spell] for [your unit]) Equal to 1
          • (Random integer number between 1 and 100) Less than or equal to 7
        • Then - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of [your spell] for [your unit]) Equal to 2
          • (Random integer number between 1 and 100) Less than or equal to 14
        • Then - Actions
        • Else - Actions
 
Level 7
Joined
Jul 20, 2008
Messages
377
There is no random real number as far as I'm aware. However, you can convert the random integer to a real number. Why do you need it as a real, anyway?
 
Level 15
Joined
Jun 14, 2009
Messages
494
i dont know what happens i do the trigger how you tell me and it doesn't worked i based the spell in critical strike for a passive and the unit that does the spell is Triggering unit or other trigger i need to use casting unit¿ or give the chance in critical strike??? i dont know what to do
 
Last edited:
Level 3
Joined
Dec 6, 2005
Messages
67
if i'm understanding you correctly it'd be

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Critical Strike for (Attacking unit)) Greater than 0
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of [your spell] for [your unit]) Equal to 1
        • (Random integer number between 1 and 100) Less than or equal to 7
      • Then - Actions
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of [your spell] for [your unit]) Equal to 2
            • (Random integer number between 1 and 100) Less than or equal to 14
          • Then - Actions
          • Else - Actions
etc, action bit stolen from Dvoth :p
 
Last edited:
There cannot be random real number.


Cos there are exactly infinity real numbers between 0 and 1. (not in WE, but that doesnt matter) And only chuck norris can count them all.

GetRandomReal() will truncate the number to a certain amount of digits.

Or am I misunderstanding you?
 
Level 3
Joined
Dec 6, 2005
Messages
67
@cokemonkey11 Effectively yes, while in theory the number of 'real' possibilities between say 1 and 2 is infinite, assuming an infinite number of decimal points .000000000000000000000000000000000000000000000000000000000000000000000000001
.000000000000000000000000000000000000000000000000000000000000000000000000002
kinda thinking lol, however the WE obviously has limits on how far out it can go, although those exact numbers i'm not sure on. Although from glancing at the trigger it looks like 2 decimal places... so 1-2 would be
1.00
1.01
1.02
....
1.99
2.00

Edit:that specific trigger function appears to go out 2 decimal places, the war3 itself almost certainly handles a few more places
 
Level 2
Joined
Jul 17, 2009
Messages
27
War3 should handle a fair few more decimal places internally. Damage, for instance, goes to 4 decimal places at the least.
 
Status
Not open for further replies.
Top