• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Hybdrid Spell Problem

Status
Not open for further replies.
Level 13
Joined
Jul 26, 2008
Messages
1,009
Alright, I'm more familiar with JASS than I am triggers, however I'm not too familiar with all the capabilities of WE Trigger Editor and JASS functions.

This is a spell that mixes Triggers with Custom Script (AKA Jass) to attempt a spell using local variables.

However, the spell doesn't seem to function at all.

It's based off of Stampede.

Here is it's tooltip description:
Causes healing energy to seep up through the earth at a targeted point in the form of water, rapidly replenishing all nearby allies over time.

  • Tidal Haven
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to (==) Tidal Haven (Orc Shaman)
    • Actions
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Custom script: local integer A
          • Custom script: set A = 1
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) belongs to an ally of (Triggering player)) Equal to (==) True
              • Then - Actions
                • Custom script: loop
                • Custom script: exitwhen A > 5 + GetUnitAbilityLevelSwapped('TidH', GetTriggerUnit()) * 2
                • Unit Group - Add (Triggering unit) to (Last created unit group)
                • Wait 1.00 seconds
                • Special Effect - Create a special effect attached to the origin of (Picked unit) using WaterBuff.mdx
                • Special Effect - Destroy (Last created special effect)
                • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (4.00 x (Real((Level of Tidal Haven (Orc Shaman) for (Casting unit))))))
                • Custom script: set A = A + 1
                • Custom script: endloop
              • Else - Actions
  • Tidal Haven
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to (==) Tidal Haven (Orc Shaman)
    • Actions
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Custom script: local integer A
          • Custom script: local group tempgroup
          • Custom script: set A = 1
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to (==) True
              • Then - Actions
                • Custom script: loop
                • Custom script: exitwhen A > 5 + GetUnitAbilityLevelSwapped('TidH', GetTriggerUnit()) * 2
                • Unit Group - Add (Casting unit) to (Last created unit group)
                • Special Effect - Create a special effect attached to the origin of (Picked unit) using WaterBuff.mdx
                • Wait 1.00 seconds
                • Custom script: call SetUnitLifeBJ( GetEnumUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetEnumUnit()) + 2.00 + ( 4.00 * I2R(GetUnitAbilityLevelSwapped('TidH', GetSpellAbilityUnit())) ) ) )
                • Special Effect - Destroy (Last created special effect)
                • Custom script: set A = A + 1
                • Custom script: endloop
                • Custom script: set A = 0
              • Else - Actions
Another thing I'm wondering. How do you stop the spell from working if the channeling is broken? As well, how do I make it pick every unit with 400 range of the target point or unit instead of the caster?

Thanks much :D
 
Last edited:
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • ((Picked unit) belongs to an ally of (Triggering player)) Equal to (==) True
Should change to
  • ((Picked unit) belongs to an ally of (Owner of (Triggering Unit))) Equal to (==) True
For the range picking question: Pick the units in range like you did with 'Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit))) and do (Actions)', place them in a unit group TempGroup, and then remove the caster from TempGroup. Now instead of checking the picked units, you check the units in TempGroup :wink:
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Thanks Avator! However, it only solved half the problem.

The loop isn't looping properly. Instead, he begins channeling, and no one gets healed. Then, the special effect doesn't dissappear, and becomes permanent. I think everything past the Wait 1.00 doesn't work properly. I don't know why either. It's so odd.

Also, I tried doing the tempgroup thing you suggested, but I don't think I understood you correctly, and I did it wrong. The hero seems to move to the targeted point too when he casts.
 
Last edited:
Level 5
Joined
Jan 6, 2006
Messages
106
Thanks Avator! However, it only solved half the problem.

The loop isn't looping properly. Instead, he begins channeling, and no one gets healed. Then, the special effect doesn't dissappear, and becomes permanent. I think everything past the Wait 1.00 doesn't work properly. I don't know why either. It's so odd.

Yes. It is exactly the Wait function that causes this. Your trigger makes it that it will heal only one unit every second, and using "Wait" functions for destroying special effects are a no-no. Instead of using loops, try to put everything in a looping trigger or timer-activated trigger, and create another trigger for destroying special effects. Since you're better at JASS than GUI these shouldn't be a problem for you.

