• 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] Inner Power Spell (Needs Fix)

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
Oke, I made a very simple custom spell for this guy.
And it's working just fine.

I'm new to the whole custom spell thing but this one has a problem.
Sometimes the vertex coloring does not appear or disappears to soon, here are the triggers:

  • Your Spell
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Inner Power [I]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Inner Power [I] for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set PowerLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
          • Set PowerCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at PowerLoc[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
          • Unit - Add Power 1 to (Last created unit)
          • Unit - Order (Last created unit) to Human Priest - Inner Fire PowerCaster[(Player number of (Owner of (Triggering unit)))]
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Animation - Change PowerCaster[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (10.00%, 10.00%, 20.00%) with 10.00% transparency
          • Floating Text - Create floating text that reads Inner Power [Rank 1] at PowerLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (0.00%, 50.00%, 90.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards (Random real number between 70.00 and 110.00) degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
          • Custom script: call RemoveLocation(udg_PowerLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Inner Power [I] for (Triggering unit)) Equal to 2
            • Then - Actions
              • Set PowerLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
              • Set PowerCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
              • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at PowerLoc[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
              • Unit - Add Power 2 to (Last created unit)
              • Unit - Order (Last created unit) to Human Priest - Inner Fire PowerCaster[(Player number of (Owner of (Triggering unit)))]
              • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
              • Animation - Change PowerCaster[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (10.00%, 10.00%, 20.00%) with 10.00% transparency
              • Floating Text - Create floating text that reads Inner Power [Rank 2] at PowerLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (0.00%, 50.00%, 90.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards (Random real number between 70.00 and 110.00) degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
              • Custom script: call RemoveLocation(udg_PowerLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Inner Power [I] for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Set PowerLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
                  • Set PowerCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
                  • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at PowerLoc[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
                  • Unit - Add Power 3 to (Last created unit)
                  • Unit - Order (Last created unit) to Human Priest - Inner Fire PowerCaster[(Player number of (Owner of (Triggering unit)))]
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Animation - Change PowerCaster[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (10.00%, 10.00%, 20.00%) with 10.00% transparency
                  • Floating Text - Create floating text that reads Inner Power [Rank 3] at PowerLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (0.00%, 50.00%, 90.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards (Random real number between 70.00 and 110.00) degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
                  • Custom script: call RemoveLocation(udg_PowerLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Inner Power [I] for (Triggering unit)) Equal to 4
                    • Then - Actions
                      • Set PowerLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
                      • Set PowerCaster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
                      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at PowerLoc[(Player number of (Owner of (Triggering unit)))] facing 0.00 degrees
                      • Unit - Add Power 4 to (Last created unit)
                      • Unit - Order (Last created unit) to Human Priest - Inner Fire PowerCaster[(Player number of (Owner of (Triggering unit)))]
                      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                      • Animation - Change PowerCaster[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (10.00%, 10.00%, 20.00%) with 10.00% transparency
                      • Floating Text - Create floating text that reads Inner Power [Rank 4] at PowerLoc[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (0.00%, 50.00%, 90.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards (Random real number between 70.00 and 110.00) degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
                      • Custom script: call RemoveLocation(udg_PowerLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
                    • Else - Actions
  • Your Spell 2
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • (PowerCaster[(Player number of (Owner of (Triggering unit)))] has buff Inner Power) Equal to False
    • Actions
      • Animation - Change PowerCaster[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Any idea's? Also, is this spell made good 'n optimized or not.. xD
 
Level 9
Joined
May 27, 2006
Messages
498
Use Begins effect of an ability instead of finishes casting. Secondly, you're using a periodical trigger, which fires every 0.5 second. If the spell was cast like 0.1 sec before this trigger run, it'll look like the effect went on/off a bit faster/slower. Try placing a loop in the first trigger and use it to trigger the vertex coloring action instead of periodical trigger.
 
Level 9
Joined
May 27, 2006
Messages
498
  • Blah
    • Actions:
      • For each (Integer A) from 1 to 10 do (Actions):
        • Loop - Actions
          • blah
This is a most common GUI loop.

JASS:
loop
    exitwhen i > 10
    call blah()
    set i = i + 1
endloop
This is an example of simple jass loop.

You got the point now?
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Lol i just realized something...
In his Spell 2 he uses (Owner of(Triggering Unit))... But in that trigger IS NOT TRIGGERING UNIT...

Set the unit into a variable...

And for the disable/enable .. yeah.. thats a problem...
I thought of using "pick every unit that has the buff but I am not sure if that works...
Or "pick eveyr unit in playable map area" and if "picked unit" has buff do not disable.. but that would cause lags if there are too many units I think...
 
Level 9
Joined
May 27, 2006
Messages
498
Well, wait, as far as i can see, the trigger 2 just sets the caster's vertex coloring back to normal after some period of time? If yes, you could just make a 0.5 sec wait action at the bottom of your main trigger and after that set triggering unit's vertex coloring back to default.
 
Status
Not open for further replies.
Top