autocast polymorph

malfy

New Member
Reaction score
4
I'm trying to make this spell... so far I have created a dummy unit at the center of my map with the ability polymorph. I have modified polymorph so that its range is 9999 cooldown 0 mana cost 0 upgrades 0. Then I used a modified version of the spell 'slow' for the autocast effect. This spell places a custom buff on the target called 'polymorphizm.' In order to cast polymorph on these buffed units I use the following trigger:
Trigger:
  • autopoly
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Polymorphizm ) Equal to True
            • Then - Actions
              • Unit - Order morph_dummy to Human Sorceress - Polymorph (Picked unit)
            • Else - Actions
              • Do nothing


It does not work and I have tried many other variations of basically these same actions with no success. The enemy units are receiving the 'polymorphizm' buff but they aren't getting polymorphed by the dummy unit (which is owned by the same player as the unit autocasting the buff). any idea why this is not working?
 

Laiev

Hey Listen!!
Reaction score
188
Trigger:
  • autopoly
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • ---- (Units in (Playable map area)) = leak ----
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Polymorphizm ) Equal to True
              • ---- Who give this buff? How the enemy get it? ----
            • Then - Actions
              • Unit - Order morph_dummy to Human Sorceress - Polymorph (Picked unit)
              • ---- What is 'morph_dummy', where's the set? ----
            • Else - Actions
              • Do nothing
              • ---- Remove this, you don't need this ----



Show us the learn trigger or cast trigger....
 

cryowraith

New Member
Reaction score
7
I think you are making things complicated. Instead of using 1 sec event, try something like this.

Event
A unit finishes casting slow (or whatever dummy autocast ability).
Action
Create a dummy unit. Give it polymorph. Order unit to polymorph Targeted Unit?
 

crazyfanatic

New Member
Reaction score
20
Finishes casting is not the best event, its more useful if the skill is channeling. Use starts the effect of an ability.
 

Laiev

Hey Listen!!
Reaction score
188
He need 'finish ability', because it check if has buff, so may (and will) bug if 'start effect of an ability'
 

rafaxik

New Member
Reaction score
2
He need 'finish ability', because it check if has buff, so may (and will) bug if 'start effect of an ability'

That's correct! I think you should create a trigger to check buff and if so, you order the dummy (don't forget to add ability to it in the object editor) to polymorph. And I think you won't get the autocast polymorph with a spell based on slow cause it has another order/string activate.

Here's what you shall try:

Trigger:
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • ((Picked unit) has buff Polymorphizm ) Equal to True
    • Then - Actions
    • ---YOU MUST CREATE A DUMMY UNIT BEFORE---
    • Unit - Create 1 morph_dummy to Neutral Hostile at ((Position of (Picked Unit)) facing Default facing degrees
    • Unit - Order Last created unit to Human Sorceress - Polymorph (Picked unit)
    • Else - Actions
    • Do nothing
    • --- you really don't need this ^^ ---
 

millz-

New Member
Reaction score
25
Why don't you just use: Unit starts effect of an ability, if Ability being cast equal to your_custom_slow, create a dummy with the polymorph ability, order it to cast on the target unit of ability cast?
 

malfy

New Member
Reaction score
4
Trigger:
  • autopoly
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • ---- (Units in (Playable map area)) = leak ----
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Polymorphizm ) Equal to True
              • ---- Who give this buff? How the enemy get it? ----
            • Then - Actions
              • Unit - Order morph_dummy to Human Sorceress - Polymorph (Picked unit)
              • ---- What is 'morph_dummy', where's the set? ----
            • Else - Actions
              • Do nothing
              • ---- Remove this, you don't need this ----



Show us the learn trigger or cast trigger....

what learn / cast triggers? listen people maybe I didn't make this clear in the first post but I have been trying to accomplish this using VARIOUS combinations of essentially the same code. For example my ORIGINAL trigger looked like this:

