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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. 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.

Triggered Spells that deal damage Problem

Discussion in 'World Editor Help Zone' started by Impereal Gardian, Jun 16, 2014.

  1. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    I'll try to keep it simple, what I have here is a trigger that deals damage to a target.

    • Stat Based Spell Template
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to My Ability
      • Actions
        • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) + 1.00) damage of attack type Spells and damage type Normal


    NOTE: This action is one that uses my Attributes to deal bonus damage, but this relates to any "Unit - Cause (Triggering unit) to damage (Target unit of ability being cast)" type of trigger.

    What my problem is, is that when i go to cast a spell it deals the damage on two occasions. In this case, my spell does 60 damage once the missile hits. The problem is, the triggered action goes off instantly.

    (Example Problem: I can go to cast a spell and cancel it instantly, and they will still take the trigger-damage. This means i can cast-cancel infinite times without actually doing the ability and still deal trigger damage.)

    Is there a fix for this, a way to make the trigger damage happen once the spell missile hits?
     
  2. dr4g0nblade

    dr4g0nblade

    Joined:
    Jan 2, 2013
    Messages:
    16
    Resources:
    0
    Resources:
    0
    Try to use the event:
    • Unit - A unit Finishes casting an ability
     
  3. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    If I do that, then the trigger damage never goes off.
     
  4. dr4g0nblade

    dr4g0nblade

    Joined:
    Jan 2, 2013
    Messages:
    16
    Resources:
    0
    Resources:
    0
    The problem is that Finishes casting an ability doesn't have a target unit(i think).
    You can use 2 triggers:
    • Trigger 001
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Channel
      • Actions
        • Set targeted = (Target unit of ability being cast)

    • Untitled Trigger 001
      • Events
        • Unit - A unit Finishes casting an ability
      • Conditions
        • (Ability being cast) Equal to Channel
      • Actions
        • Unit - Cause (Casting unit) to damage targeted, dealing 500.00 damage of attack type Spells and damage type Normal
     
  5. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    sorta new, what Variable is that? Unit?
     
  6. dr4g0nblade

    dr4g0nblade

    Joined:
    Jan 2, 2013
    Messages:
    16
    Resources:
    0
    Resources:
    0
  7. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Well the best way is to trigger the whole thing.
    By using a dummy unit as missile and a periodic trigger to move the missile + checking if a unit is in range or the missile has reached it's max range.

    If you use "Finishes casting an ability" you will lose a whole lot of data which cannot be used to calculate damage among other things.

    In the case of "Finishes casting an ability" you will need a second trigger which checks for "Starts the effect of an ability" or "Begins casting an ability".

    Triggering the whole thing is the best way to do it. But also a bit harder. Especially if it needs to be mui.
     
  8. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    It didn't seem to work this time either
     
  9. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    Oh, I probably shouldn't go that far into that stuff. I guess ill just have to deal with it for the time being :3
     
  10. Solu9

    Solu9

    Joined:
    Jan 25, 2011
    Messages:
    2,165
    Resources:
    47
    Models:
    26
    Icons:
    16
    Skins:
    1
    Tools:
    1
    Maps:
    3
    Resources:
    47
    Why not? Eventually you will need to learn how to do it.
    Especially if you at some point want to create more complex abilities.
     
  11. elm0

    elm0

    Joined:
    Jan 23, 2014
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Dont give up! It's really hard at first, but once you get the hang of it, it'll be like adding 1 + 1.

    You can use a timer for that. Just count how many seconds it is for the missile to reach the target and then.
    Add this in your actions.
    Action
    Countdown timer - start MyTimer as a one-shot timer for 1 second(for example)

    And then create another trigger.
    Event
    MyTimer expires
    Condition
    Actions
    Countdown Timer - pause MyTimer (you should always pause a timer after it expires)
    Unit - cause (casting unit) to deal damage to ..........

    See? Its just simple. Btw put the units in a variable.
     
  12. Timo

    Timo

    Joined:
    Jan 8, 2013
    Messages:
    332
    Resources:
    0
    Resources:
    0
    well elm0 thats not a good idea. what if the enemy ports away or dashes away? then the missile needs more then the time he counted before. its even if hes far away from the target or not.

    my solution: if i get it right, you have a normal wc3 base spell with a missile. and if the missile hits the target should get bonus damage based on the attribut.

    first: you trigger the whole spell.(best thing) thats sooo easy to trigger a missile spell dude :)

    second: you make a new trigger which checks if the target gets damage.

    like:
    a unit starts the effetc of a ability
    blabla
    set Caster = triggering Unit
    set Target = Target unit of ability beeing cast
    add to dmg take the event - target gets damage.
    turn onn second trigger


    second trigger: (disabled)
    target gets damage

    Condition: Caster = damage source(but with this you can activate this trigger with normal hit or other spells thats why i should take solution one)

    Action:
    turn off trigger(becasue of infinite loop shit)
    order Caster to damage Target


    so with this he will get damage when the missile hits BUT you can also activate the dmg take trigger with normal hits or spells. or even items. so just trigger the missile :)
     
  13. elm0

    elm0

    Joined:
    Jan 23, 2014
    Messages:
    152
    Resources:
    0
    Resources:
    0
    That was just an example. But you got a point though. At least he has an idea now
     
  14. Timo

    Timo

    Joined:
    Jan 8, 2013
    Messages:
    332
    Resources:
    0
    Resources:
    0
    yeah but his idea is bad for gameplay. im no fan of timers in spells :D
    just trigger it in loops. thats all ^-^
     
  15. Impereal Gardian

    Impereal Gardian

    Joined:
    Dec 11, 2010
    Messages:
    100
    Resources:
    0
    Resources:
    0
    I'll have a look later and see if i can work with this :) thanks