• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How do I make it so Mana/Health Pool alternate?

Status
Not open for further replies.
Level 2
Joined
Jun 12, 2008
Messages
13
I am trying to make it so that whenever a new match starts, there is a chance the fountain in the middle of the map becomes a mana or health pool. I am new to this whole stuff. So go easy on me :eekani:
 
Level 2
Joined
Jun 12, 2008
Messages
13
Here is the scenario. Each time the map loads, I want the fountain in the middle to be random. As in, each time the map loads, it could either be a health or mana fountain. Hopefully that clears things up.
 
Level 24
Joined
May 9, 2007
Messages
3,563
I will give you a trigger in one second.

  • Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RandomNumber = (Random real number between 0.00 and 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomNumber Greater than or equal to 5.00
        • Then - Actions
          • Unit - Fountain Chooser 0004 <gen> with a Fountain of Health using The old unit's relative life and mana
        • Else - Actions
          • Unit - Replace ountain Chooser 0004 <gen> with a Fountain of Mana using The old unit's relative life and mana
Easy.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Hawk that trigger will not function.
You could make a trigger like Hawk's just better. There are a bunch of ways to solve this but maybe this requires the least explanation.

(Random integer number between 0 and 1)
And the if statement should check if the random int is == 0 or not
Then create your fountain.
 
Level 2
Joined
Jun 12, 2008
Messages
13
I will give you a trigger in one second.

  • Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • [B] Set RandomNumber = (Random real number between 0.00 and 1.00)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)[/B]
          • If - Conditions
            • RandomNumber Greater than or equal to 5.00
          • Then - Actions
            • Unit - Fountain Chooser 0004 <gen> with a Fountain of Health using The old unit's relative life and mana
          • Else - Actions
            • Unit - Replace ountain Chooser 0004 <gen> with a Fountain of Mana using The old unit's relative life and mana
Easy.

Where is this Set RandomNumber area in the trigger commands. I am really new to this stuff =/
 
Level 3
Joined
Jun 3, 2008
Messages
52
Or you can just use random groups (Advanced > Random Groups menu). It's more friendly and no triggers required. Put Fountain of Mana and Health in, and give each 50% chance.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Even though you only randomize once here you should not use a real variable. An integer is smaller and faster to randomize, I believe.

  • Random
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set RandomInteger = (Random Integer number between 0 and 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
      • RandomInteger equal to 1
      • Then - Actions
      • Unit - Create a fountain of mana
      • Else - Actions
      • Unit - Create a fountain of life
 
Status
Not open for further replies.
Top