Trigger:
  • autopolyorg
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Polymorph
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) has buff Polymorphizm ) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 dummymorph for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Polymorph to (Last created unit)
          • Unit - Set level of Polymorph for (Last created unit) to 1
          • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
          • Game - Display to (All players) the text: (picked unit: + (Name of (Picked unit)))


which of course did not work either so I began changing things up. (by the way if there is any dispute wether 'begins casting an ability' is the right action to choose or not; the text message DOES display the 'picked units' name they just arent polymorphed.)

Now after the original trigger did not work I began changing things to the trigger I posted first in order to, in my opinion, simplify everything. The dummy unit has already been given the unit skill polymorph in the wc3 editor. (polymorph is modified 0 mana, 99999 cast, etc.) The dummy unit is already placed in the center of my map, from the wc3 editor. The unit variable 'morph_dummy' is assigned that dummy unit upon map initialization.

As far as how does the enemy get the polymorphizm buff? I modified the autocast slow skill so that it will cast my custom buff called 'polymorphizm' without any of the slow effects. The modified autocast slow is called 'Polymorph' but it is a hero ability, so its easy not to confuse it with the unit polymorph used by my dummy. Anyway I think I already mentioned this in the first post and this part is working properly. (distributing my custom buff)

I feel like my 'game message' from the original trigger shows that for the most part everything seems to be working other than the actual 'picked unit' having polymorph cast on them.
 

Ayanami

칼리
Reaction score
288
Check if your dummy polymorph costs mana. By the way, this line leaks.

Trigger:
  • Actions
    • Unit - Create 1 dummymorph for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees


Not sure if you did that on purpose.
 

malfy

New Member
Reaction score
4
well as I have mentioned in BOTH of my previous posts, polymorph costs 0 mana, has maximum cast range, and requires no upgrades.

as far as leaks go, thats really of no concern right now because that is not the reason the trigger does not function properly, I can remove any/all leaks later

as my dummy unit "dummymorph" is owned by player1 red I turned its mdl file back on and made it selectable so that I could manually test the polymorph cast.

I went into the game manually selected the dummyunit clicked on polymorph then clicked on a creep. the polymorph was successful. Next, I allowed my hero to go in and autocast the buff 'polymorphizm' on several creeps. With the buff in place I manually polymorphed the creeps successfully again.
 

Ayanami

칼리
Reaction score
288
Ah now I see the problem. Auto-cast does not trigger the event "Begins casting an ability" nor "Starts the effect of an ability". So I suggest periodically checking for the dummy buff and then polymorphing the unit. I see that you have done this on your first both. However, in the first post, you said you use a preplaced unit. Are you sure you're ordering the pre-placed unit? Normally all pre-placed units should have a <gen> behind their name.
 

malfy

New Member
Reaction score
4
In the first trigger my order is as such:
Trigger:
  • Unit - Order morph_dummy to Human Sorceress - Polymorph (Picked unit)


morph_dummy is a unit variable assigned to my preplaced dummy unit at map initialization
 

malfy

New Member
Reaction score
4
here is a blank map with the trigger, buff, dummy, etc. setup the same as I've been discussing, it does not work on this map either but it might help
 

Attachments

  • autopoly.w3x
    17.7 KB · Views: 187

Ayanami

칼리
Reaction score
288
Worked after changing this line:

Trigger:
  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) has buff Polymorphizm ) Equal to True)) and do (Unit - Order visible_dummy 0012 &lt;gen&gt; to Human Sorceress - Polymorph (Picked unit))


to this:

Trigger:
  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Polymorphizm ) Equal to True)) and do (Unit - Order visible_dummy 0012 &lt;gen&gt; to Human Sorceress - Polymorph (Picked unit))
 

kingkwong92

Well-Known Member
Reaction score
25
To make it leakless.

Set poly_group=Units in playable map matching(matching unit has poly buff equal to true)

Pick every unit in poly_group and do

Custon script:call DestroyGroup(udg_poly_group)

Also
Custom script:call RemoveLocation(udg_<your_point_variables>)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top