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

Veteran System

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Veteran System
Every three kills a unit obtains gains it one level, in addition it gains +1 damage per level and +1 armor every two levels. Every five levels there is a visual difference above the units head allowing all players to know that it is a more advanced unit. In total there are 15 levels.

I realize there are many other ranking systems out there and honestly i don't care. They say they are simple systems when the end up having three pages of code and here is one that I give to you with maybe one page. The system is completely MUI and GUI with no lag and no known bugs, if you do happen across one please message me about the issue.
Triggers
  • V Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- Set this to how many kills you want before a bonus is given! --------
      • Set V_KillLimit = 3
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- Add units below that you don't want to have a ranking! --------
      • Set V_BlockedUnit[1] = Knight
      • Set V_BlockedUnit[2] = Mortar Team
      • -------- Set this number to the total amount of units you are blocking! --------
      • Set V_AmountBlockedUnits = 2
      • -------- --------------------------------------------------------------------------------------------- --------
      • Set V_Abilities[1] = Bear Form
      • Set V_Abilities[2] = Berserker Upgrade
      • Set V_Abilities[3] = Burrow (Crypt Fiend)
      • Set V_Abilities[4] = Corporeal Form
      • Set V_Abilities[5] = Crow Form
      • Set V_Abilities[6] = Destroyer Form
      • Set V_Abilities[7] = Metamorphosis
      • Set V_Abilities[8] = Phoenix Morphing (Egg Related)
      • Set V_Abilities[9] = Stone Form
      • Set V_Abilities[10] = Storm Crow Form
      • Set V_Abilities[11] = Submerge (Myrmidon)
      • Set V_Abilities[12] = Submerge (Royal Guard)
      • Set V_Abilities[13] = Submerge (Snap Dragon)
      • Set V_AbilitiesAmount = 13
      • Hashtable - Create a hashtable
      • Set V_Hashtable = (Last created hashtable)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A structure) Not equal to True)) and do (Actions)
        • Loop - Actions
          • Set V_Unit = (Picked unit)
          • For each (Integer A) from 1 to V_AmountBlockedUnits, do (Actions)
            • Loop - Actions
              • If ((Unit-type of V_Unit) Equal to V_BlockedUnit[(Integer A)]) then do (Skip remaining actions) else do (Do nothing)
          • Set V_HashUnit = (Key (Picked unit))
          • Hashtable - Save 0 as 0 of V_HashUnit in V_Hashtable
          • Unit - Add Rank (Dummy) to V_Unit
          • Unit - Add V_Damage Bonus to V_Unit
          • Unit - Add V_Armor Bonus to V_Unit
  • V Created Units
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set V_HashUnit = (Key (Triggering unit))
      • Set V_Unit = (Triggering unit)
      • For each (Integer A) from 1 to V_AmountBlockedUnits, do (Actions)
        • Loop - Actions
          • If (((Unit-type of V_Unit) Equal to V_BlockedUnit[(Integer A)]) or ((V_Unit is A structure) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Hashtable - Save 0 as 0 of V_HashUnit in V_Hashtable
      • Unit - Add Rank (Dummy) to V_Unit
      • Unit - Add V_Damage Bonus to V_Unit
      • Unit - Add V_Armor Bonus to V_Unit
  • V Start Ability
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
        • Loop - Actions
          • If ((Ability being cast) Equal to V_Abilities[(Integer A)]) then do (Do nothing) else do (Skip remaining actions)
          • Set V_AbilityUnit = (Triggering unit)
          • Set V_RankLevel = (Level of Rank (Dummy) for V_AbilityUnit)
  • V End Ability
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • For each (Integer A) from 1 to V_AbilitiesAmount, do (Actions)
        • Loop - Actions
          • If ((Ability being cast) Equal to V_Abilities[(Integer A)]) then do (Do nothing) else do (Skip remaining actions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Rank (Dummy) for V_AbilityUnit) Less than 1
            • Then - Actions
              • Unit - Add Rank (Dummy) to V_AbilityUnit
              • Unit - Set level of Rank (Dummy) for V_AbilityUnit to V_RankLevel
              • Unit - Add V_Damage Bonus to V_AbilityUnit
              • Unit - Set level of V_Armor Bonus for V_AbilityUnit to V_RankLevel
              • Unit - Add V_Armor Bonus to V_AbilityUnit
              • Unit - Set level of V_Damage Bonus for V_AbilityUnit to V_RankLevel
              • If (V_RankLevel Greater than or equal to 5) then do (Unit - Add V_Level 5 to V_AbilityUnit) else do (Do nothing)
              • If (V_RankLevel Greater than or equal to 10) then do (Unit - Add V_Level 10 to V_AbilityUnit) else do (Do nothing)
              • If (V_RankLevel Equal to 15) then do (Unit - Add V_Level 15 to V_AbilityUnit) else do (Do nothing)
            • Else - Actions
  • V Record
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set V_Unit = (Triggering unit)
      • Unit - Remove V_Level 5 from V_Unit
      • Unit - Remove V_Level 10 from V_Unit
      • Unit - Remove V_Level 15 from V_Unit
      • Set V_Killer = (Killing unit)
      • Set V_HashUnit = (Key (Killing unit))
      • Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • V_RankKills Equal to V_KillLimit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Level of Rank (Dummy) for V_Killer) Greater than 0) and ((Level of Rank (Dummy) for V_Killer) Less than 15)
            • Then - Actions
              • Unit - Increase level of Rank (Dummy) for V_Killer
              • Unit - Increase level of V_Armor Bonus for V_Killer
              • Unit - Increase level of V_Damage Bonus for V_Killer
              • Special Effect - Create a special effect attached to the origin of V_Killer using Abilities\Spells\Items\AIre\AIreTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • If ((Level of Rank (Dummy) for V_Killer) Equal to 5) then do (Unit - Add V_Level 5 to V_Killer) else do (Do nothing)
              • If ((Level of Rank (Dummy) for V_Killer) Equal to 10) then do (Unit - Add V_Level 10 to V_Killer) else do (Do nothing)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Rank (Dummy) for V_Killer) Equal to 15
                • Then - Actions
                  • Unit - Remove V_Level 10 from V_Killer
                  • Unit - Add V_Level 15 to V_Killer
                • Else - Actions
              • Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) - V_KillLimit)
            • Else - Actions
        • Else - Actions
      • Hashtable - Save V_RankKills as 0 of V_HashUnit in V_Hashtable
