• 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.

Who is the killer? locust or hero?

Status
Not open for further replies.
Level 14
Joined
Nov 18, 2007
Messages
1,084
Well, when I tested it out with my trigger....
  • Locust or Hero?
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (THE KILLER + (Name of (Killing unit)))
      • Game - Display to (All players) the text: (THE DEAD + (Name of (Triggering unit)))
The game said the killer was Locust....
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,267
I must make it so that the triggers somehow identifies it with the owner of the caster of the locust, or else I'm stuck with my drone project :S

The problem is that I have no idea how. Also this must be for several casters, which in my idea is structures who release drone swarms. MUI.
 
Level 11
Joined
Apr 6, 2008
Messages
760
easy

  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set killer = (Killing unit)
      • Set Dieing = (Triggering unit)
      • Set Score[(Player number of (Owner of killer))] = (Score[(Player number of (Owner of killer))] + 1)
      • Game - Display to (All players) the text: ((Name of (Owner of killer)) + ( Pwned + (Name of (Owner of Dieing))))
      • Set killer = No Unit
      • Set Dieing = No Unit
well if u have a map with alots of units, then dont display a message for each unit u kill:p


EDIT: Remove Unessary locals
 
Last edited:
  • Set killer[Player number of (Owner of (Killing unit))] = (Killing unit)
  • Set Dying[Player number of (Owner of (Killing unit))] = (Triggering unit)
to make this one mui ;)

In fact, I think you don't need this, once the trigger has no Waits. It's almost instant.
The only leak I'd see in this trigger would be the repeated Player number of (Owner of (Killing Unit)).

To detect the killer, I'd do something similar to this:
  • Events
    • Unit - A unit spawns a summoned unit
  • Conditions
    • (Ability being cast) equal to Locust
  • Actions
    • Set _Integer = _Integer + 1
    • Set _Caster = (Triggering Unit)
    • Set _Unit = (Summoned Unit)
    • Unit - Set _Caster custom value to _Integer
    • Unit - Set _Unit custom value to _Integer
    • Set LocustCaster[_Integer] = _Unit
This way you have given an ID to each locust and to the hero, the custom value.
To detect the hero, do:
  • Set _Integer = Custom value of (Killing Unit)
So, LocustCaster[_Integer] is the hero you're looking for.

I'm sorry but I'm not sure if this really works, but I think it can do so. A similar system is used in Monolith, made by Blizzard, to detect the bush effects created by a building.
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
easy

  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: local unit udg_killer
      • Custom script: local unit udg_Dieing
      • Set killer = (Killing unit)
      • Set Dieing = (Triggering unit)
      • Set Score[(Player number of (Owner of killer))] = (Score[(Player number of (Owner of killer))] + 1)
      • Game - Display to (All players) the text: ((Name of (Owner of killer)) + ( Pwned + (Name of (Owner of Dieing))))
      • Set killer = No Unit
      • Set Dieing = No Unit
well if u have a map with alots of units, then dont display a message for each unit u kill:p

Learn when and how to use the local trick, or, better yet, learn JASS.
 
Level 11
Joined
Apr 6, 2008
Messages
760
Originally Posted by Ciebron
easy

  • Trigger
  • Events
  • Unit - A unit Dies
  • Conditions
  • Actions
  • Custom script: local unit udg_killer
  • Custom script: local unit udg_Dieing
  • Set killer = (Killing unit)
  • Set Dieing = (Triggering unit)
  • Set Score[(Player number of (Owner of killer))] = (Score[(Player number of (Owner of killer))] + 1)
  • Game - Display to (All players) the text: ((Name of (Owner of killer)) + ( Pwned + (Name of (Owner of Dieing))))
  • Set killer = No Unit
  • Set Dieing = No Unit
well if u have a map with alots of units, then dont display a message for each unit u kill:p

Learn when and how to use the local trick, or, better yet, learn JASS.

i know jass just wasnt sure there:p
 
Status
Not open for further replies.
Top