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

Unit Experience

Status
Not open for further replies.
Level 4
Joined
Jan 6, 2009
Messages
100
Basically, a unit that 'levels' like a hero.
But not a hero.

So, it would kill something, and gain xp, and improve it's stats (in some way) but it wouldn't be a hero.

[I hope that makes the slightest bit of sense.]

So, question: how can I do it? (Werewolf: Transylvania has units that act exactly the way I want them to, so I know it's possible.)
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
One way you can do this is by using an ability. Whenever the unit kills something successfully, increase the ability and give it stats accordingly.

If you want to be more in control of how much experience you want the unit to gain (Like unit gains 20 exp from unit A but 40 exp from killing unit B), you'll probably need to make some kind of system that would involve hashtables if you want it to be MUI.
 
Use dummy upgrades to increase health, mana, damage, armor and movement speed(similar to Strength/Health/Agility). Use some Integer variables for leveling up like this:
Event:
Complete quest, kill creep etc.
Conditions:
Type what you want
Actions:
Set UnitExpInteger = UnitExpInteger + <however much exp>
If - UnitExpInteger Greater Or Equal To UnitExpLevelup
Then -
Set UnitExpLevel = UnitExpLevel + 1
Set Level of <dummy upgrade that increases stats> to UnitExpLevel
Else -

Basically, when the UnitExpInteger(representing fake exp) reaches/surpasses its limit(which is represented by UnitExpLevelup), the unit 'levels up', increasing its stats with your dummy upgrade.
 
You could make it in many ways.

1. Well, you could just add spellbooks (with the effects inside) and a dummy passive ability to show the effects.

2. You could use items to show the level and still spellbooks for effects, but it I wouldn't recommend it on melee/altered melee maps.

/@ Bond009 : CHF?

I'll look on this thread, because I'm in need of it too.
 
Level 4
Joined
Jan 6, 2009
Messages
100
Thanks to watermelon_1234, GhostThruster and supertoinkz for your ideas. I'll try out all of those.

@[K40$]-Spectre: I would very much like to see your system. Could you provide a link?
 
Level 17
Joined
Aug 19, 2007
Messages
1,380
@[K40$]-Spectre: I would very much like to see your system. Could you provide a link?
, here's the trigger (it's only 1):

  • Veterancy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is A structure) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Killing unit)) Greater than or equal to 7
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Killing unit)) Greater than or equal to 15
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Killing unit)) Greater than or equal to 30
                • Then - Actions
                  • Unit - Set level of Veterancy for (Killing unit) to 3
                • Else - Actions
                  • Unit - Set level of Veterancy for (Killing unit) to 2
                  • Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
            • Else - Actions
              • Unit - Add Veterancy to (Killing unit)
              • Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
        • Else - Actions
          • Unit - Set the custom value of (Killing unit) to ((Custom value of (Killing unit)) + 1)
I've it in my Augmentation Warfare map, tested it and works perfectly so far. As you might have noticed, I use the 'custom value' as the killing counter. Veterancy is an ability in my map, you can replace the 'Add Veterancy' and 'Set level of Veterancy' with other triggers (e.g. add ability 'Devotion Aura' or 'Shockwave').
 
Level 8
Joined
Jun 26, 2010
Messages
530
Yeah, indeed simple. The problem here is if you want a unit-type to have that system. Like every footman. Then you should use hashtables and a more complex system. Specially if you got like thousand footmen in you map.
 
Level 8
Joined
Jun 26, 2010
Messages
530
[K40$]-Spectre;1653939 said:
, or you could just add a condition which checks the unit-type of the unit (or does it lag atm? / or not run smoothly?).

LOL nevermind everything i said. I forgot that custom value is per unit, not per unit-type. Your trigger should do just fine :)
 
Level 8
Joined
Jun 26, 2010
Messages
530
Actually, custom value is the value of the unit in the score screen. It is used for calculating the Player's Unit Scores. There's a way of changing that value for single units or unit-types. But in custom games no one looks at the scores, so custom values got another uses :)
 
Level 4
Joined
Jan 6, 2009
Messages
100
For some reason, it's not working :/

Could you guys look at it and see if anything's wrong? (Ignore the paladin.)
 

Attachments

  • Hero Testing Site.w3x
    17 KB · Views: 88
Level 8
Joined
Jun 26, 2010
Messages
530
*Taking a look*

Edit: too simple, man =)
Your action that sets the custom value of the unit when it's under 5 is in the first if-then-else when it should be in the second ;p
The first one is the one of the structure, so everytime you kill a unit it will return true and the custom value will not increase. Just put it on the second and it will work. I tested :)
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Actually, custom value is the value of the unit in the score screen. It is used for calculating the Player's Unit Scores. There's a way of changing that value for single units or unit-types. But in custom games no one looks at the scores, so custom values got another uses :)
The idea of custom value for scoring is wrong. By default, units have a custom value of 0 which means that the player's unit score would be always 0 unless the map maker had changed the custom value through triggers. The trigger editor also gives a description that "Custom values are only used in triggers, and can be used to store any integer value" which means that custom value itself doesn't really have an actual in-game effect.

Custom values are basically integers that can be attached and retrieved from a unit. There's only one custom value for each unit so usually custom value is used in unit indexing like AutoIndex.
 
Level 17
Joined
Aug 19, 2007
Messages
1,380
The idea of custom value for scoring is wrong. By default, units have a custom value of 0 which means that the player's unit score would be always 0 unless the map maker had changed the custom value through triggers. The trigger editor also gives a description that "Custom values are only used in triggers, and can be used to store any integer value" which means that custom value itself doesn't really have an actual in-game effect.

Custom values are basically integers that can be attached and retrieved from a unit. There's only one custom value for each unit so usually custom value is used in unit indexing like AutoIndex.
, actually that makes even more sese ^^. And yes, now that you mention it, the trigger editor indeed gives that description.
 
Level 8
Joined
Jun 26, 2010
Messages
530
The idea of custom value for scoring is wrong. By default, units have a custom value of 0 which means that the player's unit score would be always 0 unless the map maker had changed the custom value through triggers. The trigger editor also gives a description that "Custom values are only used in triggers, and can be used to store any integer value" which means that custom value itself doesn't really have an actual in-game effect.

Custom values are basically integers that can be attached and retrieved from a unit. There's only one custom value for each unit so usually custom value is used in unit indexing like AutoIndex.

Well, i read somewhere that in melee maps custom values are used for score purposes. Well, guess i can not trust everything i read on forums lol.
My bad, sry for the mistake :(
 
Last edited:
Level 4
Joined
Jan 6, 2009
Messages
100
too simple, man =)
Your action that sets the custom value of the unit when it's under 5 is in the first if-then-else when it should be in the second ;p
The first one is the one of the structure, so everytime you kill a unit it will return true and the custom value will not increase. Just put it on the second and it will work. I tested :)

Gah! How could I get that wrong >.<

Thanks a lot, SoulBurn. I might never have figured that out.
 
Status
Not open for further replies.
Top