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

Hero change model when reaching level 10

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
74
Greetings,

i am looking for a "simple" trigger.
I want a Hero to turn, for example, from Footman Model to Knight Model when reaching level 10. Keeps all items, stats and abilities.

Thanks for reading.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
If on 1.31+ you can use the Set Unit Skin action. Otherwise, use a permanent Morph ability.

  • Events
  • Unit - A unit gains a level
  • Conditions
  • Level of (Triggering unit) Equal to 10
  • Actions
  • Do stuff

It's much easier to use Custom script when setting Skins:
  • Set Variable SkinUnit = Triggering unit
  • Custom script: call BlzSetUnitSkin( udg_SkinUnit, 'hkni' )
 
Last edited:
Level 4
Joined
Aug 7, 2010
Messages
74
If on 1.31+ you can use the Set Unit Skin action. Otherwise, use a permanent Morph ability.

  • Events
  • Unit - A unit gains a level
  • Conditions
  • Level of (Triggering unit) Equal to 10
  • Actions
  • Do stuff

It's much easier to use Custom script when setting Skins:
  • Set Variable SkinUnit = Triggering unit
  • Custom script: call BlzSetUnitSkin( udg_SkinUnit, 'hkni' )
Thanks a lot, i will try that out. As for the normal "SetSkin" Trigger, i wasn't even able to change "Hamg" anyways.
Custom script it is then. Gonna reply with the outcome
 
Level 4
Joined
Aug 7, 2010
Messages
74
It worked!
Now i could add normal triggers that change the units stats so it fits to the Knight Model and i also need to add the hero glow again. As i applied the HeroGlow mdx to footman but when i changed the model to the Knight now with this trigger, the hero glow disappeared. I tried to add it again with a function right after it but then i get a variable error message when i wanna test the map.
  • llk
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Human Soldier) and ((Level of (Triggering unit)) Equal to 10)
    • Actions
      • Set VariableSet Variable = (Triggering unit)
      • Custom script: call BlzSetUnitSkin( udg_SoldierSkin, 'hkni')
      • Unit - Add Verlangsamungsaura (Tornado) to (Triggering unit)[trigger]
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
You named your Unit variable "Variable". It needs to be named SoldierSkin since that's what you called it in the custom script:
  • Custom script: call BlzSetUnitSkin( udg_SoldierSkin, 'hkni')
You reference a global variable in Custom script like this: udg_ + variable name
udg stands for User Declared Global, which is what informs the Custom script that you want to use a variable that you created in the variable editor.

Notice how in my trigger I named my unit variable SkinUnit and in my custom script I reference udg_SkinUnit.

You may need to Remove the glow ability from the unit and Add it back again for it to update properly.
 
Last edited:
Level 4
Joined
Aug 7, 2010
Messages
74
Sorry, the "Variable" name was just a reset when i clicked on the Variable value. So i had to re-select it to "SoldierSkin" again.
It all worked already but i still don't know how to add the HeroGlow to the changed skin then. It also has no shadow at all. Any idea how to edit the units stats like shadow, attack animation, movement speed etc.?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
The Unit Field actions should offer you some control but a lot of them are buggy/unfinished.
  • Unit - Set Unit: (Triggering unit)'s Real Field: Shadow Image - Height ('ushh') to Value: 300.00

If Skins are giving you issues then I recommend the Morph option. The idea being that you add a modified Bear Form ability to your unit and order it to cast it. The Bear Form ability needs to be setup so it's Permanent, instant, costless, and has no icon/hotkey. The only issue there is if the unit is stunned/silenced when it reaches level 10 then it won't be able to cast the ability.

Maybe you can try messing around with the Chaos ability instead, I'm not sure how that works on heroes though.

Edit: The Chaos ability seems to work great. I would use that.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Human Soldier) and ((Level of (Triggering unit)) Equal to 10)
    • Actions
      • Unit - Add Knight Form to (Triggering unit)
 
