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

A destructible techtree

Level 23
Joined
Oct 12, 2008
Messages
1,783
2 problems

1. Im trying to create a system where tech requirements are based on X number of units (eg. Captain requires 5 Footmen)

In the Obj Editor, setting "Requirement = 'Footmen' and Level requirement = 5" actually works.
However in the UI, it simply says 'requires Footmen' and doesn't include the number.

One workaround is to have the req. be a dummy unit named '5 footmen' - however this gets very object intensive when expanded to an entire techtree.

2. Is there a way to decrease level of upgrade?
 
Level 20
Joined
Aug 29, 2012
Messages
832
1. Can't think of any way that would be less difficult than just creating a few dummy units, except simply specifying the number that players need in the tooltip

2. You can use "set level of research for player" to increase or decrease, it wasn't the case for a while but it's been changed either by a patch or by reforged, can't remember
 
Last edited:
Level 12
Joined
Jan 10, 2023
Messages
191
1. Name the unit "5 Footman" and do this? On second thought, don't use this trigger. Doing this will still leave you with a player message that reads "Completed: 5 Footman" every time a Footman is made. I edited my comment below and included a demo that demonstrates everything I learned about this functionality.
  • NameFootman
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to 5 Footman
    • Actions
      • Unit - Set Name of (Trained unit) to Footman

Edit: This function of the Object editor is only an option if you would have the same quantity required for each Unit Type that is required.
The short summary if my findings:
If you want to require 5 Footman and 5 Rifleman to make a Knight, you can.
If you want to require 5 Footman and 4 Rifleman to make a Knight, it will be 5 Rifleman or 0.
If you want to require 5 Footman and 1 Blacksmith to make a Rifleman, it will be 5 Blacksmiths or 0.

This is one simple option, which would not require you to change the name or to use dummy units with dependency equivalents:
1690600777465.png

You do still need to set the "Techtree - Requirements - Levels" field to 5.

I did a little bit of playing around with this feature and there are some key functionality notes I've found, this could be useful:
  1. If there are multiple Unit Types in the "Techtree - Requirements" field and only one integer in the "Techtree - Requirements - Levels" field, then it will be required that you have that many of each of those Unit Types, so these examples, will both require Five Footman and Five Townhalls:
    • 1690602105171.png
    • 1690602179818.png
  2. If there are multiple Unit Types in the "Techtree - Requirements" field and multiple integers in the "Techtree - Requirements - Levels" field, then all requirements except the first listed Unit Type and integer will be ignored, in these examples, Three Footman are required and Zero Townhalls:
    • 1690602495675.png
    • 1690603158877.png
    • 1690603206764.png
  3. If the first integer is Zero in the "Techtree - Requirements - Levels" field, then there is no requirement at all:
    • 1690602692311.png
    • 1690602739491.png
With all that being said, unless the unit needs to require the same number of units from all listed types, this won't be a valid option, but otherwise it's an interesting thing to think of how to manipulate. Unfortunately, I've never had luck changing Unit Array Fields with triggers/ code, but that could change!

I made a demo map that proves/ demonstrates everything I said here and causes the user of the demo to see first-hand why they shouldn't change the Unit's name with triggers.

Here is how I made it look nice for the demo:

To hack the tech-requirement tooltip when more than one type of unit is required (you must require the same quantity of each type!):
  1. To achieve a tooltip like this:
    • 1690608852115.png
  2. In the Object Editor, make a Dummy Unit and Set the "Techtree - Dependency Equivalents" fields to any applicable units and set the Dummy Units name. Here is an example of one of mine from the demo map I made:
    • 1690608681466.png
  3. For the Unit that will have techtree requirements (all of equal quantities!) be sure to set the requirements in the right order, with the dummy listed once at the top, and the rest of the required units beneath it, like this:
    • 1690609339749.png
To hack the tech-requirement tooltip when just one type of unit is required:
  1. To achieve a tooltip like this:
    • 1690609594396.png
  2. In the Object Editor, make a Dummy Unit and Set the "Techtree - Dependency Equivalents" fields to the real unit that the dummy is meant to represent and set the Dummy Units name with the Quantity included in the name. Here is an example of one of mine from the demo map I made notice my dummy farm is called "Twenty-One Farms", because you have to have 21 farms to train a peasant in this demo:
    • 1690610060417.png
  3. For the Unit that will have a techtree requirement of a given quantity of a unit-type, set it's "Techtree - Requirements" and "Techtree - Requirements - Levels" fields as desired. Example:
    • 1690610328843.png
If you prefer the look of the second second example, but have want to require multiple unit-types, you can do that instead (but you still have to require the same number of each type of unit). Example:
  1. To achieve a tooltip like this:
    • 1690610887024.png
  2. Do this for each required unit in the Object Editor (see above examples for more detailed explanation).
    • 1690610060417.png
  3. For the Unit that will have a techtree requirement of a given quantity that will be required for all listed unit-types, set it's "Techtree - Requirements" and "Techtree - Requirements - Levels" fields as desired. Example:
    • 1690611002013.png
 

Attachments

  • Techtree - Requirements Test.w3m
    12.5 KB · Views: 0
Last edited:
Level 12
Joined
Jan 10, 2023
Messages
191
Something that comes to mind is like the old custom games from SC1 where you could "combine" units by putting them on a beacon. So put 5 footmen in a region then it creates a captain.
That sounds like it could be useful/ a worthwhile system, I wonder if there is already such a system. I think I remember seeing "unit fusion" on IcemanBo's list of systems that have been broken by newer versions of WC3.

(edit: I found this)

Either way, if you do want something like this, there are a few ways I could see it being done, maybe the easiest would be with a dummy ability that the beacon could have, or maybe you'd rather it just automatically merge them when enough units enter a given range.

BUT I think the most appropriate thing to do would be to start a new thread that details how you would want that system to be made.

I just don't want to blow this thread up into off-topic territory.
 
Top