Credits
zombie, for his Medal of Honor icon which is not necessary for this system, just an addition/suggestion.
Change Log
- Used variables to store triggering unit, dying unit, killing unit, picked unit, etc.

- Changed how the Setup trigger starts to map initialization, elapsed game time was causing start up lag
- Fixed bugs that removed the ability from the unit, pointed out by Wolf_Wing
- Made it easier to customize some functions

- Fixed a group leak
- Now filters out buildings

Please be sure to rate and give feedback/suggestions in the comments!

Keywords:
veteran, rank, system
Contents

Veteran System (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 21:44, 7th Aug 2013 PurgeandFire: Set to "Needs Fix". A few changes suggested here: http://www.hiveworkshop.com/forums/2385686-post23.html

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

21:44, 7th Aug 2013
PurgeandFire: Set to "Needs Fix". A few changes suggested here:
http://www.hiveworkshop.com/forums/2385686-post23.html
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
u do know that skip remaining actions will end the trigger right ?
also dont use integer A/B its less efficient and slower than ur own variable.

this trigger does nothing. V Start Ability

change the second killing unit to the variable u set above it in this.
  • Set V_Killer = (Killing unit)
  • Set V_HashUnit = (Key (Killing unit))
reverse these and use the variable that is set for triggering unit
  • Set V_HashUnit = (Key (Triggering unit))
  • Set V_Unit = (Triggering unit)
 
Level 8
Joined
Apr 23, 2010
Messages
312
deathismyfriend said:
also dont use integer A/B its less efficient and slower than ur own variable.
So what do you mean when I should use my own variable? I already have one indexing the spells.

deathismyfriend said:
change the second killing unit to the variable u set above it in this.
  • Set V_Killer = (Killing unit)
    • Set V_HashUnit = (Key (Killing unit))
reverse these and use the variable that is set for triggering unit
  • Set V_HashUnit = (Key (Triggering unit))
    • Set V_Unit = (Triggering unit)

I can't select those variables for the 'V_HashUnit' key.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
So what do you mean when I should use my own variable? I already have one indexing the spells.

make another tempInteger to replace integer A. integer A/B is slower and less efficient.

I can't select those variables for the 'V_HashUnit' key.
as for these change them from this
  • Set V_Killer = (Killing unit)
  • Set V_HashUnit = (Key V_Killer)
reverse these and use the variable that is set for triggering unit
  • Set V_Unit = (Triggering unit)
  • Set V_HashUnit = (Key V_Unit)
 
Level 8
Joined
Apr 23, 2010
Messages
312
deathismyfriend said:
as for these change them from this
  • Set V_Killer = (Killing unit)
    • Set V_HashUnit = (Key V_Killer)
reverse these and use the variable that is set for triggering unit
  • Set V_Unit = (Triggering unit)
    • Set V_HashUnit = (Key V_Unit)

I get what you're saying but the fact is when I try to set 'V_Unit' as the handle, there is no variable to pick from at all. Look at the picture below to see.

I'm using Almia's way for now.
 

Attachments

  • NoVar.jpg
    NoVar.jpg
    237 KB · Views: 123
Level 23
Joined
Jan 1, 2011
Messages
1,504
I get what you're saying but the fact is when I try to set 'V_Unit' as the handle, there is no variable to pick from at all. Look at the picture below to see.

I'm using Almia's way for now.

That is one of the major flaws of GUI hashtables, the key function is bugged. It does not allow you to use udg variables. However, this can be fixed by using custom script.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
That is one of the major flaws of GUI hashtables, the key function is bugged. It does not allow you to use udg variables. However, this can be fixed by using custom script.

if i use the normal WE i can use the udg variables. So im not sure y he cant unless he is using JNGP.

its been a while since i used the normal WE so i could be mistaken. i dont think i am tho
 
Level 8
Joined
Apr 23, 2010
Messages
312
deathismyfriend said:
if i use the normal WE i can use the udg variables. So im not sure y he cant unless he is using JNGP.

its been a while since i used the normal WE so i could be mistaken. i dont think i am tho

I'm using the normal WE and it works if I use Almia's method with the custom script but the GUI way doesn't work. That's alright though as long as it works the way it should. What WE do you use?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
normal world editor.
u need to store it as a handle and use the handle variable like this
or use the tempInt which can be used as key of picked unit
  • Actions
    • Set hand = (Picked unit)
    • Set tempInt = (Key (Picked unit))
    • Hashtable - Save 0 as (Key hand) of tempInt in (Last created hashtable)
see what i mean lol. u can do this in normal WE.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
ik but u can still do this lol.
  • Set tempInt = (Key hand)
that other one was just a quick example

the variable hand is actually a handle variable not a unit variable

ur trying to use the unit variable when in fact u need to use the handle variable to be able to do this.

here look at this map on the normal WE
 

Attachments

  • handle variables w hashtables.w3x
    15.8 KB · Views: 63
Level 23
Joined
Jan 1, 2011
Messages
1,504
if i use the normal WE i can use the udg variables. So im not sure y he cant unless he is using JNGP.

its been a while since i used the normal WE so i could be mistaken. i dont think i am tho

Back when I used to use GUI I would switch between JNGP and the vanilla editor just to copy over hashtable keys. It was a pain. GUIers should stick to the vanilla editor.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I don't have time to test this map so I'm just gonna ask you one question:
Does the kill gets registered if the kill is made by a dummy that is spawned from a unit's spell ?

Example:
A hero targets an enemy unit using Spell A - in which this spell will spawn dummy unit to cast Storm Bolt and the Storm Bolt killed the target.

Now, does the kill gets registered ?

If it doesn't, well, fix it :)

If it does, good job :)
 