Last edited:
Level 4
Joined
Aug 7, 2010
Messages
74
Maybe you can try messing around with the Chaos ability instead, I'm not sure how that works on heroes though.

Edit: The Chaos ability seems to work great. I would use that.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Human Soldier) and ((Level of (Triggering unit)) Equal to 10)
    • Actions
      • Unit - Add Knight Form to (Triggering unit)
[/QUOTE]

Okay thanks a lot!
I tried out a bit with the Chaos ability. Copy pasted the Chaos (Rider) ability and changed the "DATA: unit skin list" to Knight and "new unit type" also to Knight. Nothing happened. When i removed the Techtree requirements: Chaos. And turned check dependencies on false. It changed my hero to just the Knight unit. No Hero or anything.

I have read this Morph/Chaos method past days somewhere but i don't know how to edit the data properly so the model changes correctly, with the Hero Glow i added. + keeping the stats and the items of the hero of course.
 
Level 4
Joined
Aug 7, 2010
Messages
74
I guess the Metamorphosis is the option then since i've read this:

PitzerMike said:
Sca1 (Chaos): Adding a chaos ability to a unit transforms it into the unit type specified in the target unit id field of the ability. This can be used to change any aspect like the proper name or the model of a unit in the game or simply in combination with channel to implement morphing spells. Don't forget to remove the tech requirements from custom chaos abilities. One problem of Chaos is that it adds the morphed unit's current armor, damage, health and mana bonus received from items, auras and strength, agility, intelligence to the stats of the resulting unit. That means it's not a very good idea to morph heroes using chaos until Blizzard fixes those bugs. Ordinary units can't be affected by items and hero stats, so the only problem are buffs received from auras. Those buffs can easily be removed before the conversion and are automatically added again afterwards so that's not a real issue.

Do you know what important Data/Stats changes has to be made on the Custom Morph ability in order to hide it on the unit?
And i will not add any stun instances on the maps so it doesn't get in trouble with the Morph then.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Okay final update. xD
I just trolled hard now, i created another version of my "Soldier Footman" and changed its model to Knight.
Then i edited the custom chaos ability so it changes to that version of Soldier Footman. And it worked of course. Turned into a knight with hero glow, kept the items, stats, all the same.
Now i can modify this copied unit and paste all the Knight unit data over to the copied unit in order to get a believable Knight transition.
Thank you so much for your learning school again today! I learned a lot and will experiment on. Showing you results of what i had intended in the future. = )

Big Love!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
If you want to hide an ability set it's Art - Button Positions to -> x: 0, y: -11

Hold shift when opening a field in the Object Editor to allow negative values/bypass limits.

You may need to enable this feature in the world editor options.
File/Preferences/General -> Allow negative real values...
 
Level 4
Joined
Aug 7, 2010
Messages
74
Nice good to know.
A weird thing is that when the hero turns level 10 and it had an aura that gave him 4 armor, the Knight morph then absorbed those 4 armor into his BASE armor.
Is there a way to cleanse this?
 
Level 4
Joined
Aug 7, 2010
Messages
74
Maybe disable the abilities prior to adding the morph ability then enable them afterwards.
  • Soldier Skin Change Copy
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Human Soldier) and ((Level of (Triggering unit)) Equal to 10)
    • Actions
      • Unit - Remove All buffs from (Triggering unit)
      • Unit - Add Knight Model (Räuber) to (Triggering unit)
      • Wait 0.10 seconds
      • Unit - Set Max HP of (Triggering unit) to 1600
      • Wait 0.10 seconds
      • Unit - Set life of (Triggering unit) to 100.00%
