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

Status
Not open for further replies.

DarkMatterBlast

D

DarkMatterBlast

So, in my game, I have an ability that is basicly russian roulette. I am using triggers to create the ability's affects. I know that there is a random number generator for int variables, but its not random in the least. The gun fires at the same time, every time. Any ideas on how to get an actual random number everytime?
 
The gun fires at the same time, every time.

Well, you have to base your ability off "Channel". Then set the Art - Animation Names (i dunno the exact name but the field shows up the animation names) to none.

Here. This is a sample trigger

  • Roulette Random Number
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability Being Cast) Equal To Russian Roulette
  • Actions
    • Set RandInt = (Random integer number between 1 and 20)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandInt Less than or Equal To 10
      • Then - Actions
        • ----Do anything here----
      • Else - Actions
        • Do Nothing
Im using code tags just in case accidental trigger typos.
 
Last edited by a moderator:
No, that would not be what to do. What you WOULD do is:

  • Roulette Random Number
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability Being Cast) Equal To Russian Roulette
  • Actions
    • Set RandInt = (Random integer number between 1 and 6)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandInt Equal To 6
      • Then - Actions
        • Kill Casting Unit (or whatever)
      • Else - Actions
        • Do Nothing
This is assuming you're simulating RR played with a revolver.

And jonadrian619, please use the trigger tags and not the code tags when posting triggers.
 
Do not worry, this is a BUG with testing in WE, it will not occure in multiplayer since the random number seed is always random then. You can try and fix it by changing the one WE option that influences the random seed generation for map testing but you do not need to worry since it still may occure. This has been asked so many times I am supriesed it can still be asked.
 
Under the test options, there is a way to FIX random. That is not what I wanted. I tried (Advanced>Cycle Random Groups) and it changed, so I believe the problem was the one mentioned by Dr. Super Good. I just hope that he is right about the randomizing everytime, because if not, this is going to be a really terrible game! lol Thanks for the help everyone.
 
It's not a bug. You probably just haven't turned off fixed seed in WE.
File -> Preferences -> Test Map -> Uncheck "Use Fixed Random Seed"

Simply seed is a number that determines the sequence of random numbers that will be generated in WC3. It's not really random at all but pseudo random. If you use the same seed you will get the same sequence of "random" numbers. The default in WE is to have this debug option on. When playing the map normally from within WC3 it will always use a random seed.
 
It's not a bug. You probably just haven't turned off fixed seed in WE.
File -> Preferences -> Test Map -> Uncheck "Use Fixed Random Seed"

Simply seed is a number that determines the sequence of random numbers that will be generated in WC3. It's not really random at all but pseudo random. If you use the same seed you will get the same sequence of "random" numbers. The default in WE is to have this debug option on. When playing the map normally from within WC3 it will always use a random seed.

That's exactly what I was saying... :/

-Mihai
 
Status
Not open for further replies.
Back
Top