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

[Trigger] Researching Upgrades

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
How can I change my golm when I researching to upgrade it?
Example: When I researching 5 level of (damage-defence-attack speed) then the golem should change.
  • Golem Change
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to (==) Golem Damage
          • (Researched tech-type) Equal to (==) Golem Defence
          • (Researched tech-type) Equal to (==) Golem Attack Speed
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemDamageTech[Integer_Golem] = (100.00 - ((Real((Current research level of Golem Damage for (Owner of Unit_Golem2[Integer_Golem])))) x 5.00))
          • Unit - Replace (Researching unit) with a Battle Golem using The old unit's relative life and mana
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to (==) Golem Damage
          • (Researched tech-type) Equal to (==) Golem Defence
          • (Researched tech-type) Equal to (==) Golem Attack Speed
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemHPTech[Integer_Golem] = (100.00 - ((Real((Current research level of Golem Defence for (Owner of Unit_Golem2[Integer_Golem])))) x 10.00))
          • Unit - Replace (Researching unit) with a Siege Golem using The old unit's relative life and mana
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to (==) Golem Damage
          • (Researched tech-type) Equal to (==) Golem Defence
          • (Researched tech-type) Equal to (==) Golem Attack Speed
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemAttSpeedTech[Integer_Golem] = (100.00 - ((Real((Current research level of Golem Attack Speed for (Owner of Unit_Golem2[Integer_Golem])))) x 15.00))
          • Unit - Replace (Researching unit) with a Infernal using The old unit's relative life and mana
        • Else - Actions
 
Last edited:
Level 5
Joined
Jun 13, 2017
Messages
83
you could make integer variable that increase by 1 every time the unit finish a research.

set integer = integer +1

In the same trigger at the end add
if/then/else
if
integer = 4
then
you have 2 options here :
1- remove the unit and create new upgraded one at the same place.
2- make bear form ability to change from normal to upgraded then just add the ability to the golem then remove it immediately. it should change the the golem to the upgraded one.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
It's been a while since I last opened up the WE, but to follow up to Shunpomaster's comment I believe the ability you want to add to units to trigger the replacement is Chaos. As a result, you might want to do something like this:

  • Your golem has a Chaos-based ability which upgrades it to the next type of golem when an upgrade called "Golem Tier 2" (or whatever) is researched.
  • Every time the player researches one of the upgrades in your list, an integer associated with that player increases by 1. When it hits 5, "Golem Tier 2" (or whatever it's called) is automatically researched for them.

This is modelled after the way that Troll Headhunters become Troll Berserkers, but instead of directly exposing the upgrade which changes their form to players it's hidden behind a trigger which counts to 5 total upgrades researched.
 
Level 10
Joined
Jun 20, 2017
Messages
333
So I choose option 1 without using the ability, but it still does not change!
way1
  • Golem Change
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • Set Point_Golem = (Position of (Triggering unit))
      • Set Integer_GolemTech = (Integer_GolemTech + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to Golem Attack Speed
          • (Researched tech-type) Equal to Golem Damage
          • (Researched tech-type) Equal to Golem Defence
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemDamageTech[Integer_Golem] = (100.00 - ((Real((Current research level of Golem Movement Speed for (Owner of UnitS_Golem[Integer_Golem])))) x 5.00))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Researching unit)) Equal to Rock Golem
              • Integer_GolemTech Equal to 5
            • Then - Actions
              • Unit - Remove (Researching unit) from the game
              • Unit - Create 1 Flesh Golem for (Triggering player) at Point_Golem facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to Golem Attack Speed
          • (Researched tech-type) Equal to Golem Damage
          • (Researched tech-type) Equal to Golem Defence
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemHPTech[Integer_Golem] = (100.00 - ((Real((Current research level of Tower Attack Speed for (Owner of UnitS_Golem[Integer_Golem])))) x 10.00))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Researching unit)) Equal to Flesh Golem
              • Integer_GolemTech Equal to 10
            • Then - Actions
              • Unit - Remove (Researching unit) from the game
              • Unit - Create 1 War Golem for (Triggering player) at Point_Golem facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Researched tech-type) Equal to Golem Attack Speed
          • (Researched tech-type) Equal to Golem Damage
          • (Researched tech-type) Equal to Golem Defence
        • Then - Actions
          • Set Integer_Golem = (Player number of (Owner of (Researching unit)))
          • Set Real_GolemAttSpeedTech[Integer_Golem] = (100.00 - ((Real((Current research level of Tower Damage for (Owner of UnitS_Golem[Integer_Golem])))) x 15.00))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Researching unit)) Equal to War Golem
              • Integer_GolemTech Equal to 15
            • Then - Actions
              • Unit - Remove (Researching unit) from the game
              • Unit - Create 1 Infernal for (Triggering player) at Point_Golem facing Default building facing degrees
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point_Golem)
way2
  • Golem Change Copy
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Researching unit)) Equal to Rock Golem
          • (Unit-type of (Researching unit)) Equal to Flesh Golem
          • (Unit-type of (Researching unit)) Equal to War Golem
    • Actions
      • Set Point_Golem = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 5
          • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 5
          • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 5
        • Then - Actions
          • Unit - Remove (Researching unit) from the game
          • Unit - Create 1 Flesh Golem for (Triggering player) at Point_Golem facing Default building facing degrees
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 10
              • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 10
              • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 10
            • Then - Actions
              • Unit - Remove (Researching unit) from the game
              • Unit - Create 1 War Golem for (Triggering player) at Point_Golem facing Default building facing degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 15
                  • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 15
                  • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 15
                • Then - Actions
                  • Unit - Remove (Researching unit) from the game
                  • Unit - Create 1 Infernal for (Triggering player) at Point_Golem facing Default building facing degrees
                • Else - Actions
      • Custom script: call RemoveLocation(udg_Point_Golem)
 
