Problem with killing spree system

Status
Not open for further replies.
Level 2
Joined
Jan 31, 2011
Messages
7
The problem with this is that when you reach a tripple kill (you kill 3 heroes inmediately one after the other) the function continues and you can still have a triple kill no matter how many seconds had passed since your last kill. So, you will have a triple kill until someone could kill you
And is it possible (with this system) to have more extra kills? For example: Double kill, triple kill, ultra kill, rampage?
If you know another system that could work properly please post it here.
Thanks in advance!

Killing System setup
  • Events
  • Map initialization
  • Conditions
  • Actions
  • -------- Setup Spree Sounds --------
  • Set Spree_Sounds[1] = No sound
  • Set Spree_Sounds[2] = No sound
  • Set Spree_Sounds[3] = Killing_Spree <gen>
  • Set Spree_Sounds[4] = Dominating <gen>
  • Set Spree_Sounds[5] = MegaKill <gen>
  • Set Spree_Sounds[6] = Unstoppable <gen>
  • Set Spree_Sounds[7] = WhickedSick <gen>
  • Set Spree_Sounds[8] = MonsterKill <gen>
  • Set Spree_Sounds[9] = GodLike <gen>
  • Set Spree_Sounds[10] = HolyShit <gen>
  • -------- Setup Get Spree Text --------
  • Set Spree_Texts[1] = <Empty String>
  • Set Spree_Texts[2] = <Empty String>
  • Set Spree_Texts[3] = |ris on a |cff00FF00killing spree|r!
  • Set Spree_Texts[4] = |ris |cff551A8Bdominating|r!
  • Set Spree_Texts[5] = |rhas a |cffCD1076mega kill|r!
  • Set Spree_Texts[6] = |ris |cffFF8C00unstoppable|r!!
  • Set Spree_Texts[7] = |ris |cff006400wicked sick|r!!
  • Set Spree_Texts[8] = |rhas a |cffFF6EB4monster kill|r!!
  • Set Spree_Texts[9] = |ris |CFFFF0303GODLIKE|r!!!
  • Set Spree_Texts[10] = |ris |CffDAA520beyond GODLIKE|r. Someone KILL HIM!!!
  • -------- Setup End Spree Text --------
  • Set SpreeEnd_Texts[1] = <Empty String>
  • Set SpreeEnd_Texts[2] = <Empty String>
  • Set SpreeEnd_Texts[3] = |cff00FF00killing spree|r
  • Set SpreeEnd_Texts[4] = |cff551A8Bdominating|r
  • Set SpreeEnd_Texts[5] = |cffCD1076mega kill|r
  • Set SpreeEnd_Texts[6] = |cffFF8C00unstoppable|r
  • Set SpreeEnd_Texts[7] = |cff006400wicked sick|r
  • Set SpreeEnd_Texts[8] = |cffFF6EB4monster kill|r
  • Set SpreeEnd_Texts[9] = |CFFFF0303GODLIKE|r
  • Set SpreeEnd_Texts[10] = |CffDAA520beyond GODLIKE|r
  • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