I just tried something simple at it worked actually. Remove all buffs first action, then change the model. And after it, i added the wait actions because otherwise the life wouldn't have been added. Tried it before.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Sadly this doesn't seem to work with already existing armor effects as Item Armor or the Anub Arak ability: "tank spikes" that gives armor and returns damage.
The Aura from Paladin easily gets temporarily removed with the "Remove Buffs" trigger but the permanent hard stick armor still keeps to be absorbed from the "Green, bonus armor" into the "gray, base armor" of the unit.
Any idea how to fix it?
Lets say Hero is lvl 9 and has 6 armor + 10 armor from lvl 3 Tankspikes. Then when reaching level 10 he has 15 armor plus the +10 from spikes again. Cant fix it. Normally he should have about 7 armor then and just the +10 green armor from spikes again.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Disabling the ability didn't work? I would do that as well as removing specific buffs.
Already tried all that out. Adding ability, hiding, removing, adding again, learning skill action, removing specific buff,
Nothing worked.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Disabling the ability didn't work? I would do that as well as removing specific buffs.

If all else fails I would use the Bear Form method I described before.
But i dont know if the stats bugg as well. or if the model knight isnt able to be modified properly in object editor.
Can you show me an example of how that morph ability would have to look like? and how it is done? creat custom transform into bearform ability and there change all what you said and the model i want it to change? Or does it change to a unit? Since i want everything fitting. Walk animation etc. Shadow
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
It's the same concept as Metamorphosis, Demon Hunter turns into Demon Hunter (Special). But instead of being temporary you set it to permanent. There's other fields that will make it work properly like Immediate Take Off/Landing. Casting time/Duration may play a role as well so I would set those to 0. Basically you want the ability to be instant and permanent then in your trigger you add the ability and order the hero to cast it:
  • Actions
  • Unit - Add Morph ability to Triggering unit
  • Unit - Order Triggering unit to Night Elf - Metamorphosis
Obviously order it to use whichever ability you choose. I'm pretty sure all of the Morph abilities use the same core concept but some have extra features.
 
Last edited:
Level 4
Joined
Aug 7, 2010
Messages
74
It's the same concept as Metamorphosis, Demon Hunter turns into Demon Hunter (Special). But instead of being temporary you set it to permanent. There's other fields that will make it work properly like Immediate Take Off/Landing. Casting time/Duration may play a role as well so I would set those to 0. Basically you want the ability to be instant and permanent then in your trigger you add the ability and order the hero to cast it:
  • Actions
  • Unit - Add Morph ability to Triggering unit
  • Unit - Order Triggering unit to Night Elf - Metamorphosis
Obviously order it to use whichever ability you choose. I'm pretty sure all of the Morph abilities use the same core concept but some have extra features.
Okay thanks a lot. I will try that out tomorrow at breakfast.
Now is i am tired and get some sleep.
Okay i hope that there wont be any "blue bar" on how long the metamorphosis will last, where normally the expirience bar is. When toggling it on "permanent". Excited to try that method out tomorrow.
That Chaos form method is messing to much around with absorbing item- and permanent buffs into base stats when changing the model/unit with it.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,541
Bear Form / Storm Crow Form don't have a blue bar because they're permanent, that bar is only there if the ability has a duration + isn't permanent. Remember that these are all the same ability just with different names and different options enabled (although some may have extra features). The point is that they're all basically the same so just pick the one you like.
 
Last edited:
Level 4
Joined
Aug 7, 2010
Messages
74
Bear Form / Storm Crow Form don't have a blue bar because they're permanent (but allow you to toggle between these "permanent" forms). Again, these are all the same ability with different names it's just that some have extra features and different options enabled. They're all coded exactly the same, just pick one you like :p
Okay i try it out now with the bear form. Lets see if im getting a smooth transition working. Gonna ask my Uncle again if i get stuck : )
 
Level 4
Joined
Aug 7, 2010
Messages
74
  • Unit - Order (Triggering unit) to Night Elf Druid Of The Claw - Bear Form.
It's an Order with No Target.
Thanks i found this already but i can't understand how i edit the ability so it find the String ID and actually uses it.
I have 9 heros. Each hero shall get a different skin at level 10 so i dont know how to specify the abilities to each hero
 
