• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Custom Feral Spirit. Trigger problem.

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Hello, Hive!

I am working on a Hero right now and I've ran into a problem with one of his spells - Feral Spirit. Basically it's the original Feral Spirit spell, but it adds healing on the attacks of the wolves. Here is what I wanted to achieve:

• Feral Spirits must always heal the Far Seer no matter where he is.
• Feral Spirits heal allied units within 150 range of the attacked target.
• Feral Spirits cannot heal themselves. One Spirit can heal the other, but not itself.

The problem I ran into is that the Feral Spirits heal the Far Seer not only when they attack, but also when they are attacked. I've spent hours and hours to find the problem, but so far - no luck. I'll post the triggers now and after that I will explain what I thought that could be the problem, but isn't.

Here is the trigger where I set the Far_Seer variable.
[trigger=""]FS Setup
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Feral Spirit (Far Seer)
Actions
Set Far_Seer = (Triggering unit)
[/trigger]


Here is trigger one of the Damage Configuration.
[trigger=""]FS Configuration
Events
Map initialization
Conditions
Actions
Set FS_Config_Group = (Units in (Playable map area))
Unit Group - Pick every unit in FS_Config_Group and do (Actions)
Loop - Actions
Trigger - Add to FS Heal <gen> the event (Unit - (Picked unit) Takes damage)
Custom script: call DestroyGroup(udg_FS_Config_Group)
[/trigger]


Here is trigger two of the Damage Configuration.
[trigger=""]FS Configuration 2
Events
Unit - A unit enters (Playable map area)
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Not equal to Spirit Wolf (Level 1)
(Unit-type of (Triggering unit)) Not equal to Dire Wolf (Level 2)
(Unit-type of (Triggering unit)) Not equal to Shadow Wolf (Level 3)
(Unit-type of (Triggering unit)) Not equal to Elemental Wolf (Level 4)
Actions
Trigger - Add to FS Heal <gen> the event (Unit - (Triggering unit) Takes damage)
[/trigger]


And here is the actual effect trigger.
[trigger=""]FS Heal
Events
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
(Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
(Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
(Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
Actions
-------- HEAL FAR SEER --------
Set Heal_FeralSpirit_Amount = ((0.00 + (5.00 x (Real((Level of Feral Spirit (Far Seer) for Far_Seer))))) + (0.25 x (Real((Intelligence of Far_Seer (Include bonuses))))))
Unit - Set life of Far_Seer to ((Life of Far_Seer) + Heal_FeralSpirit_Amount)
Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above Far_Seer with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
-------- HEAL AOE --------
Set FeralSpirit_Point = (Position of (Triggering unit))
Set FeralSpirit_Group = (Units within 150.00 of FeralSpirit_Point matching ((((Matching unit) belongs to an ally of (Owner of (Damage source))) Equal to True) and (((Unit-type of (Matching unit)) Not equal to |c00ffff99Far Seer|r) and (((Matching unit) Not equal to (Damage source))
Unit Group - Pick every unit in FeralSpirit_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Heal_FeralSpirit_Amount)
Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
Custom script: call RemoveLocation(udg_FeralSpirit_Point)
Custom script: call DestroyGroup(udg_FeralSpirit_Group)
[/trigger]


Here is what came to my mind:

• Maybe another trigger makes it so when Feral Spirits are attacked to heal the Far Seer. Checked, this isn't the issue.
• I played with the conditions countless of times. None seem to work.
• I've tried the system without the AoE heal once, and the second time without the Far Seer heal. This isn't the issue.

Just as a side note. Here is a very simple trigger that has almost the same effect. It works perfectly. Events are added in same manner as shown above.

[trigger=""]Demonic Bond
Events
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Damage source)) Equal to Felguard (Level 2)
(Unit-type of (Damage source)) Equal to Felguard (Level 3)
(Unit-type of (Damage source)) Equal to Felguard (Level 4)
Actions
Set Heal_DemonicBond_Amount = (0.30 x (Real((Integer((Damage taken))))))
Unit - Set life of Warlock to ((Life of Warlock) + Heal_DemonicBond_Amount)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Heal_DemonicBond_Amount Greater than or equal to 1.00
Then - Actions
Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_DemonicBond_Amount))))) above Warlock with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players matching (((Matching player) Not equal to (Owner of Warlock)) and (((Matching player) Not equal to Neutral Hostile) and ((Matching player) Not equal to Player 12 (Brown)))))
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
Else - Actions
[/trigger]
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,912
Well, basically the problem is here:
  • FS Configuration 2
  • Events
  • Unit - A unit enters (Playable map area)
  • Conditions
  • Actions
  • Trigger - Add to FS Heal <gen> the event (Unit - (Entering unit) Takes damage)
If a spirit enters in the map he will be registered in the event :D so you have to put conditions of the spirits unit type. By the way, change Entering unit to triggering unit, it's way faster.
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Well, basically the problem is here:
  • FS Configuration 2
  • Events
  • Unit - A unit enters (Playable map area)
  • Conditions
  • Actions
  • Trigger - Add to FS Heal <gen> the event (Unit - (Entering unit) Takes damage)
If a spirit enters in the map he will be registered in the event :D so you have to put conditions of the spirits unit type. By the way, change Entering unit to triggering unit, it's way faster.

It used to have conditions. Still didn't work. Besides I have the conditions in the FS Heal trigger.

EDIT: It's updated with conditions now. Still heals far seer when the Spirits are attacked.
 
