Two point target abilty

Level 5
Joined
Oct 2, 2013
Messages
95
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!
 
Level 11
Joined
Dec 19, 2012
Messages
411
  • 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:
Level 4
Joined
Jan 5, 2014
Messages
79
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.
 
Level 5
Joined
Oct 2, 2013
Messages
95
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.
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
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.
 

Attachments

  • Dragon.w3x
    19.1 KB · Views: 38
Last edited:
Level 11
Joined
Dec 19, 2012
Messages
411
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.

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
 
Level 5
Joined
Oct 2, 2013
Messages
95
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!
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
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.
 
Level 23
Joined
Mar 15, 2012
Messages
2,664
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.
 

Attachments

  • ActionMapTest_optimized.w3x
    152.4 KB · Views: 36
Top