Level 4
Joined
Aug 7, 2010
Messages
74
  • Soldier Skin Change Copy
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Unit-type of (Triggering unit)) Equal to Human Soldier) and ((Level of (Triggering unit)) Equal to 10)
    • Actions
      • Unit - Add Ritter Morph to (Triggering unit)
      • Wait 0.02 seconds
      • Unit - Order (Triggering unit) to Night Elf Druid Of The Claw - Bear Form.
      • Unit - Set Max HP of (Triggering unit) to 1600
      • Unit - Set life of (Triggering unit) to 100.00%
What i did was copy pasting the.
Bearform ability.
Called it Ritter Morph and did duration, casting time everything 0. No tech requirements. Changed the Art Unit and Skin to the Knight Model i want to change it to and it doesn't work
 
Level 4
Joined
Aug 7, 2010
Messages
74
It worked now. I was checking the "Morphing Flags" Where it said, "uninteruptable" there was also the option, "permanent" so i clicked it as you said and now it worked.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Shouldn't need the Wait. Glad it works though. There is that one issue I mentioned before where the unit levels up in a state in which it can't cast the ability (stunned/silenced) but maybe you can find some workaround.
Okay thanks, i put the 0.02 wait away. Was still there from last attempts. Works really well now, i try to apply it to 2-3 heros and see how it goes.
This could be a big issue yes but i am still figuring out what experience system i am doing. I wont add any stun or silence abilities to the attacking enemies then.

Do you have a simple and healthy standard method of a slow hero experience progression when it comes to defending a place for 60 minutes and not wanting the heroes to level up to fast?
Some edits in the gameplay constant tables of the gained hero xp. I just dont know what would be realistic to put there, can also try it out one by one. Since the unit "Monstrosity" give way more xp than a ghul or zombie.
 
Level 4
Joined
Aug 7, 2010
Messages
74
I don't have any method besides trial and error, I'm sure you'll find out what needs to be changed after playtesting it a few times.
Okay yes, i never did a good method of it if i remember. So it is just the expirience table in gameplay constants that has to be edited? Playing around with it?


Here a result of the Hero skin change.
 

Attachments

  • Uncle.png
    Uncle.png
    4.3 MB · Views: 24
Level 19
Joined
Feb 27, 2019
Messages
590
Here are my thoughts on experience gain. I dont really have much actual experience in experience gain though^^

The experience table is based on the level of the unit/hero killed compared to the level of the killing hero.

There is probably a difference in setting the experience tables if the max level is 15 compared to 50.

I think a clear order in which waves of attackers gain strength (levels) would make balancing simpler.

There are cases when waves bring weaker units, in that case I think their level should represent that, for example spiderling spawned from spider. So the units dont just have to gain strength, they can gain in numbers or difficulty aswell, which I think should be reflected.

The experience gain probably doesnt have to be equal during the entire game, per heaps it is more fun if there is a spike in experience gain somewhere in the middle of the game, its all up to play around with.
 
Level 4
Joined
Aug 7, 2010
Messages
74
Here are my thoughts on experience gain. I dont really have much actual experience in experience gain though^^

The experience table is based on the level of the unit/hero killed compared to the level of the killing hero.

There is probably a difference in setting the experience tables if the max level is 15 compared to 50.

I think a clear order in which waves of attackers gain strength (levels) would make balancing simpler.

There are cases when waves bring weaker units, in that case I think their level should represent that, for example spiderling spawned from spider. So the units dont just have to gain strength, they can gain in numbers or difficulty aswell, which I think should be reflected.

The experience gain probably doesnt have to be equal during the entire game, per heaps it is more fun if there is a spike in experience gain somewhere in the middle of the game, its all up to play around with.
Thanks for the reply.
Its late and i just tried something. I put the XP required factor from 100 to 300 and now it takes way longer to reach each level. I plan doing small units attack first, and then more bigger come and small too. So i plan to not touch the XP Gained instance. Maybe it can work with just touching the Xp Required instance. I will test around with some units tomorrow. Maybe i do factor 500. Because factor is good enough since it just makes the next level way longer to reach than the previous one.
 
Status
Not open for further replies.
Top