Level 5
Joined
Jun 13, 2017
Messages
83
way1
  • Damage Blood Brothers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Faerie Fire
    • Actions
      • Set BB_Caster = (Triggering unit)
      • Set BB_Target = (Target unit of ability being cast)
      • Wait 5.00 seconds
      • Unit - Remove Doom buff from BB_Target
      • Unit - Cause BB_Caster to damage BB_Target, dealing TotalDamage damage of attack type Spells and damage type Magic
      • Set BB_Heal = ((Life of BB_Caster) + (TotalDamage x 0.30))
      • Unit - Set life of BB_Caster to BB_Heal
      • Set TotalDamage = 0.00

The condition in If/Then/Else, probably the reason why it is not working because the unit is researching one of them, the other 2 are not getting researched for the event. Add Or, for it to work.



Condition could be why it is not working too.
Check if Ability level 5+ instead of research level. you could add dummy item Ability with each research like boots or gloves of haste, I don't think they have icons so you can remove all the stats on them and check if the level of ability(item ability) 5+ then do action.
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Got it work without ability, item, dummy.
But the question is it will laggy? because I didn't remove the previous golem.
  • Golem Change
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 5
              • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 5
              • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 5
        • Then - Actions
          • Set Rect_Golem = (Playable map area)
          • Set UnitGroup = (Units in Rect_Golem matching ((Unit-type of (Matching unit)) Equal to Rock Golem))
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Flesh Golem using The old unit's relative life and mana
          • Custom script: call DestroyGroup(udg_UnitGroup)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 10
              • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 10
              • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 10
        • Then - Actions
          • Set Rect_Golem = (Playable map area)
          • Set UnitGroup = (Units in Rect_Golem matching ((Unit-type of (Matching unit)) Equal to Flesh Golem))
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a War Golem using The old unit's relative life and mana
          • Custom script: call DestroyGroup(udg_UnitGroup)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Current research level of Golem Attack Speed for (Owner of (Researching unit))) Greater than or equal to 15
              • (Current research level of Golem Damage for (Owner of (Researching unit))) Greater than or equal to 15
              • (Current research level of Golem Defence for (Owner of (Researching unit))) Greater than or equal to 15
        • Then - Actions
          • Set Rect_Golem = (Playable map area)
          • Set UnitGroup = (Units in Rect_Golem matching ((Unit-type of (Matching unit)) Equal to War Golem))
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Infernal using The old unit's relative life and mana
          • Custom script: call DestroyGroup(udg_UnitGroup)
        • Else - Actions
 
Last edited:
Level 5
Joined
Jun 13, 2017
Messages
83
Not sure about if you need to remove them or not, but you could make custom ability (Bear Form) probably in night elf section in abilities, then change the ability to change your unit from golem to upgraded golem, then add the ability to your unit and remove it immediately, it will switch your unit to the other unit.
 
Status
Not open for further replies.
Top