• 🏆 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 to lock Player Race but make Team selectable.

Level 3
Joined
Jun 11, 2023
Messages
6
Hey,

in my map I would like players to be able to freely select their team to enable FFA, 2v2, 3v3, 2v2v2, etc, but the race should always be locked to human (to have the human interface/sounds/...). Fixing color would also be nice, but is a bonus (and I know I can set it via trigger in game anyway).

I know I can fix the race via force properties, but then the players can't choose the team.

Is there a way?

Thanks a lot!
 
Unfortunately, you can't have both a forced race selection and allow for FFA, 2v2, 3v3, etc, in the World Editor and in-game, well at least natively. Locking the race to Human for each player requires the Force Settings be ticked, and allowing diverse team scenarios requires that the Force Settings be unticked, which is antithetical to the desired effect of a forced race preference.

With that limitation, the next best thing you can do is explicitly state to the playerbase that they can only have access to Human units, regardless of their initial race selection. With that established, you'll need a custom UI manager that will force the game UI to resemble that of the Human race, and you have to manually call the blizzard function MeleeStartingUnitsHuman(player whichPlayer, ...), which can be found in blizzard.j, which can either be extracted with CASC or directly retrieved from the wc3 root directory. Still, one inherent and troublesome limitation to this are the voice notifications for each race popping out, which might break immersion.

With the above approach, you'll have to carefully call the function only for active players, since that logic isn't incorporated into the above function.
 
Level 3
Joined
Jun 11, 2023
Messages
6
Thanks a lot for your replies!

@Tristronic fixing the start locations really only fixes the start locations, not race/color/...

@MyPad Ok, thanks for your input! I checked out that function, and it only takes care of creating the starting units, right? I create the starting units myself, the issue is really just the interface. So I guess I need a UI manager, which is something I never looked into. Might check it out.

For now, I will leave it as is, and players have to remember to pick human if they want the fitting interface. At some point, I might move towards using forces, and do the team selection in game. Will have to think about it a bit more.

Thanks for your help!
 
Top