1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  4. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  5. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  6. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  7. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  8. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Shadow Strike Based Spell

Discussion in 'World Editor Help Zone' started by rkemsley, Sep 25, 2018.

  1. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    I've created a single targeted damaging nuke using Shadow Strike as a base. I wanted to have the damage triggered, so the little pop up in game wouldn't appear when it hits.

    For the most part, the trigger works (scaling hero spell):

    • FireballBaseDamage
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Fireball
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Fireball for (Triggering unit)) Equal to 1
          • Then - Actions
            • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
            • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 90.00 damage of attack type Spells and damage type Normal
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Level of Fireball for (Triggering unit)) Equal to 2
              • Then - Actions
                • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
                • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 120.00 damage of attack type Spells and damage type Normal
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Level of Fireball for (Triggering unit)) Equal to 3
                  • Then - Actions
                    • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
                    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 150.00 damage of attack type Spells and damage type Normal
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Level of Fireball for (Triggering unit)) Equal to 4
                      • Then - Actions
                        • Wait until (((Target unit of ability being cast) has buff Fireball (Data Trigger)) Equal to True), checking every 0.10 seconds
                        • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 180.00 damage of attack type Spells and damage type Normal
                      • Else - Actions


    Imgur <Ability>

    However, if I try to run away after the projectile is in the air, or if I'm at a certain distance from the target, the damage doesn't register.

    Please help
     
    Last edited: Sep 26, 2018
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,810
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Why can't you use Acid Bomb or Chain Lightning as a base spell instead? Those are projectile-based damage spells that don't show damage numbers and don't have un-removable secondary effects like stun, silence, etc. (CL can have its lightning effect removed). If your hero already has a spell based on one of those you can use Channel ('ANcl') to make a dummy ability and cast the real ability with a dummy unit. The last line cleans a leak.

    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to YOUR_DUMMY_HERO_ABILITY
    • Actions
      • Set Point1 = Position of (Triggering Unit)
      • Unit - Create one DUMMY_UNIT for (Owner of (Triggering Unit)) at Point1 facing Default building facing degrees
      • Unit - Add a 2.00 generic expiration timer to (Last created unit)
      • Unit - Add YOUR_AB_OR_CL_ABILITY to (Last created unit)
      • Unit - Set level of YOUR_AB_OR_CL_ABILITY for (last created unit) to (Level of YOUR_DUMMY_HERO_ABILITY for (Triggering Unit))
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Target unit of ability being cast) //or Orc Far Seer - Chain Lightning
      • Custom script: call RemoveLocation(udg_Point1) //change this to match the name of your point variable, but keep the udg_ prefix


    About your trigger itself: you can reduce the nested if-statements boogaloo in two different ways.
    1. Find a formula that computes the damage given any level of the spell. In your case it is:
      DMG = 60 + 30*LVL
      • Unit - Cause <unit> to damage <unit>, dealing (60.00 + (30.00 x (Level of <spell> for <unit>))) damage of attack type Spells and damage type Normal

    2. Define damage values in an array that you set on map init, with index [N] giving you the damage for that level of the spell. This works best when the damage doesn't have a simple scaling formula or is in some way weirdly calculated.
      • -------- In a map initialization trigger --------
      • Set FB_DMG[1] = 90.00
      • Set FB_DMG[2] = 120.00
      • Set FB_DMG[3] = 150.00
      • Set FB_DMG[4] = 180.00
      • -------- In your spellcast trigger --------
      • Unit - Cause <unit> to damage <unit>, dealing FB_DMG[(Level of <spell> for <unit>)] damage of attack type Spells and damage type Normal
    Also waits are bad and will inevitably eventually break your spellcasting triggers. Many event responses like "Attacking unit" will not return the correct unit (or any unit at all) after a wait. There is a minimum wait duration of 0.27 seconds (defined in the internal Blizzard.j library) so your check actually doesn't happen every 0.10 seconds. In general I would advise against using the Wait or Wait until... actions in spellcast triggers unless you know 100% that only one unit at a time can ever cast the spell. Here's the best tutorial on waits I could find in the tutorials section: MUI Triggers with Waits

    Instead of taking screenshots of your triggers you can right click them on their name (where it says FireballBaseDamage) and select "copy as text", then paste here between [trigger][/trigger] tags.
     
    Last edited: Sep 26, 2018
  3. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    Shadow Strike works fine because you can just set the damage on hit to 0, then trigger in the damage. So the damage pop up doesn’t appear. Also, it’s the closes thing Warcraft 3 has to a single targeted nuke. If I use acid bomb, I pretty much have to do exactly the same trigger to do the damage on hit. Which seems unnecessary.

    I tried chain lighting, but you can’t change the projectile speed. So it always looks instant.

    If I lower the buff duration on Shadow Strike to like 0.1 second, I do not need to worry about unremovable buffs.

    The problem I think I have is finding a more efficient way of detecting that the spell has landed. I can’t have it do damage before the projectile has even hit.
     
    Last edited: Sep 26, 2018
  4. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    883
    Resources:
    0
    Resources:
    0
    Use a Damage Detection System, and check if the unit has the debuff from shadow strike/acid bomb depending on which base ability you use, then remove the buff. (And deal damage and anything else.)

    Damage Engine 3.8.0.0


    p.s. I didn't check the imagine links. But you can show the triggers in posts by copying the text from world editor and then doing this:

    [trigger]your trigger text[/trigger]
     
    Last edited: Sep 26, 2018
  5. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,810
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I don't know what planet you're playing this game on, but Acid Bomb only does damage when the projectile actually hits the target. For it to damage on cast woild be ludicrous! Literally every damaging spell in Wc3 works this way except for Finger of Death which explicitly has a field to delay damage and things like Fan of Knives (looks like projectile but is really an AoE effect like Thunderclap) or Starfall (uses special effects with specific durations).

    As for the benefits of using Acid Bomb over Shadow Strike: it doesn't show the green damage numbers you're trying to avoid and it doesn't have a funky damage decay fallof field that needs to be accounted for. Acid Bomb is the godsend single target/small AoE unit-target 'damage and buff applier' ability.

    This is a bigger problem to solve than I think you realize. If you refuse to use AB, you will need to implement a Damage Detection System into your map and make the SS deal 1 damage (thus causing the numbers to appear again) so it actually fires the 'damaged' event the DDS adds. It's circular because short of the ability itself dealing damage there are no 'real' ways to know exactly when the spell hits its target. The closest you can get is periodically checking the target unit for a buff using a very low timeout timer (not waits or looped waits or anything like that, an actual timer the likes of which GUI generally doesn't make it easy to use)... and at that point you need to either implement some sort of data attaching to timers functionality or learn to use Dynamic Indexing (there's a tutorial on this here) in order to refer to the caster/player who should get kill credit/spell level, etc.
     
  6. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,810
    Resources:
    1
    Spells:
    1
    Resources:
    1
    DDS isn't going to fire its event if the spell deals no damage... and if the spell deals damage and applies its buff then when it should, then the DDS is unnecessary because the spell can deal its damage directly.

    [noparse] tags are your friend.
     
  7. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    I appreciate you trying to help out, but I think you may have misinterpreted what I said. Acid Bomb does tick damage, true? (Like Ogre Magi's Ignite spell, which I assume used Acid Bomb as a base). What I need is a spell that does just one instant of nuke damage upon arrival.

    I suppose I could use what is used in this spell

    From: [Spell] - Some help with Corrosive Bolt

    But you said you didn't really like the "wait" action.
     
  8. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    883
    Resources:
    0
    Resources:
    0
    @rkemsley the wait there is because you don't know how long it will take before the projectile hits, so in the other thread one suggestion was to add a wait based on roughly how long it would usually take for the projectile to arrive, and then deal damage.


    However, as it turns out you only need to deal a certain amount of damage based on ability level, which can be accomplished with the basic spells of the object editor and doesn't require any trigger at all.

    As I didn't fully understand at first, you mentioned that the only reason you want to use trigger is to avoid having shadow strike show the damage floating text.

    So in other words you don't need any trigger at all, since acid bomb can do what you want without the floating text.
     
  9. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,810
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Oh you're right I didn't realize that is what you meant you wanted to avoid. However, Acid bomb has a Data - Damage Interval field that controls how often it deals damage. The first tick (Data - Primary Damage per tick) always happens when the projectile hits and then once every Damage Interval after that. If the DI is equal to or divides evenly into Stats - Duration the spell doesn't deal damage simultaneously with the buff expiring at the end. Example:

    Data - Damage Interval = 1.00
    Data - Primary Damage = 50.00
    Data - Secondary Damage = 0.00 (this is the aoe damage)
    Stats - Duration - Hero = 1.00
    Stats - Duration - Unit = 1.00

    Result: 50 damage is dealt on impact and the buff stays visible for 1 second but the unit doesn't take any additional periodic damage.
     
  10. Acutesharpness

    Acutesharpness

    Joined:
    Aug 14, 2007
    Messages:
    925
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Alright I think I get what the OP is trying to say, the reason why the wait did not work is due to what Pyrogasm had mentioned where when the trigger variable "Target Unit of Ability Cast" times out very quickly as blizzard GUI system does not support MUI, since the suggestions were not accepted I want to give my own version of suggestion.

    @rkenskey If you still insist on using shadow strike over Acid Bomb just for fun, you might want to use a timer and unit variable like what a normal GUI coder would do, with that you need two triggers. First Trigger is the spell cast detector which you already have and the second trigger being the Timer trigger with event of Periodic every 0.5 second of the game. When the player cast a spell, the first trigger fires and register the target as a unit variable and caster as a unit variable then turns on the second trigger which should be initially turned off. This will activate the timer which checks for the buff of the targeted unit, when that happens you can also use real variable to do a static timer stack which can expire, when it does then turn off second trigger to avoid system slow down.
     
  11. Light

    Light

    Joined:
    Apr 23, 2011
    Messages:
    491
    Resources:
    0
    Resources:
    0
    Not MUI.

    I don't see why it's such a hassle to switch to Acid Bomb in the first place.
     
  12. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,266
    Resources:
    16
    Tools:
    2
    Maps:
    2
    Spells:
    7
    Tutorials:
    4
    JASS:
    1
    Resources:
    16
    Maybe old warcraft 3 version -> Buff coliding/overwritting.

    Edit: If you set the duration of acid bomb to 0.02 it only deals once damage.