• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Strange problem with Random Trigger and its more basic equiviliant.

Status
Not open for further replies.

Abokasee-the-Troll

A

Abokasee-the-Troll

I'm trying to create a trigger which will create a random chance of a unit being upgraded after it kills another unit. Unforutunatly this trigger doesn't work at all for some reason.

Here is the trigger:
  • Grunt to Proven
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Grunt
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 6) Greater than or equal to 3
        • Then - Actions
          • Unit - Replace (Attacking unit) with a Proven using The old unit's relative life and mana
        • Else - Actions
          • Do nothing
Even this version doesnt work:
  • Grunt to Proven Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Grunt
    • Actions
      • Unit - Replace (Attacking unit) with a Proven using The old unit's relative life and mana
As you might of guessed this trigger is simply a case of "Did a unit die? was the killer a Grunt? Make him a Proven if so."

I have no idea why this doesn't work.
Much help apprieciated.
Rep will of course be given.
 
  • (Unit-type of (Attacking unit)) Equal to Grunt
This returns null. Did you mean "Killing unit"?

If you want to refer to the unit that has died, use (Triggering unit); if you want to refer to its killer, use (Killing unit).
(Attacked unit) and (Attacking unit) are event responses for the event "Unit - A unit is attacked".
 
Does that event even setup a result for "Attacking unit"?
I know it sets up Triggering Unit as the unit which dies, Killing Unit as the unit which made the kill and Dieing Unit as the unit which died. I think "Attacking unit" is returning null.

Try changing it to an event response state recall native which works with the event type it gets attached to.
 
Ahh that would probably be my problem, never noticed that particulary Event-Response in the vast sea of them. I guess "Attacking Unit" worked for my other triggers as those didn't involve the actual enemy in question dying. (Yet)

Anyway +REP to the vast quantity of rep you already have :grin:

Update:
I have tested your recomended fix and it works perfectly in both version of the trigger. Thankyou very much.
 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top