Hope this helps. :)
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
It is indeed the wait function that is causing the issue. However, without the wait function the graphics do not display on the effected units, and the effect is burst, not DoT, which isn't what I want.

I still have the issue of if the channel is broken the effect still persists.

I don't understand what you're trying to tell me to do here. Create a WHOLE nother trigger just for the sake of playing a single animation and have it set up all over again, activated by this trigger? That seems like a whole lot of extra work.

When you say put something in a looping trigger, wouldn't I still be using loops? So how is that different?

Or do you mean instead of putting all this in one function, to seperate it into two functions, and call the function from the first trigger? If I understand you correctly, I'll make the update and show you what I think you mean.
 
Last edited:
Level 15
Joined
Dec 18, 2007
Messages
1,098
Actually, I believe locals bug if used in GUI together with a wait function.
Anyway, there is also another bug, I believe you should put the loop and wait outside the unitgroup. The way you are making the spell now, the trigger first does the loop and damage for a unit until the loop is fulfiled and then loop for the other units.
 
Level 5
Joined
Jan 6, 2006
Messages
106
It is indeed the wait function that is causing the issue. However, without the wait function the graphics do not display on the effected units, and the effect is burst, not DoT, which isn't what I want.

I still have the issue of if the channel is broken the effect still persists.

I don't understand what you're trying to tell me to do here. Create a WHOLE nother trigger just for the sake of playing a single animation and have it set up all over again, activated by this trigger? That seems like a whole lot of extra work.

When you say put something in a looping trigger, wouldn't I still be using loops? So how is that different?

Or do you mean instead of putting all this in one function, to seperate it into two functions, and call the function from the first trigger? If I understand you correctly, I'll make the update and show you what I think you mean.

Well, it really isn't much work in JASS, but I almost forgot how much work it involved when I was still scripting in GUI, sorry for that.

Yes, you got it. It's just bringing the special effects into a single function and use timers or periodic events to trigger it. And no, you won't be using the "For loop integer A from x to y" that sort of thing, it'll just be the periodic events or timers that are causing the loop. I generally prefer this way is to avoid the potentially unwanted effects caused by "Wait" functions.
 
Level 6
Joined
Mar 15, 2005
Messages
112
  • Periodic Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Custom script: local integer i
      • Custom script: set i = i + 1
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (i) Equal to (==) 100
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions
Heres a small example of a periodic loop. The If Then Else is your exitwhen. Periodics can be much faster then a wait function. I've heard waits can only be as fast as .27. Periodics can be as fast as .01 I think. Which can lead to more fluid effects. If you don't use a wait inside a regular loop it can run through it instantly. Hope this helped. Will post something better if you'd like. Edit: Dunno if you can use locals in this. They might forget what i equals. Might have to use a global variable for i. Edit#2: Think you only have problems with waits if your using globals. If those globals are referred to after the wait. Someone else could cast the spell during that wait and change the variable.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Okay, after hopefully fixing up this spell, here is the new result. I decided to go with dummy casters instead.

  • Tidal Haven
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Tidal Haven
    • Actions
      • Custom script: local integer A
      • Custom script: set A = 1
      • Custom script: loop
      • Custom script: exitwhen A > 5 + GetUnitAbilityLevelSwapped('TidH', GetTriggerUnit()) * 2
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Custom script: local effect effect1
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to (==) True
              • Then - Actions
                • Unit Group - Add (Casting unit) to (Last created unit group)
                • Unit - Create 1 caster for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing (Position of (Casting unit))
                • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                • Unit - Add Rejuvinating Waters to (Last created unit)
                • Unit - Set level of Rejuvinating Waters for (Last created unit) to (Level of Tidal Haven for (Triggering unit))
                • Unit - Order (Last created unit) to Human Priest - Heal (Picked unit)
                • Wait 1.00 seconds
              • Else - Actions
      • Custom script: set A = A + 1
      • Custom script: endloop
It's once again ignoring the wait command though and not repeating. Otherwise, everything on it is fine.

Also I need to turn this MUI/MPI. What parts of it would cause it not to be and how should I resolve it?
 
Last edited:
Status
Not open for further replies.
Top