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

[Spell] slowing potion change target possible?

Status
Not open for further replies.
Level 2
Joined
Mar 22, 2015
Messages
7
Hey guys, i still working on my own TD map, i am new at warcraft 3 mapping.
I have created a tower and added the spell slowing poison. My problem is that this tower just should dot and change the target. but my tower only shoots on the same target until it dies or gets out of range. is there a trigger or an other function to stop the tower attacking for a short time and target a new target?

hope you can help.
greetings from germany LiME1337 :thumbs_up:
 
Level 9
Joined
May 21, 2014
Messages
580
Hey guys, i still working on my own TD map, i am new at warcraft 3 mapping.
I have created a tower and added the spell slowing poison. My problem is that this tower just should dot and change the target. but my tower only shoots on the same target until it dies or gets out of range. is there a trigger or an other function to stop the tower attacking for a short time and target a new target?

hope you can help.
greetings from germany LiME1337 :thumbs_up:

You need to save the units within a data structure. A Unit Group will be good for this. Just store all the units that have been hit with the DOT already, then remove those units from the Unit Group when they die or when the DOT buff disappears from the unit.

I'm just not sure how you will change the target, and of how you will decide which unit that are excluded from the unit group to attack.
 
Level 2
Joined
Mar 22, 2015
Messages
7
You need to save the units within a data structure. A Unit Group will be good for this. Just store all the units that have been hit with the DOT already, then remove those units from the Unit Group when they die or when the DOT buff disappears from the unit.
can you explain this a bit more specific for noob mapper :p or link a guide?
 
Level 9
Joined
May 21, 2014
Messages
580
can you explain this a bit more specific for noob mapper :p or link a guide?

I'll leave the others to link a guide or explain for you. I'm bad at explaining, and my Internet is quite slow.

Come to think of it, I don't know how to explain the terms...
I just played around with the World Editor to learn it.

A Unit Group is basically a group of units. For example, You want to collect all the units that have 50 HP or below. Unit Groups can solve that for you, and you can do something to this unit group with an action or two easily.

You need to make a variable Unit Group.
You also need to know about Leaks.
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
This tutorial is about leaks (I have it bookmarked which is why I can give you the link.)
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I have a system that does just this. It's across multiple triggers, but here's the important part:

  • Auto Micro Debuff
    • Events
    • Conditions
    • Actions
      • Set loc1 = (Position of uattacking)
      • Set group1 = (Units within r of loc1)
      • Unit Group - Pick every unit in group1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Picked unit)) Not equal to Player 12 (Brown)
                  • ((Picked unit) is dead) Equal to True
                  • ((Picked unit) has buff testbuff) Equal to True
            • Then - Actions
              • Unit Group - Remove (Picked unit) from group1
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in group1) Greater than or equal to 1
        • Then - Actions
          • Set uattacked = (Random unit from group1)
          • Unit - Order uattacking to Attack uattacked
        • Else - Actions
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call DestroyGroup(udg_group1)
For the event, use "unit is attacked".

uattacking = event response - attacking unit
r = tower's range. In another part of the system I search an array of all tower types where I saved each tower's range. You could also the function "unit acquisition range" if your tower's acquisition range and attack range are the same.
testbuff = the slow poison buff. I also grab this from the array mentioned above, it's important if you are going to have multiple towers with multiple debuffs. If you just have one poison buff you could just check for it directly.

If you'd like, I could package this trigger in a way that would be easy to import into your map.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Notes:
Set the tower's range and the poison ability buff in the Auto Micro Setup trigger.
You can add your own filtering options in this part of the trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Owner of uattacking) is an enemy of (Owner of (Picked unit))) Equal to False
          • ((Picked unit) is dead) Equal to True
          • ((Picked unit) has buff AutoMicroBuff) Equal to True
    • Then - Actions
      • Unit Group - Remove (Picked unit) from group1
    • Else - Actions
Feel free to ask here or in PM if you have further questions.
 

Attachments

  • AutoMicroPoisonTower.w3x
    19.8 KB · Views: 39
Status
Not open for further replies.
Top