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

Something regading upgrades

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2006
Messages
179
In one of the maps, I saw a research that allows a unit to be trained with less food, thans to a research. (ex: Frost Wyrm - 7 food; research complete => Frost Wyrm - 5 food)
Can anyone help me with this?
 
Level 11
Joined
Nov 23, 2013
Messages
665
You may use triggers to do this. You will need an exact copy of your unit (say, a Frost Wyrm), which uses a different amount of food, and you will also need an upgrade which does nothing (let's call it "Food Upgrade").
Then use triggers to replace Frost Wyrm [7 food] with Frost Wyrms [5 food]. This must apply for units already present in the map and units that have not been trained yet.
Something in that area:
  • Food upgrade trigger
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Food Upgrade
    • Actions
      • Joueur - Make Frost Wyrm [5 food] Available for training/construction by (Owner of (Researching unit))
      • Joueur - Make Frost Wyrm [7 food] Unavailable for training/construction by (Owner of (Researching unit))
      • Set GroupVar = Pick every unit in (Units of type Frost Wyrm)
      • Unit Group - GroupVar and do and do (Unit - Replace (Picked unit) with a Frost Wyrm des glaces using Difference with the old unit relative life and mana)
      • Custom script: call DestroyGroup(udg_GroupVar)
I didn't test it out, but I suppose it should do the trick.
 
Level 6
Joined
Sep 19, 2006
Messages
179
I'll try.
However: GroupVar = Pick every unit in (Units of type Frost Wyrm)
I don't know how to set GroupVar as.
 
Last edited:
Level 13
Joined
Nov 4, 2006
Messages
1,239
you need to create a Unitgroup variable first. To edit/create variables click on the yellow "X" in the trigger editor

then use the set variable action, which is within the first 10 actions in the list. you can also access the variable menu from there.

i suggest you look up a tutorial on variables as well
 
Level 6
Joined
Sep 19, 2006
Messages
179
I actually tried that, too, but the only option useful was "Units of type Frost Wyrm" and that's it, without "Pick every unit in". Also, is there a version difference? Because in my version there's no Unit Group that accepts a variable for the GroupVar variable.
@Love Seeker: I'll try that, too.
 
Level 6
Joined
Sep 19, 2006
Messages
179
I did try your version, Love Seeker and when I select the Boneyard, instead of 1 Frost Wyrm as it should be, there are 2. Talk about confusing.
 
Status
Not open for further replies.
Top