Last edited:

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Then try to add conditions on FS Heal trigger like
  • (Unit-type of (Attacked unit) Not equal to Spirit Wolf (Level 1)
but as "and conditions"

Attacked Unit? The event is:
  • Trigger - Add to FS Heal <gen> the event (Unit - (Triggering unit) Takes damage)
It will do nothing.

I have this:
  • Or - Any (Conditions) are true
    • Conditions
      • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
      • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
      • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
      • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
Updated trigger with "Triggering Unit" instead of "Entering Unit".
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Changed it to this:

  • FS Heal
    • Events
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
          • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
          • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
          • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
    • Actions
      • -------- HEAL FAR SEER --------
      • Set Heal_FeralSpirit_Amount = ((0.00 + (5.00 x (Real((Level of Feral Spirit (Far Seer) for Far_Seer))))) + (0.25 x (Real((Intelligence of Far_Seer (Include bonuses))))))
      • Unit - Set life of Far_Seer to ((Life of Far_Seer) + Heal_FeralSpirit_Amount)
      • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above Far_Seer with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • -------- HEAL AOE --------
      • Set FeralSpirit_Point = (Position of (Triggering unit))
      • Set FeralSpirit_Group = (Units within 150.00 of FeralSpirit_Point matching ((((Matching unit) belongs to an ally of (Owner of (Damage source))) Equal to True) and (((Unit-type of (Matching unit)) Not equal to |c00ffff99Far Seer|r) and (((Matching unit) Not equal to (Damage source))
      • Unit Group - Pick every unit in FeralSpirit_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Heal_FeralSpirit_Amount)
          • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • Custom script: call RemoveLocation(udg_FeralSpirit_Point)
      • Custom script: call DestroyGroup(udg_FeralSpirit_Group)
Problem still persists.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,912
No no, besides this:
  • Conditions
  • Or - Any (Conditions) are true
    • Conditions
      • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
      • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
      • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
      • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
Add that part of conditions:
  • Conditions
  • And - All (Conditions) are true
    • Conditions
      • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
      • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
      • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
      • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
=
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
        • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
        • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
        • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
    • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
    • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
    • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
    • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
Understand? xD
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Chaged into this: No result. :/
  • FS Heal
    • Events
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
              • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
              • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
              • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
          • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
          • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
          • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
          • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
    • Actions
      • -------- HEAL FAR SEER --------
      • Set Heal_FeralSpirit_Amount = ((0.00 + (5.00 x (Real((Level of Feral Spirit (Far Seer) for Far_Seer))))) + (0.25 x (Real((Intelligence of Far_Seer (Include bonuses))))))
      • Unit - Set life of Far_Seer to ((Life of Far_Seer) + Heal_FeralSpirit_Amount)
      • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above Far_Seer with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • -------- HEAL AOE --------
      • Set FeralSpirit_Point = (Position of (Triggering unit))
      • Set FeralSpirit_Group = (Units within 150.00 of FeralSpirit_Point matching ((((Matching unit) belongs to an ally of (Owner of (Damage source))) Equal to True) and (((Unit-type of (Matching unit)) Not equal to |c00ffff99Far Seer|r) and (((Matching unit) Not equal to (Damage source))
      • Unit Group - Pick every unit in FeralSpirit_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Heal_FeralSpirit_Amount)
          • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • Custom script: call RemoveLocation(udg_FeralSpirit_Point)
      • Custom script: call DestroyGroup(udg_FeralSpirit_Group)
  • [/hidden]
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,912
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
        • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
        • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
        • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
    • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
    • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
    • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
    • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
It's this, but you're doing it wrong :/
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
Nope. Still doesn't work :/
  • FS Heal
    • Events
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Damage source)) Equal to Spirit Wolf (Level 1)
          • (Unit-type of (Damage source)) Equal to Dire Wolf (Level 2)
          • (Unit-type of (Damage source)) Equal to Shadow Wolf (Level 3)
          • (Unit-type of (Damage source)) Equal to Elemental Wolf (Level 4)
      • (Unit-type of (Attacked unit)) Not equal to Spirit Wolf (Level 1)
      • (Unit-type of (Attacked unit)) Not equal to Dire Wolf (Level 2)
      • (Unit-type of (Attacked unit)) Not equal to Shadow Wolf (Level 3)
      • (Unit-type of (Attacked unit)) Not equal to Elemental Wolf (Level 4)
    • Actions
      • -------- HEAL FAR SEER --------
      • Set Heal_FeralSpirit_Amount = ((0.00 + (5.00 x (Real((Level of Feral Spirit (Far Seer) for Far_Seer))))) + (0.25 x (Real((Intelligence of Far_Seer (Include bonuses))))))
      • Unit - Set life of Far_Seer to ((Life of Far_Seer) + Heal_FeralSpirit_Amount)
      • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above Far_Seer with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • -------- HEAL AOE --------
      • Set FeralSpirit_Point = (Position of (Triggering unit))
      • Set FeralSpirit_Group = (Units within 150.00 of FeralSpirit_Point matching ((((Matching unit) belongs to an ally of (Owner of (Damage source))) Equal to True) and (((Unit-type of (Matching unit)) Not equal to |c00ffff99Far Seer|r) and (((Matching unit) Not equal to (Damage source))
      • Unit Group - Pick every unit in FeralSpirit_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Heal_FeralSpirit_Amount)
          • Floating Text - Create floating text that reads (|c0010db0a+ + (String((Integer(Heal_FeralSpirit_Amount))))) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards (Random real number between 45.00 and 135.00) degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.30 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
      • Custom script: call RemoveLocation(udg_FeralSpirit_Point)
      • Custom script: call DestroyGroup(udg_FeralSpirit_Group)
  • [/hidden]
 
Level 26
Joined
Sep 26, 2009
Messages
2,427
I would change the
  • (Unit-type of (Attacked unit))
into
  • (Unit-type of (Triggering unit))
since "attacked unit" is a response only to the "Unit is attacked" event I think.
Because your event is "Unit takes damage", it could be triggering unit instead.
 
Status
Not open for further replies.
Top