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

Transformed heroes dont have damage

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
Whenever my heroes transform they lose all the damage my trigger gives them and dont get any back all the numbers remain the same except the ability levels become and stay 0 can someone tell me why this happens and yes the transformed units still have the abilities. All the attack damage abilities are hidden within a spellbook.
  • Set Hero Stats
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in (Entire map) matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Not equal to Spawn_Owner)))) and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set Temp_Player = (Owner of TempUnit)
          • Set Temp_Int = (Player number of Temp_Player)
          • Set Crit_Chance[Temp_Int] = 5
          • Set Magic_Damage[Temp_Int] = 0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Detect Primary (STR) for TempUnit) Equal to 1
            • Then - Actions
              • Set Attack_Damage[Temp_Int] = (6 + (Strength of Hero[Temp_Int] (Include bonuses)))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Detect Primary (INT) for TempUnit) Equal to 1
                • Then - Actions
                  • Set Attack_Damage[Temp_Int] = (5 + (Intelligence of Hero[Temp_Int] (Include bonuses)))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Detect Primary (AGI) for TempUnit) Equal to 1
                    • Then - Actions
                      • Set Attack_Damage[Temp_Int] = (4 + (Agility of Hero[Temp_Int] (Include bonuses)))
                    • Else - Actions
          • For each (Integer Temp_Int3) from 1 to 6, do (Actions)
            • Loop - Actions
              • Set Temp_Item = (Item-type of (Item carried by TempUnit in slot Temp_Int3))
              • Custom script: set udg_Item_Number=udg_Temp_Item
              • Set Attack_Damage[Temp_Int] = (Attack_Damage[Temp_Int] + (Load 0 of Item_Number from Item_Stat_Table))
              • Set Crit_Chance[Temp_Int] = (Crit_Chance[Temp_Int] + (Load 1 of Item_Number from Item_Stat_Table))
              • Set Magic_Damage[Temp_Int] = (Magic_Damage[Temp_Int] + (Load 2 of Item_Number from Item_Stat_Table))
          • Set Temp_Int2 = Attack_Damage[Temp_Int]
          • Unit - Set level of Attack Damage 0-9 for TempUnit to 1
          • Unit - Set level of Attack Damage 10-90 for TempUnit to 1
          • Unit - Set level of Attack Damage 100-900 for TempUnit to 1
          • Unit - Set level of Attack Damage 1000-9000 for TempUnit to 1
          • Custom script: loop
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Int2 Greater than or equal to 1000
            • Then - Actions
              • Unit - Set level of Attack Damage 1000-9000 for TempUnit to ((Level of Attack Damage 1000-9000 for TempUnit) + 1)
              • Set Temp_Int2 = (Temp_Int2 - 1000)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Int2 Greater than or equal to 100
                • Then - Actions
                  • Unit - Set level of Attack Damage 100-900 for TempUnit to ((Level of Attack Damage 100-900 for TempUnit) + 1)
                  • Set Temp_Int2 = (Temp_Int2 - 100)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Temp_Int2 Greater than or equal to 10
                    • Then - Actions
                      • Unit - Set level of Attack Damage 10-90 for TempUnit to ((Level of Attack Damage 10-90 for TempUnit) + 1)
                      • Set Temp_Int2 = (Temp_Int2 - 10)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Temp_Int2 Greater than or equal to 1
                        • Then - Actions
                          • Unit - Set level of Attack Damage 0-9 for TempUnit to ((Level of Attack Damage 0-9 for TempUnit) + 1)
                          • Set Temp_Int2 = (Temp_Int2 - 1)
                        • Else - Actions
          • Custom script: exitwhen(udg_Temp_Int2==0)
          • Custom script: endloop
          • Game - Display to (All players) the text: (String((Level of Attack Damage 0-9 for TempUnit)))
          • Game - Display to (All players) the text: (String((Level of Attack Damage 10-90 for TempUnit)))
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Levels of added-through-trigger abilities are lost during unit transformation.

Use this
  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, <ability raw code>)
to preserve the abilities after they are added for the first time. This way they will not lose their level data when the unit is transformed.
 
Level 5
Joined
Sep 27, 2011
Messages
141
I believe these are the raw codes but i getting an error that says expected a name
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02D:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02E:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02F:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02G:Altg)
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
I believe these are the raw codes but i getting an error that says expected a name
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02D:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02E:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02F:Altg)
  • call UnitMakeAbilityPermanent(udg_TempUnit, true, A02G:Altg)

rawcodes should first of all not contain the colon and everything behind it, it only indicates what the ability was based off (if I am correct). Second, it should be put between '', for instance 'A02D'.

Yixx is indeed correct. Here is how you should do it instead.

  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'A02D')
  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'A02E')
  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'A02F')
  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'A02G')
 
Status
Not open for further replies.
Top