• 🏆 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!

Randomization Script Request

Status
Not open for further replies.
Level 12
Joined
Dec 25, 2010
Messages
972
Hello.
I'm creating a faction called the Syndicate in that all of its units are randomized between Categories, in that you can't expect what will be each unit.
Example: as I'm using the Human Tech as base, and there's six units that are like footmen, Unit A, B, C, D, E and F. The script must roll and get one of the units to be The footmen and the script must run for each of the unit types, Footmen type, Riflemen type, Knight type, etc... This will also Apply to heroes in the faction's altar, aka the Tavern.
I wish to request Instructions explaining how to add new units to the script and that the script is MUI and leakless
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
So you click to build a footman on your Barracks, and when that unit enters the map after being trained it will randomly be one of the 6 variants. If you train another footman it could be the same or a different variant (random), not always the same static variant of the footman as the first one?
 
Level 12
Joined
Dec 25, 2010
Messages
972
Actually the randomness script happens at the start of the map (When it loads) and you get to keep the unit until you start the map again. The script will run for each of the unit types, Hiding the units of each unit type that were not selected
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
Should all of the variants be linked? So if I start up the map and get a variant E footman (for that run of the map, no other footman types will be created for me), will I also get variant E riflemen and variant E knights? Or could I get E footman, B riflemen, and A knights in the same map?
 
Level 12
Joined
Dec 25, 2010
Messages
972
It could be Variant E for Footman, Variant A for Rifleman, Variant B for Knight, Variant Z for Strength Hero, Variant D for Dexterity Hero, etcetera.
Only the builder will be a single unit (the Contractor)
The Player will not expect what unit he'll get, making it hard for them to make Tactics, but at the same time they will have the element of surprise over the other players
 
Level 23
Joined
Oct 18, 2008
Messages
936
  • Player Group - Pick every player in (All Players) and do (Actions)
    • Loop - Actions
      • Player - Limit training of A to 0 for (Picked player)
      • Player - Limit training of B to 0 for (Picked player)
      • Player - Limit training of C to 0 for (Picked player)
      • Player - Limit training of D to 0 for (Picked player)

then roll some dice and limit to -1 for one of the unittypes. your barracks should be able to train each one. the disabled ones won't show up in the UI at all
 
Level 12
Joined
Dec 25, 2010
Messages
972
Well, I tried that and found out it has incompatibilities with the
  • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
Trigger, So I tried the Availability trigger.
Here:
  • Base Melee Unit Randomizer
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RandomMelee = (Random integer number between 1 and 4)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make Footman A Unavailable for training/construction by (Picked player)
          • Player - Make Footman B Unavailable for training/construction by (Picked player)
          • Player - Make Footman C Unavailable for training/construction by (Picked player)
          • Player - Make Footman D Unavailable for training/construction by (Picked player)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomMelee Equal to 1
            • Then - Actions
              • Player - Make Footman A Available for training/construction by (Picked player)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomMelee Equal to 2
                • Then - Actions
                  • Player - Make Footman B Available for training/construction by (Picked player)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RandomMelee Equal to 3
                    • Then - Actions
                      • Player - Make Footman C Available for training/construction by (Picked player)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RandomMelee Equal to 4
                        • Then - Actions
                          • Player - Make Footman D Available for training/construction by (Picked player)
                        • Else - Actions
 
Status
Not open for further replies.
Top