Killing System
  • Events
  • Unit - A unit Dies
  • Conditions
  • ((Triggering unit) is A Hero) Equal to True
  • Actions
  • Custom script: local string Message1
  • Custom script: local string Message2
  • Custom script: local string Message3
  • Custom script: local sound Sound1
  • Custom script: local sound Sound2
  • Custom script: local sound Sound3
  • If (Spree_Count[(Player number of (Owner of (Killing unit)))] Less than 10) then do (Set Spree_Count[(Player number of (Owner of (Killing unit)))] = (Spree_Count[(Player number of (Owner of (Killing unit)))] + 1)) else do (Do nothing)
  • -------- Kill Message --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Spree_Count[(Player number of (Owner of (Triggering unit)))] Less than or equal to 2
  • Then - Actions
  • -------- You didn't end a spree. --------
  • Set General_Integer[1] = 5
  • Player - Add General_Integer[1] to (Owner of (Killing unit)) Current gold
  • Game - Display to (All players) the text: (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + ((|r just pawned + PlayerColors[(Player number of (Owner of (Dying unit)))]) + ((Name of (Owner of (Dying unit))) + (|r's head for |CFFFFFF01 + ((String(Gene
  • Else - Actions
  • -------- You did end a spree. --------
  • Set General_Integer[1] = (5 + Spree_Count[(Player number of (Owner of (Triggering unit)))])
  • Game - Display to (All players) the text: (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + ((|r has just ended + PlayerColors[(Player number of (Owner of (Dying unit)))]) + ((Name of (Owner of (Dying unit))) + ((|r's + SpreeEnd_Texts[Spree_Count[(
  • Set Spree_Count[(Player number of (Owner of (Triggering unit)))] = 0
  • -------- First Blood --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • FirstBlood Equal to False
  • Then - Actions
  • Set FirstBlood = True
  • Set General_String[1] = (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r + just drew |CFFFF0303first blood!|r (+10 gold))))
  • Game - Display to (All players) the text: General_String[1]
  • Else - Actions
  • -------- Spree --------
  • Set General_String[2] = (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + Spree_Texts[Spree_Count[(Player number of (Owner of (Killing unit)))]]))
  • Custom script: set Message2 = udg_General_String[2]
  • Custom script: set Sound2 = udg_Spree_Sounds[udg_Spree_Count[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnit()))]]
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Spree_Count[(Player number of (Owner of (Killing unit)))] Less than or equal to 2
  • Then - Actions
  • Custom script: set Message2 = ""
  • Else - Actions
  • -------- Double/Triple Kill --------
  • Set General_Point[1] = (Center of (Playable map area))
  • Unit - Create 1 Dummy Unit (Double / Triple Kill Counter) for (Owner of (Killing unit)) at General_Point[1] facing Default building facing degrees
  • Set General_Unitgroup[1] = (Units owned by (Owner of (Killing unit)) of type Dummy Unit (Double / Triple Kill Counter))
  • Unit Group - Pick every unit in General_Unitgroup[1] and do (Unit - Set life of (Picked unit) to 100.00%)
  • Custom script: call DestroyGroup (udg_General_Unitgroup[1])
  • -------- Double Kill --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Number of units in (Units owned by (Owner of (Killing unit)) of type Dummy Unit (Double / Triple Kill Counter))) Equal to 2
  • Then - Actions
  • Set General_String[3] = (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r + |rjust got a |cff00008BDouble Kill|r!)))
  • Custom script: set Message3 = udg_General_String[3]
  • Custom script: set Sound3 = gg_snd_Double_Kill
  • Else - Actions
  • -------- Triple Kill --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Number of units in (Units owned by (Owner of (Killing unit)) of type Dummy Unit (Double / Triple Kill Counter))) Greater than or equal to 3
  • Then - Actions
  • Set General_String[3] = (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r + |rjust got a |cff00FF00Triple Kill|r!!!)))
  • Custom script: set Message3 = udg_General_String[3]
  • Custom script: set Sound3 = gg_snd_triple_kill
  • Else - Actions
  • -------- Display Messages & Play Sounds --------
  • Wait 0.50 seconds
  • Custom script: call PlaySoundBJ( Sound2 )
  • Custom script: if Message2 != "" then
  • Custom script: call DisplayTextToForce( GetPlayersAll(), Message2 )
  • Custom script: endif
  • Wait 1.50 seconds
  • Custom script: call PlaySoundBJ( Sound3 )
  • Custom script: if Message3 != "" then
  • Custom script: call DisplayTextToForce( GetPlayersAll(), Message3 )
  • Custom script: endif
Test map uploaded.
View attachment (2)DotA Spree & Assistance System (GUI).w3x
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here's something I slapped together quite quickly.

http://www.hiveworkshop.com/forums/pastebin.php?id=92ky3d

The lowes spree is triple kill. When a unit dies, the spree gets nulled.

Add texts to the text array and make set the last index to empty string.

You can add the sounds yourself. Adding the player colours should be easy too. Edit the displayed text messages, mine are just examples.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • Set SpreeEnd_Texts[1] = <Empty String>
Things like that are useless: it isn't worth setting up an empty string as a variable.
You have to remove that from the code.

You could create an additional timer that takes care of the time in between kills.
  • Spree Timer
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Spree_Time[(Player number of (Picked player))] = (Spree_Time[(Player number of (Picked player))] - 0.50)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Spree_Time[(Player number of (Picked player))] Less than or equal to 0.00
            • Then - Actions
              • Set Spree_TimedCount[(Player number of (Picked player))] = 0
            • Else - Actions
That should be sufficient.

Additionally, I'd change the entire trigger "Killing System":

  • If (Spree_Count[(Player number of (Owner of (Killing unit)))] Less than 10) then do (Set Spree_Count[(Player number of (Owner of (Killing unit)))] = (Spree_Count[(Player number of (Owner of (Killing unit)))] + 1)) else do (Do nothing)
You shouldn't use the ITE here: people want to keep track of their spree, even when it goes beyond 10.

You also use way too many arrays when you don't need them.
"General_Strings" and "General_Integer" could easily do without array.

  • Set General_String[1] = (PlayerColors[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r + just drew |CFFFF0303first blood!|r (+10 gold))))
  • Game - Display to (All players) the text: General_String[1]
Why even set the variable at all?

There were a lot of other mistakes you made (you don't need to set all those variables, those local variables are useless, if you decide to use JASS: don't use BJ's etc).
I edited the system so it should work.
 

Attachments

  • Spree and Assistance.w3x
    161 KB · Views: 81
Status
Not open for further replies.
Top