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

[Solved] Limiting Unit Construction based on Player Color

Status
Not open for further replies.
Level 4
Joined
May 20, 2011
Messages
59
Hey Guys,

Is there a way to limit unit construction based on player color? Preferably not through triggers but rather through the Object Editor? Similar to how in some Maps such as Greece you have Special Unit upgrades depending on faction, yet are built in the same building. Or is this not possible and the map maker simply used a facade by naming the unit the same name for each faction but in technicality they are different units? Any insight would be greatly appreciated, thank you.

Cordially,
Adorm
 
Without triggers you would have to make a copy of each structure that produces unique units for each faction, and a copy of your worker unit for each faction (and town hall or whatever produces the workers). The just replace the unique structure in the faction workers buildable structures list. With same names, ect, as you said.

It is a lot easier with triggers though, and requires no duplication.
 
Level 4
Joined
May 20, 2011
Messages
59
Without triggers you would have to make a copy of each structure that produces unique units for each faction, and a copy of your worker unit for each faction (and town hall or whatever produces the workers). The just replace the unique structure in the faction workers buildable structures list. With same names, ect, as you said.

It is a lot easier with triggers though, and requires no duplication.
How would it be done with Triggers? Currently I'm duplicating literally dozens of unique units to have them specific for each faction and its quite tedious.
 
Factions are based on player numbers/colors?

if so, something like this:

  • Factions
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Make 'Your Unit' Unavailable for training/construction by Player 1 (Red)
If you want a unit to only be available for one player, you can do this:

  • Factions
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Make Footman Unavailable for training/construction by (Player((Integer A)))
      • Player - Make Footman Available for training/construction by Player 1 (Red)
The action makes the unit/structure available/unavailable for a player. Per default all units is available for all players. The loop just removes availability for all 12 players, then makes it available for one player. To use the triggers you just have to make your structures produce all units, then make them unavailable for the players that does not belong to that faction.
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
In the object editor:

Create a copy of the original worker unit for each nation.
Create a copy of each barrack for each nation.

Add "greek" units to one barrack, "american" units to the other and so on.
Give to each worker these buildings.
Set the barrack to be constructed by each nation worker.

Since the worker and the barracks keeps the same name as the original ones, it looks like they're the same unit and building.
 
Status
Not open for further replies.
Top