Level 8
Joined
Apr 23, 2010
Messages
312
I don't have time to test this map so I'm just gonna ask you one question:
Does the kill gets registered if the kill is made by a dummy that is spawned from a unit's spell ?

Example:
A hero targets an enemy unit using Spell A - in which this spell will spawn dummy unit to cast Storm Bolt and the Storm Bolt killed the target.

Now, does the kill gets registered ?

If it doesn't, well, fix it :)

If it does, good job :)
No it would not be registered for the casting unit of the spell, and now that you mention it this system would give the dummy unit the veteran ability. I guess i'll have a couple of things to change.

I wonder... How would I even go about fixing that for a spell that uses dummies?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Out of curiosity, did you get your system to give kills to the casting unit of the dummy spell?
No, and that is why your system is not unique.
If you manage to solve this problem, yes, your system beats me.

I do know how to solve the problem, but guess I'm too lazy ;p

Hint: Use a Hashtable to link the dummy and the caster

I have changed a couple things but won't update until I figure out the dummy-unit caster bug.
It's not a bug, it's a feature.
 
Level 8
Joined
Apr 23, 2010
Messages
312
Maker said:
-The rank icon has no disabled version
-You could store a boolean and check the boolean for blocked units instead of using a loop
-You could store a boolean and check the boolean for abilities instead of using a loop
What do you mean? I don't understand how I would use one boolean to check for multiple units/abilities that I want to check.
 
Top