• 🏆 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!

Repair / Renew - simple way of adding continuous target-effect?

Status
Not open for further replies.
Level 2
Joined
Aug 18, 2019
Messages
8
Hi all,

does anyone know if there's an easy way to show a continuous effect on the repaired target?
Sounds like a simple task, however I couldn't find anything (except for adding an effect to the start of the cast - so, one time only).

I'm moving onto triggering this whole thing now, but making it MUI is kinda easier said than done due to inexperience (and I'd prefer not to trigger a simple target-effect if there's another way ...).

Best
Solemin
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
Repair/Renew don't apply a buff otherwise you could use one. I think you'll have to trigger it.

That being said, MUI can be very easy using a Unit Indexer. Check out the map I uploaded it has two examples for creating continuous special effects for Channeled abilities like Renew.

Buff: Enable and use the Buff triggers for Buff-like effects. In this case the Special Effect should have a Stand animation. Obviously any Special Effect under the Buff category will work. But not all of the Ability Special Effects will work as some of them only play their animation once.

Loop: Enable and use the Loop triggers for Special Effects that don't work as Buffs. Ones like "Abolish Magic" that play their animation only once.

Make sure that if you Enable the Buff triggers that you disable the Loop triggers and vice versa.

  • Cast Renew Buff
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Renew
    • Actions
      • Set VariableSet Caster_CV = (Custom value of (Triggering unit))
      • Set VariableSet Target_CV = (Custom value of (Target unit of ability being cast))
      • -------- - --------
      • Set VariableSet Renew_Target[Caster_CV] = (Target unit of ability being cast)
      • Set VariableSet Renew_Count[Target_CV] = (Renew_Count[Target_CV] + 1)
      • -------- - --------
      • -------- This is done to prevent the creation of multiple Special Effects on the same unit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Renew_Count[Target_CV] Equal to 1
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Create Sfx
          • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Other\Drain\ManaDrainCaster.mdl
          • Set VariableSet Renew_Sfx[Target_CV] = (Last created special effect)
        • Else - Actions
  • Stop Renew Buff
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Renew
    • Actions
      • Set VariableSet Caster_CV = (Custom value of (Triggering unit))
      • Set VariableSet Target_CV = (Custom value of Renew_Target[Caster_CV])
      • -------- - --------
      • Set VariableSet Renew_Count[Target_CV] = (Renew_Count[Target_CV] - 1)
      • -------- - --------
      • -------- If there are no units casting Renew on the target then we can destroy the sfx --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Renew_Count[Target_CV] Equal to 0
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Destroy Sfx
          • Special Effect - Destroy Renew_Sfx[Target_CV]
        • Else - Actions
  • Cast Renew Loop
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Renew
    • Actions
      • -------- Get both the Caster and the Target's custom value - This is how you use a Unit Indexer --------
      • Set VariableSet Caster_CV = (Custom value of (Triggering unit))
      • Set VariableSet Target_CV = (Custom value of (Target unit of ability being cast))
      • -------- - --------
      • -------- Save the Target to the Caster - Now we can always reference the Target as long as we can reference the Caster --------
      • Set VariableSet Renew_Target[Caster_CV] = (Target unit of ability being cast)
      • -------- - --------
      • -------- Increase the number of unit's casting Renew on the Target by 1 --------
      • Set VariableSet Renew_Count[Target_CV] = (Renew_Count[Target_CV] + 1)
      • -------- - --------
      • -------- Add the Target to the Renew Unit Group if it isn't already in it - Units in this Unit Group will have a Special Effect created on them periodically --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in Renew_Group.) Equal to False
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Add to Group
          • Unit Group - Add (Target unit of ability being cast) to Renew_Group
        • Else - Actions
      • -------- - --------
      • -------- Turn on the Renew Timer if it's off - It's important to turn off timers when they're not in use --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Renew Timer Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Renew Timer Loop <gen>
        • Else - Actions
  • Stop Renew Loop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Renew
    • Actions
      • -------- Get both the Caster and the Target's custom value - Remember we Saved the Target to the Caster so we can reference the Target like so --------
      • Set VariableSet Caster_CV = (Custom value of (Triggering unit))
      • Set VariableSet Target_CV = (Custom value of Renew_Target[Caster_CV])
      • -------- - --------
      • -------- Reduce the number of unit's casting Renew on the Target by 1 --------
      • Set VariableSet Renew_Count[Target_CV] = (Renew_Count[Target_CV] - 1)
      • -------- - --------
      • -------- If there are no units casting Renew on the target then we can remove the Target from the Renew Unit Group --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Renew_Count[Target_CV] Equal to 0
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: Remove from Group
          • Unit Group - Remove Renew_Target[Caster_CV] from Renew_Group.
        • Else - Actions
  • Renew Timer Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Renew_Group and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • -------- - --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Renew_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

Just edit the Special Effects to be the ones you want. Also, you can delete the "Display Text Message" stuff, I used that for testing purposes.
 

Attachments

  • Renew Sfx v.2.w3m
    24.5 KB · Views: 18
Last edited:
Level 2
Joined
Aug 18, 2019
Messages
8
This is ... beautiful!
Way more than I asked for, saved me a huge amount of time and thanks to your comments and attached map also gave me a massive start to play around with. Thank you very much!

Works as expected now.
 
Status
Not open for further replies.
Top