• 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] Buff with Trigger help

Status
Not open for further replies.
Level 6
Joined
Jul 13, 2006
Messages
140
I need help in getting this trigger to work.
  • Events
    • Unit - A unit Dies
  • Conditions
    • (((Dying unit) has buff Disease) Equal to True) and ((Unit-type of (Dying unit)) Equal to Rifleman)
  • Actions
    • Unit - Create 1 Unit for Player 12 (Brown) at (Position of (Dying unit)) facing Default building facing degrees
Problem is, it doesn't register that the dying unit has the disease buff.
 
Last edited:
Level 6
Joined
Jul 13, 2006
Messages
140
I'm not sure if the disease buff have to be "disease" or "disease cloud" but I'm pretty sure that it's "disease" since that's the one that shows up as an icon on an affected unit.

The dying unit is an organic unit based of the rifleman, maybe I should change that in the origional post.
 
Last edited:
Level 2
Joined
Mar 30, 2009
Messages
30
Mage_Goo is right

Just set Boolean to true when unit receives buff and to false when it looses it

Replace condition for buff with condition for Boolean

The Sorrow
 
Level 11
Joined
Nov 15, 2007
Messages
800
First trigger

  • Events
    • Whatever triggers your buff placement (starts effect of ability, is attacked, etc.)
  • Conditions
    • Whatever. Unit is organic/rifleman/anything else.
  • Actions
    • Unit - Add unit to UnitGroup (Whatever unit group)
Second

  • Events
    • Time - Every .05 seconds
  • Conditions
  • Actions
    • Unit Group - Pick every unit in UnitGroup and do
      • If - Unit has buff (your buff)
      • Then -
      • Else - Remove unit from UnitGroup

Then just change the condition in your trigger to
  • Unit Group - (Dying unit) is in (UnitGroup)
It's ridiculously late here so I probably messed up, in which case some kind person will fix it.
 
Level 6
Joined
Jul 13, 2006
Messages
140
Well, the thing is, I want this trigger to work for any kind of unit that is killed and has the "disease" buff, not for a specific unit to kill it, I already have that implemented in perfect working condition.

On to the point that I should have mentioned to begin with:
It should be so that it is in one trigger only since I'm going to use it with multiple units, every unit will have a specific unit created when they die with the buff.

For example:
If a rifleman dies with the buff then create a ghoul.
But if a footman dies with the buff then create a grunt, etcetc.
 
Level 6
Joined
Jul 13, 2006
Messages
140
I managed to do it an easier and more logical way thanks to Meticulous, but I wonder, will it leak?
By logical I mean that it won't fire if a unit get's splashed by for example artillery.

  • Just a trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Unit
              • (Life of (Picked unit)) Less than or equal to 2.00
              • ((Picked unit) has buff Disease) Equal to True
            • Then - Actions
              • Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
              • Unit - Replace (Picked unit) with a Unit using The new unit's default life and mana
            • Else - Actions
              • Do nothing
And will it make the map in which it's used completely unplayable due to lag if I have about 27 "copies" of this trigger firing of every second?
 
Last edited:
Level 9
Joined
Jun 7, 2008
Messages
440
You might run into a problem when checking if the life is less than 2. Units die quick when life is or below 2 so it is pretty hard to check.
EDIT: Put the units that has the buff disease into a unitgroup. Then check when the unit dies if it is in the group. If the dying unit equal to rifleman then create 1 ghoul. Etc. Etc
 
Last edited:
Level 6
Joined
Jul 13, 2006
Messages
140
I know that units tend to die quick when they have a little over 2 but since this'll be implemented in a sci-fi map so.....if they get nuked into oblivion.....it won't fire, which is what I meant with the most "logical" way.

But the question with this way is: will it leak and is there a way to make 26 copies of it running at once without just making the game unplayable due to lag?
 
Level 9
Joined
Jun 7, 2008
Messages
440
By doing what i am said no. It doesnt matter how many units die, or who owns them. As long as the "unit - with buff" is in the unitgroup. Once unit dies, check to see if its in the unitgroup, if it is then check which unit died, and create the appropriate one. It should work fine. The event though would be:
  • Events
    • Unit - a unit dies
 
Status
Not open for further replies.
Top