• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

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

Status
Not open for further replies.
Level 1
Joined
Aug 22, 2011
Messages
3
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".
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
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.
 
Level 1
Joined
Aug 22, 2011
Messages
3
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:
Status
Not open for further replies.
Top