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.

Two point target abilty

Discussion in 'World Editor Help Zone' started by esdo, Mar 12, 2014.

  1. esdo

    esdo

    Joined:
    Oct 2, 2013
    Messages:
    89
    Resources:
    0
    Resources:
    0
    I want to make a spell called "Tactical Dragonfire", where the player will press the spell button, choose point A, and the choose point B. After a few seconds, fire will fall from the skies, drawing a line that crosses points A and B, going from A to B.

    I think i can make that, but it would use two spells, and that wouldn't look so good. How can i make a two target point spell??

    Thanks!
     
  2. DD_legionTN

    DD_legionTN

    Joined:
    Dec 19, 2012
    Messages:
    411
    Resources:
    0
    Resources:
    0
    Trigger
    • Trigger
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Ability being cast) Equal to someAbility1
            • (Ability being cast) Equal to someAbility2
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • boolean[0] Equal to True
          • Then - Actions
            • Set P[0] = (Target point of ability being cast)
            • Unit - Add someAbility2 to (Triggering unit)
            • Wait 0.00 seconds
            • -------- the someAbility2's hotkey is Q --------
            • Game - Force Player 1 (Red) to press the key Q
            • Set boolean[0] = False
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • boolean[1] Equal to True
              • Then - Actions
                • Unit - Remove someAbility2 from (Triggering unit)
                • Set P[1] = (Target point of ability being cast)
                • Trigger - Run OtherTrigger <gen> (ignoring conditions)
                • Set boolean[1] = False
              • Else - Actions


    Note that this trigger isnt MUI,if unit canceled ability whn casted point 1 and before cast point 2,u will need another trigger to reset it.
     
    Last edited: Mar 14, 2014
  3. _MB_

    _MB_

    Joined:
    Jan 5, 2014
    Messages:
    79
    Resources:
    0
    Resources:
    0
    And you have to reset the booleans before another instance of the whole spell is cast, but othervise i think the trigger is good. You could use a spell with blank icon so noone will see it on the unit panel.
     
  4. esdo

    esdo

    Joined:
    Oct 2, 2013
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Ok now.. what if the players cancel the spell after if has already pressed Q once, but has not set the second point? I know what to do but i would need an "Event - Player Right Clicks" for that. Or is there any other way? I want it so that when player cancels the ability after already setting point 1 ( spell #2 ) he will get spell 1 back, no cooldowns.
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,802
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    its possible but I think its too advanced to bother with. Unless you want a DC map or something.
     
  6. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    It's been ages since I've done much with the editor, but unfortunately if I recall correctly this isn't really practical.
     
  7. esdo

    esdo

    Joined:
    Oct 2, 2013
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Well then, there should be other method with using 2 point targets.

    Or any way to detect spell cancellation??
     
  8. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    I'll make an example and post it here in about 20 minutes.

    My first idea is creating a summon on the first casting point (Point A); and inmediatly select it. The first order direction you give to that summon will be the direction the Point B.

    My second idea is creating a special effect at Point A, remove "Dragon A" ability, and add "Dragon B" ability. Once dragon B is cast on the next point, the attack will take place on that direction.

    This is the 2nd (without the damage part). it's MPI (not MUI), and, I think, leakless. I just created at special effect at Casting Point A, and another at 500 distance towards Casting Point B. The damage and other effects should just be placed where the BJDebugMsg is.
     

    Attached Files:

    Last edited: Mar 13, 2014
  9. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    I think the problem here is that, whether a player has a spell on a targeting image or not, is all local. Because of this, it's impossible to detect, without manipulation of "Force UI Key", which can be abused easily from the delay on battle.net.
     
  10. DD_legionTN

    DD_legionTN

    Joined:
    Dec 19, 2012
    Messages:
    411
    Resources:
    0
    Resources:
    0
    player could cancel it by pressing esc or clicking cancel button neither right click,pressed esc can be detected easily. The problem is how if a player pressed cancel button or right lick?I have no idea how to detect a player pressed cancel button ( since there is no event to detect player pressed a button ). Another problem is when player right click will cancelled the ability while setting the 2nd ability point, there is no issue order since there is no targeted point/object/order.

    I think Spartipilo's demo map would be suit for you :D
     
  11. esdo

    esdo

    Joined:
    Oct 2, 2013
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Yeap, the way I did was exactly like Spartipilo did. Slightly different:

    I created an unit on point A, facing point B and set an var called FIRE. So i order the dummy at point A to cast Flame Stike on a point with polar offset ( 100 x FIRE ) heading at point B, and then set FIRE = FIRE +1. So each time it casts, the strike will be further away and it look AWESOME. Just like i wanted it.

    But that's not the problem. What i can't do is detect if the player didn't want to cast the spell so that he cancelled it.

    I guess I'll do it timed, just like Spartipilo.

    Thanks!
     
  12. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,479
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Only way for what you want is timed or Key manipulation unless you know some JASS/coding then Sharpcraft would be an option too.
     
  13. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    I could add a "Esc" function to cancel the spell if you used Target A and you want to replace it, and make the eability easily configurable, that was just a demo. When the desired effect is achieved I can clean up everything in the code.

    If it's placed inside a spellbook I can add a Cancel button. Or if you have free slots in the unit I can add it around there.
     
  14. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,234
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
  15. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,479
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Sorry I am a bit late however I forgot about two maps that actually achieved this which was Anitarf's demo as well ToadCop's epic TcX map. I totally forgot which sucks. . . sorry.

    Demo map fully belongs to Anitarf.

    Anitarf and ToadCop figured out how to detect right-click without trackables, I am sure it was thanks to key manipulation and a dummy ability every so often.
     

    Attached Files: