Help me please with this polymorph trigger

CBBPhoenix

New Member
Reaction score
1
Hi everyone. I have had this trigger suggested in another thread, and I was given a map which proved that the trigger works. However it does sometimes not work in the example map I had. in my own map it never works :(. Can anyone tell me what is wrong with it?

It should cause units affacted by the spell to turn into sheep, in an AoE.

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Multi Polymorph
      • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set MP_Caster = (Casting unit)
      • Set MP_casterpoint = (Position of MP_Caster)
      • Set MP_TargetGroup = (Units within 680.00 of (Target point of ability being cast) matching ((((Matching unit) belongs to an ally of (Owner of MP_Caster)) Equal to False) and (((Matching unit) is dead) Equal to False)))
      • Unit Group - Pick every unit in MP_TargetGroup and do (Actions)
        • Loop - Actions
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 for (Owner of MP_Caster) at MP_TargetPoint facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game

I have posted the map so you can see the triggers he suggested. It reads "Reverse Polarity" in WC3 but that's because he has edited it from the test map of that ability.

Thanks in advance.
 

Attachments

  • Multi Polymorph.w3x
    21.1 KB · Views: 194

avalya

New Member
Reaction score
37
Remove your variables after they are used, at the end of the trigger add the following;

Set MP_Caster = No unit
Custom Script: call RemoveLocation (udg_MP_casterpoint)
Custom Script: call DestroyGroup (udg_MP_TargetGroup)

also, some changes;

Set MP_Caster = Triggering Unit
Set MP_casterpoint (is that supposed to be the location of the caster or the spell target point) if Caster = Position of MP_Caster, if Target Point = Target Point of Ability Being Cast
Remove the Level of Ability Being Cast...
In the Set MB_TargetGroup action = Units within 680.00 of MP_casterpoint

at the end of the Unit Group Loop, add;

Set MP_DummyUnit = No unit
Custom Script: call RemoveLocation (udg_MP_TargetPoint)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Trigger:
  • Unit - Create 1 for (Owner of MP_Caster) at MP_TargetPoint facing Default building facing degrees


Hmm... There seems to be something wrong about this line...
Oh, yeah... THERE IS NO UNIT-TYPE THERE ! XD

Should be something like:
Trigger:
  • Unit - Create 1 PolyDummy for (Owner of MP_Caster) at MP_TargetPoint facing Default building facing degrees
 

Changest

New Member
Reaction score
0
New way of doing it.

Ok if you want to try mine, it is easier and the polymorph levels as you level the ability. Copy the night elf dummy unit, then copy the dummy polymorph ability (new), double check the dummy's ability is the unit polymorh (new) ability and has locust. Then copy the trigger i put in. might have to fix the ability on the trigger to match the copied abilities, as well as the dummy unit it summons.

If you have questions let me know.
 

Attachments

  • Multi Polymorph.w3x
    21.3 KB · Views: 197

CBBPhoenix

New Member
Reaction score
1
omfg -.-'

LOOOOOOOOOOOOOL. I found out that the reason why it did not work is because my AoE of the ability is very small (50 AoE). So even though the unit appears green (going to be affacted) it does in fact not become morphed. Don't know what relation there is between actual AoE an the selection one, but now I know it works. Thanks for pointing out the variable thing avalya. I added another variable "sheeppoint" instead of "targed point of ability bein cast" just to make sure :p and ty Komaqtion for telling about the missing unit. I hate these kinds of errors hehe. xD. I just copied the trigger from the map and defined the variables in my map but well the custom dummy unit had another name in my map ZZZ.

Ty all for you help.

Erm I can't give any of you guys rep because I need to spread some rep lala before giving to you again T_T I owe :D
 

avalya

New Member
Reaction score
37
Something tells me you're not giving spreading too much rep, you gave me +rep 1 month ago. :p

Anyway, I'm glad you solved it.
 

CBBPhoenix

New Member
Reaction score
1
that's because most people don't solve my problems to be honest hehe, or I don't post so much :-/. Anyways I got one problem I just found: The trigger only morphs one unit in total! how can that be with the loop action?
 

avalya

New Member
Reaction score
37
Are you sure all the actions are under the Unit Group Loop? Why do you hide your dummy?
 

LearningCode

New Member
Reaction score
24
Avalya be going through that mid-forum-life crisis. xD
Wishing he had more rep, that he could help more people, that he should spread more rep, that he should get himself a Ferrari, that he should be a trap, etc.
 

CBBPhoenix

New Member
Reaction score
1
Nevermind I solved it myself. Just added more actions after a 0,1 wait. And don't tell me that you may not put waits into loop actions XD it works.
 

avalya

New Member
Reaction score
37
Well, if your wait is 'in' the loop, then it will cause every loop to be 0.27 seconds after another (not actually 0.1 seconds, because the shortest wait time is 0.27). Why did you need the wait actually? I might be able to solve it for you without it.
 

CBBPhoenix

New Member
Reaction score
1
gonna check that out. :p I guess waits and periodic events cause lag.
EDIT: well I found that a wait is required :-/
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Can you post your new trigger, maybe we can use a timer instead of a wait ^^
 

Ayanami

칼리
Reaction score
288
Off Topic: Hey, isn't this my Reverse Polarity demo map? 0.0

Okay, I changed around your Multi Polymorph triggers a bit. Firstly, no need to hide the dummy. It has no model, so it is already "invisible". Secondly, removed all leaks, I think. Attached a demo map too.

Trigger:
  • Multi Polymorph
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Multi Polymorph
    • Actions
      • Set MP_CasterPoint = (Position of (Triggering unit))
      • Set MP_TargetPoint = (Target point of ability being cast)
      • Set MP_TargetGroup = (Units within 250.00 of MP_TargetPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in MP_TargetGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 MultiMorph Dummy for (Owner of (Triggering unit)) at MP_CasterPoint facing Default building facing degrees
          • Unit - Add DummyHexSpell to (Last created unit)
          • Unit - Set level of DummyHexSpell for MP_DummyUnit to (Level of Multi Polymorph for (Triggering unit))
          • Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Picked unit)
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Custom script: call DestroyGroup(udg_MP_TargetGroup)
      • Custom script: call RemoveLocation(udg_MP_TargetPoint)
      • Custom script: call RemoveLocation(udg_MP_CasterPoint)


Glenphir
 

CBBPhoenix

New Member
Reaction score
1
Yep that one works the same way as "my" trigger, so it works :p. (where I changed some parts from the one added by avalya). A was requested to post it so here it is:
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Multi Polymorph
      • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
    • Actions
      • Set MP_Caster = (Triggering unit)
      • Set MP_casterpoint = (Position of MP_Caster)
      • Set sheeppoint = (Target point of ability being cast)
      • Set MP_TargetGroup = (Units within 100.00 of sheeppoint matching ((((Matching unit) belongs to an ally of (Owner of MP_Caster)) Equal to False) and (((Matching unit) is dead) Equal to False)))
      • Unit Group - Pick every unit in MP_TargetGroup and do (Actions)
        • Loop - Actions
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Custom script: call RemoveLocation (udg_MP_casterpoint)
          • Custom script: call DestroyGroup (udg_MP_TargetGroup)
          • Custom script: call DestroyGroup (udg_MP_TargetGroup)
          • Set MP_Caster = No unit
          • Set MP_DummyUnit = No unit


I know it is noobish with the same function over and over but it works every time so I'm happy :p. And I also know it is noobish to have "level of ability = X" instead of "set ability for Dummy to level of ability for Casting Hero". But I have bad experiences with this one so I made 5 abilities (one for each level of the ability of the Hero to add to the dummy). All the same my problem is solved :D
 

Ayanami

칼리
Reaction score
288
Yep that one works the same way as "my" trigger, so it works :p. (where I changed some parts from the one added by avalya). A was requested to post it so here it is:
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Multi Polymorph
      • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
    • Actions
      • Set MP_Caster = (Triggering unit)
      • Set MP_casterpoint = (Position of MP_Caster)
      • Set sheeppoint = (Target point of ability being cast)
      • Set MP_TargetGroup = (Units within 100.00 of sheeppoint matching ((((Matching unit) belongs to an ally of (Owner of MP_Caster)) Equal to False) and (((Matching unit) is dead) Equal to False)))
      • Unit Group - Pick every unit in MP_TargetGroup and do (Actions)
        • Loop - Actions
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Set MP_TargetPoint = (Position of (Picked unit))
          • Unit - Create 1 Dummy unit (multisheep) for (Owner of MP_Caster) at (MP_TargetPoint offset by (0.00, 0.00)) facing Default building facing degrees
          • Set MP_DummyUnit = (Last created unit)
          • Unit - Add Polymorph (dummy) (Neutral Hostile) to MP_DummyUnit
          • Unit - Hide MP_DummyUnit
          • Unit - Order MP_DummyUnit to Human Sorceress - Polymorph (Picked unit)
          • Unit - Remove MP_DummyUnit from the game
          • Wait 0.10 seconds
          • Custom script: call RemoveLocation (udg_MP_casterpoint)
          • Custom script: call DestroyGroup (udg_MP_TargetGroup)
          • Custom script: call DestroyGroup (udg_MP_TargetGroup)
          • Set MP_Caster = No unit
          • Set MP_DummyUnit = No unit


I know it is noobish with the same function over and over but it works every time so I'm happy :p. And I also know it is noobish to have "level of ability = X" instead of "set ability for Dummy to level of ability for Casting Hero". But I have bad experiences with this one so I made 5 abilities (one for each level of the ability of the Hero to add to the dummy). All the same my problem is solved :D

But why do you hide the dummy?
 

avalya

New Member
Reaction score
37
0.1 second waits are actually 0.27 seconds, I don't know how yours' works, but, just sayin'.
 

CBBPhoenix

New Member
Reaction score
1
I only hide it because it was that way in the original trigger, it is not needed.
It's ok if it's 0.27 seconds :p
 
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