• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Units levling

Status
Not open for further replies.
Level 2
Joined
Oct 15, 2009
Messages
8
Hello everyone

I`m new here and I allready have a little problem ;P

Atm I`m making a little Fun Map for some friends of mine (because we like the Map "Warlord Empire" but there is just one type of it xD)

I had no problems making a income system (although its kinda newbish it works fine ;P)

now my Problem:
In "Warlord Empire" the Units can "level up" after killing a set amount of units. It`s no problem for me to get a integer which can count the kills etc., but I want that every single unit has a "kill-counter" (around 50-80 units per player) and has multiple "level ups" until it morphes into a hero.

I really would appreciate it if someone has an intresting trigger-screen or jass-snippet

and allready thanks for your help =>

PS: sorry for my bad english =/

{EDIT}
I tried it with

Event:
-Unit Dies
Condition:
-
Actions:
-Set Costum Value of Killing Unit to (KillCounter +1)

I know this is really really wrong, but I dont find a way for giving every unit a counter for their kills.. - pls help =o

/push

thx 4 help =x

PS: sry 4 doublepost
 
Last edited by a moderator:
Level 6
Joined
Mar 22, 2009
Messages
276
i also got the same problem with you last month.
and i found the answer on that is indexing.
try searching for indexing to make it mui.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
With a hashtable:

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Kill_Hash = (Last created hashtable)
  • Untitled Trigger 077
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Temp_Integer_1 = (Load (Key kills) of (Key (Killing unit)) from Kill_Hash)
      • Hashtable - Save (Temp_Integer_1 + 1) as (Key kills) of (Key (Killing unit)) in Kill_Hash
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Kill_Hash
Use that "clear hashtable" if you don't need to keep up with the dying unit's kills.

If the dying unit is a hero and it can be resurrected, you might not want to clear the child hashtable. Use IF/THEN/ELSE in that case.

Indexing system is a bit faster BTW.
 
Status
Not open for further replies.
Top