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

Production Queue Overlay

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
ProductionQueueOverlaySystem

This system displays a Starcraft II-style production tab overlay for observers/referees and replays.

FEATURES
  • Create a production panel for each active players (12 first slots only)
  • Production panels display what each player is currently building (units, structures, upgrades, hero revives, and researches)
  • Every elements in the production tab has an icon, the number actively in production (not queued), and a progress bar indicating when the next entry will be finished
  • The production panels have a color indicator matching the players TeamColor
  • The element progress bars match the players TeamColor
  • (Experimental) Clicking on an element of the production tab will select the "producer" of that element and snap the camera to it (i.e click on a Footman element to select the producing Barracks)

HOW TO INSTALL
  • Copy the ProductionOverlay folder into your map
  • Remove the Dependencies folder if you already have those libraries installed
  • Add the definition: native GetUnitBuildTime takes integer unitId returns integer to the map header

HOW TO USE
This system works out of the box for melee games, but extra configuration is needed for custom data:
  • Custom Research that do not follow the 60(+15 per level) research time must be explicitly defined in the "InitProductionDataRepository" initializer function ("ProductionDataRepository" library)
    • Call the SetTypeIdBaseProductionTime function to define the base research time
    • If the research has several levels, call the SetTypeIdIncrementProductionTime function to define how much time is added to the total research time after the first level
  • Custom Research with multiple levels must their higher-level icons explicitly defined in the "InitProductionDataRepository" initializer function
    • Call the SetTypeIdIconPath function to define each icon past the first level (2 for the second level, 3 for the third level...)
  • Custom Hero with a build time other than 55 must have their build time defined in the InitProductionDataRepository initializer function ("ProductionDataRepository" library)
    • Call the SetTypeIdBaseProductionTime function to define the base training time
  • Custom Hero respawn rate (Gameplay constants)
    • Alter the "GetHeroReviveTime" function (ProductionDataRepository library) to reflect your changes

LIMITATIONS
  • The system can break if there are too many active player slots. Reduce the array size in the IntList struct to reduce error chance.
    • Default [24]: becomes unstable beyond 10 players
  • The system can break if there are too many different things being produced in parallel. Increase the array size in the IntList struct to reduce error chance.
    • Default [24]: up to 24 different things can be created at the same time (per player)
  • The system can break if there are too many things producing the same thing. Increase the array size in the IntList struct to reduce error chance.
    • Default [24]: up to 24 things can create the same thing at the same time (per player)

KNOWN ISSUES
  • The Night Elf "entangleinstant" creates a permanent entry in the production tab
  • The framerate tanks a bit during the first few seconds of the game
CHANGELOG
  • 1.0: initial version
249326-67d8702bee0c11fdf02329572622232b.png
  • 1.1: fixed save/load UI crash; added support for multi-tiered Research icon user-definition.
249368-8689808d54d743124ca0c613ea2399d5.png
  • 1.2: clickable elements (select + camera snap); simplified/improved some code in preparation for the next features.
  • 1.2.1: Fixed a bug that caused the first element in the queue to be interrupted in the overlay when cancelling another element further down the queue.

SPECIAL THANKS
Previews
Contents

Production Queue Overlay 1.2.1 (Map)

Reviews
Wrda
Changed to Useful as this has become deprecated for the latest patch (1.35) by user request.

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Unexpected behavior: making a building and then stop repairing it doesn't stop the progress bar of the frame (human race). Having multiple peasants focus on building the same structure isn't reflected on progress bar.

I think there should be a more clear distinction between what's belongs to the system and what is the example. Since the function InitProductionDataRepository is the example, it should be in a seperate script/trigger.
ProductionDataRepository, ProductionOverlayData and ProductionOverlayEvent's scripts have some variables which are acting as constant variables. I suggest to change them to the common practice (all capitalized and underscores).

StartUnitProductionAction, StartStructureProductionAction, StartUpgradeProductionAction, StartResearchProductionAction, StartReviveProductionAction, InitProductionOverlayEvent and InitProductionOverlayUi functions are missing nulling of some local variables, such as unit, player and trigger.
Personally, I would cache function calls that are called at least 3 times per the main function, even if it's not in a periodic loop.

A cool idea in its nature, could also be used for "build to fight" maps.
Since there's no game-breaking bugs, it's

Approved
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Oh, the Human Repair/Powerbuild is indeed a massive oversight, I'll try to find a solution to that. I'll push an update to address the other comments in the coming days. Thank you for the thorough review!
I think that was one of Nestharus's "unsolved mysteries" in his "resources that have yet to be coded" thread. Not much that can be done about that. Need API from Blizzard for true accuracy.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
JASSHelper is packaged with all World Editor installations post-reforged; it's not something you have to manually install. It does have to be manually enabled in many maps because it's off by default.

A map using vJASS does not prevent itself from being opened by an editor without vJASS support; it just can't be saved.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
Well, there's always the option that it can be useful for an earlier patch, but that's up to you.
I don't really have a graveyard option, but rather a "restricted". It still doesn't really look appropriate for this case. Either way, I'll message the staff about your case, just so there aren't any doubts.
 
Top