• 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] problem

Status
Not open for further replies.
Level 10
Joined
Jun 17, 2014
Messages
236
when i was creating a spell, and i triggered it. the spell doesnt work, i dont know what's the problem.
here is the trigger
  • conf kyo
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Kyo_ShieldAmount[1] = 75.00
      • Set Kyo_ShieldAmount[2] = 105.00
      • Set Kyo_ShieldAmount[3] = 135.00
      • Set Kyo_ShieldAmount[4] = 165.00
  • Kyo execute
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kiyomori
    • Actions
      • Set Kyo_Caster = (Triggering unit)
      • Set Kyo_Value = (Custom value of Kyo_Caster)
      • Set Kyo_Level = (Level of Kiyomori for Kyo_Caster)
      • Set Kyo_ShieldLeft[Kyo_Value] = (Kyo_ShieldAmount[Kyo_Level] + (0.15 x ((Max life of Kyo_Caster) - (Life of Kyo_Caster))))
      • Game - Display to (All players) the text: (String(Kyo_ShieldLeft[Kyo_Value]))
  • kyo takes
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has buff Kiyomori ) Equal to True
        • Then - Actions
          • Set Kyo_Value = (Custom value of DamageEventTarget)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Kyo_ShieldLeft[Kyo_Value] Greater than 0.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Kyo_ShieldLeft[Kyo_Value] Greater than DamageEventAmount
                • Then - Actions
                  • Game - Display to (All players) the text: (String(Kyo_ShieldLeft[Kyo_Value]))
                  • Set Kyo_ShieldLeft[Kyo_Value] = (Kyo_ShieldLeft[Kyo_Value] - DamageEventAmount)
                  • Set DamageEventAmount = 0.00
                • Else - Actions
                  • Game - Display to (All players) the text: (String(Kyo_ShieldLeft[Kyo_Value]))
                  • Set Kyo_ShieldLeft[Kyo_Value] = 0.00
                  • Set DamageEventAmount = (DamageEventAmount - Kyo_ShieldLeft[Kyo_Value])
            • Else - Actions
              • Unit - Remove Kiyomori buff from Kyo_Caster
              • Set Kyo_ShieldLeft[Kyo_Value] = 0.00
        • Else - Actions
the spell description : hero creates shield that protecting him from 70/105/135/165 +(15% Missing Health) damage.
thank you
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Do all the game messages appear?

(I must say, this is really well coded.)

EDIT:
"Unit - Remove Kiyomori buff from Kyo_Caster"
That should be DamageEventTarget...

Also, when you reduce the damage by the remaining shield value, you should also remove the buff from the target.
That would also make the check if the value is bigger than 0 unnecessary including the else actions from that if.
 
Level 14
Joined
Oct 18, 2013
Messages
724
You don't really need the init trigger, since the increase in shield amount per level is linear.

Just do (AbilityLevel*30)+45 instead.

Also, what DDS are you using?

If I understand the trigger correctly, units are never going to have the buff but have a Kyo_ShieldLeft[] value of 0, so why an extra If/Then?

I think what you have to do is add DamageEventAmount to the unit's life if the damage isn't greater than ShieldLeft. If it is, give the unit life back equal to: (DamageEventAmount-ShieldLeft)
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Can you upload the map?
I think that it configured incorrectly when you imported it into your map cause... well you know... its Bribe :D
(For real, there are more people using that resource and for most of them, it works fine.)

EDIT:

Try re-importing the Unit Indexer. (And maybe the Damage System as well, but that shouldnt be necessary.)
Also, change your trigger to this:
  • kyo takes
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has buff Kiyomori ) Equal to True
        • Then - Actions
          • Set Kyo_Value = (Custom value of DamageEventTarget)
          • Special Effect - Create a special effect attached to the origin of DamageEventTarget using war3mapImported\Blood Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Game - Display to (All players) the text: (String(DamageEventAmount))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Kyo_ShieldLeft[Kyo_Value] Greater than DamageEventAmount
            • Then - Actions
              • Game - Display to (All players) the text: (String(Kyo_ShieldLeft[UDex]))
              • Set Kyo_ShieldLeft[UDex] = (Kyo_ShieldLeft[UDex] - DamageEventAmount)
              • Set DamageEventAmount = 0.00
            • Else - Actions
              • Game - Display to (All players) the text: (String(Kyo_ShieldLeft[UDex]))
              • Set DamageEventAmount = (DamageEventAmount - Kyo_ShieldLeft[UDex])
              • Set Kyo_ShieldLeft[UDex] = 0.00
              • Unit - Remove Kiyomori buff from DamageEventTarget
        • Else - Actions
(Except that you have to change all "UDex" to "Kyo_Value".)

(Also, take a look at the importing instructions of the Unit Indexer, your hero has an ability with the same rawcode so it wont properly work.)
 
Last edited:
Status
Not open for further replies.
Top