HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

every time a hero kills someone, his personal killcount above his head

02-01-2005, 04:04 AM#1
bananarchy
does anyone know how to do this? i cant figure out an event that is whenever a unit kills an enemy or something. any help?
02-01-2005, 08:27 AM#2
player_72985
Code:
Melee Initialization
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        ((Killing unit) is A Hero) Equal to True
    Actions
        If ((Owner of (Killing unit)) Equal to Player 1 (Red)) then do (Set Kills_Integer = (Kills_Integer + 1)) else do (Do nothing)
        If (((Killing unit) is A Hero) Equal to True) then do (Floating Text - Create floating text that reads ((String(Kills_Integer)) +  Kills) above (Killing unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency) else do (Do nothing)
        Wait 3.00 seconds
        Floating Text - Destroy (Last created floating text)

I am not 100% sure on this trigger...I know it's "close" to what you want I just can't think of the actual trigger since it's 1:23 in the morning..and I am not sure if I know the exact trigger function anyway >_< and I hope you know how to make variables since it will require that you do so :)
02-01-2005, 08:46 AM#3
wiebbe
Quote:
Originally Posted by player_72985
Code:
Melee Initialization
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        ((Killing unit) is A Hero) Equal to True
    Actions
        If ((Owner of (Killing unit)) Equal to Player 1 (Red)) then do (Set Kills_Integer = (Kills_Integer + 1)) else do (Do nothing)
        If (((Killing unit) is A Hero) Equal to True) then do (Floating Text - Create floating text that reads ((String(Kills_Integer)) +  Kills) above (Killing unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency) else do (Do nothing)
        Wait 3.00 seconds
        Floating Text - Destroy (Last created floating text)

I am not 100% sure on this trigger...I know it's "close" to what you want I just can't think of the actual trigger since it's 1:23 in the morning..and I am not sure if I know the exact trigger function anyway >_< and I hope you know how to make variables since it will require that you do so :)

what he says would work like a charm, but the best thing to do would be to not use like 12 If statements for all the players, but just do it like this:

Code:
Set Kills_Integer[Player Number of(Owner of killing unit)] = (Kills_Integer[Player Number of(Owner of killing unit)] + 1)

this way you dont have to make all the ifstatements, and can just call the variabe for each person.

Btw, it is a Integer Array that is used, and the index is the player number of the ownen of the killing unit.
02-01-2005, 09:40 AM#4
PatruX
Creating one trigger for each player like player_72985 said would work.

Wiebbe's won't work because:
If hero x kills a unit, his kills will be shown above his head, but if hero z kills a unit (within those 3 secs before hero x's Floating Text will be destroyed) the hero x kills text will be shown forever since hero z's "score text" is the last created.

So either create one trigger for each player, or use local variables.
02-02-2005, 04:39 PM#5
iNfraNe
Quote:
Originally Posted by PatruX
Creating one trigger for each player like player_72985 said would work.

Wiebbe's won't work because:
If hero x kills a unit, his kills will be shown above his head, but if hero z kills a unit (within those 3 secs before hero x's Floating Text will be destroyed) the hero x kills text will be shown forever since hero z's "score text" is the last created.

So either create one trigger for each player, or use local variables.
players trigger wont work either, based on the same thing u said, the last created floating text will change. However ofcourse, locals would work. Or even an array cuz in this case there is a max of floating texts.
02-02-2005, 04:51 PM#6
Undifty
Quote:
Originally Posted by toot
players trigger wont work either, based on the same thing u said, the last created floating text will change. However ofcourse, locals would work. Or even an array cuz in this case there is a max of floating texts.

This will not help someone... BUT I HATE FLOATING TEXTS!!! (and thats becouse they never do as i want)
02-02-2005, 09:38 PM#7
bananarchy
if there was a generic unit event, when a unit kills another unit, i can see how this could be done on a per hero basis, but there isnt such a generic unit event. do you guys know any work arounds?