• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Mass Polymorph

Status
Not open for further replies.
Level 5
Joined
Feb 19, 2008
Messages
110
Hi.
Im making a map with alot of costum spells, and currently im working on a mass polymorph spell. I based it of the dispell magic ability, and did the rest of the job through triggers.

These are the "actions"

Variable- Set "masspolymorpharea" = (region centered at point of (ability being cast) with size 300.00, 300.00))

Unit group- pick every unit in (units in "masspolymorpharea") and do action; (create 1 polymorphdummy at position of picked unit facing default building degrees.)

Add an 4 second expiration timer to last created unit.

Unit- Order (last created unit) to Human sorceress-polymorph picked unit.

My problem is= its only one unit inside the targeted area that gets "polymorphed" the rest of the targeted units stays fine.

Any ideas? (srry if you dont get the text :p) :cute:
 
Level 10
Joined
Jan 28, 2009
Messages
442
Do it like this:

  • Variable - Set TempLoc = (target point of ability being cast)
  • Variable - Set TempRect = (region centered at TempLoc)
  • Custom Script - "call RemoveLocation(udg_TempLoc)"
  • Custom Script - "set bj_wantDestroyGroup = true"
  • Unit Group - Pick every unit in (TempRect) and do actions
    • Loop
      • Variable - Set TempLoc = position of (Picked Unit)
      • Unit - Create 1 PolymorphDummy at TempLoc
      • Unit - Add a 4 seconds expiration timer to (Last Created Unit)
      • Unit - Order (Last Created Unit) to sorceress-polymorph (Picked Unit)
      • Custom Script - "call RemoveLocation(udg_TempLoc)"
  • Custom Script - "set bj_wantDestroyGroup = false"
  • Custom Script - "call RemoveRect(udg_TempRect)"
This should do it.

The bug was that you forgot to put all the actions regarding the dummy unit under the loop. If those actions don't loop, it will only happen once :)

If you get an error message when saving this map, change the last line to "call DestroyRect(udg_TempRect)"
If that's the case, it means I remembered the function wrong. In that case I am sorry.
 
Level 5
Joined
May 21, 2006
Messages
174
First of all, if you base it off Dispel Magic it will dispel units in the area regardless of your intentions.

Secondly, you should clean up those leaks you have there (Tutorial).

Thirdly, use [ trigger ] [ /trigger ] to make the trigger more readable, like this:
  • Set "masspolymorpharea" = (region centered at point of (ability being cast) with size 300.00, 300.00))
  • Unit group- pick every unit in (units in "masspolymorpharea") and do action; (create 1 polymorphdummy at position of picked unit facing default building degrees.)
  • Add an 4 second expiration timer to last created unit.
  • Unit- Order (last created unit) to Human sorceress-polymorph picked unit.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004

  • Mass Polymorph
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <AbilityName>
    • Actions
      • Set location = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set unit_location = (Position of (Picked unit))
          • Unit - Create 1 <Unit/DummyName> for (Owner of (Triggering unit)) at unit_location facing Default building facing degrees
          • Unit - Add <AbilityName> to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_unit_location)
      • Custom script: call RemoveLocation (udg_location)


No need to use any type of regions
Both of you leak in locations.
 
Level 5
Joined
May 21, 2006
Messages
174

  • Mass Polymorph
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <AbilityName>
    • Actions
      • Set location = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set unit_location = (Position of (Picked unit))
          • Unit - Create 1 <Unit/DummyName> for (Owner of (Triggering unit)) at unit_location facing Default building facing degrees
          • Unit - Add <AbilityName> to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_unit_location)
      • Custom script: call RemoveLocation (udg_location)


No need to use any type of regions
Both of you leak in locations.
You leak unit group.

Here's a somewhat similar trigger I use for my map:
  • Firewind Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set tempPoint = (Position of Spell_Firewind_tempUnit)
      • Set tempGroup = (Units within 500.00 of tempPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is hid
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of Spell_Firewind_tempUnit)) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Create 1 UNIT (DUMMY) for (Owner of Spell_Firewind_tempUnit) at tempPoint facing tempPoint
              • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Slow (Dummy) to (Last created unit)
              • Unit - Set level of Slow (Dummy) for (Last created unit) to (Level of Pyrokinesis (int ulti) for Spell_Firewind_tempUnit)
              • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
            • Else - Actions
      • Custom script: call DestroyGroup ( udg_tempGroup )
      • Custom script: call RemoveLocation( udg_tempPoint )
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Patrux, I dont leak unit-group since I used "bj_wantDestroyGroup" ..
And damn, why the hell you use if/then/else, since you already set the units to be specified while using tempGroup veriable..
You use an unneeded unit-veriable which is not set or nulled anywhere in the trigger.

Learn to use GUI, pl0x.
 
Level 5
Joined
May 21, 2006
Messages
174
Level 6
Joined
Mar 26, 2008
Messages
239
Nobody says its a leak, and he shows both ways as a way to clear the group
So don't try to be smart when you are not.
The more important is, you can't do the trigger, even reading the tuturial.
It's interesting how your life is bad if you do like this,I mean if somebody makes a small mistake in triggers (I mean PatruX) you say that he knows nothing and an idiot:xxd:And even if there was no mistake (I mean me:grin:)Too bad moderators haven't seen your impudence yet)))

Well,MortAr-'s trigger is the best way to make a mass polymorph you want,I think)
 
Last edited:
Level 19
Joined
Feb 25, 2009
Messages
2,004
It's interesting how your life is bad if you do like this,I mean if somebody makes a small mistake in triggers (I mean PatruX) you say that he knows nothing and an idiot:xxd:And even if there was no mistake (I mean me:grin:)Too bad moderators haven't seen your impudence yet)))

Well,MortAr-'s trigger is the best way to make a mass polymorph you want,I think)

Look hes trigger first, then blame me for saying anything.
It's not a mistake, the whole trigger is ruined from the begining.
 
Level 6
Joined
Mar 26, 2008
Messages
239
Trigger worked perfectly,he just made 1 thing not the way you did,and he blamed you that you are wrong (exactly this was a mistake),and the fact he is wrong does not mean that he knows nothing and an idiot and like that,and even if he really is an idiot(but he is not),his mistake does not give you right to say something bad about him,it just give you right to correct him.
For example,I don't call you an idiot because you use variables when you can turn the spell into JASS and use locals and scopes and remove BJ functions that are used in GUI,which makes the spell much faster,because there things don't show if you are good or bad man,and one mistake (correcting you while you were right) doesn't mean that he knows nothing
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Trigger worked perfectly,he just made 1 thing not the way you did,and he blamed you that you are wrong (exactly this was a mistake),and the fact he is wrong does not mean that he knows nothing and an idiot and like that,and even if he really is an idiot(but he is not),his mistake does not give you right to say something bad about him,it just give you right to correct him.
For example,I don't call you an idiot because you use variables when you can turn the spell into JASS and use locals and scopes and remove BJ functions that are used in GUI,which makes the spell much faster,because there things don't show if you are good or bad man,and one mistake (correcting you while you were right) doesn't mean that he knows nothing

You realy hate me, don't you?
I'm not a JASSer, not even good GUIer (im matter of fact, I learned basics of GUI 1 mouth ago),
I can't work with JASS, so I think its better for me not to try using JASS before I learn it.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
blah all of you shut up for the moment, stop argue about a BJ

The only thing that you dont wanna use this is because it's a BJ, that's all! It destroys the group anyway but you usally dont use it but some use it anyway, their choice.

The only matter about a BJ (overall) is that it's slower then setting a variable, use it and destroy it.

BJ is like calling a function that calls the real function but normal destroying just calls the real function.

But Mortar has his own rights to use it even thought I wouldnt recommend it.

regards

~baassee
 
Level 6
Joined
Mar 26, 2008
Messages
239
I just gave you an example)But if I think as you do then I can call you an idiot again because you don't try to be use JASS because it is quite simple and much better.
You should just be more polite with other people,because you are wrong when call somebody an idiot because of such small things)
I suppose that you just don't like when someone does not agree with you.
And I really don't like you,but only because of your behavior,I mean the way you talk with other people,because it is far from the right way.
 
Level 6
Joined
Mar 26, 2008
Messages
239
blah all of you shut up for the moment, stop argue about a BJ

The only thing that you dont wanna use this is because it's a BJ, that's all! It destroys the group anyway but you usally dont use it but some use it anyway, their choice.

The only matter about a BJ (overall) is that it's slower then setting a variable, use it and destroy it.

BJ is like calling a function that calls the real function but normal destroying just calls the real function.

But Mortar has his own rights to use it even thought I wouldnt recommend it.

regards

~baassee

You know,the talk was not about BJs, it was about his talking to other people,you should read everything carefully,so you shut up:)
 
Level 6
Joined
Mar 26, 2008
Messages
239
No
1 man posted trigger,2 said that there was group leak in the trigger,but there was not,and 1 said that 2 knows nothing in triggers because of 2nd'th mistake,and it is not first case of such behavior of 1st.That is why I asked 1st to be more polite with people.For example if named me an idiot some time before because of mistake which I did not make))
So,it is not about BJ leak:)
 
Level 6
Joined
Mar 26, 2008
Messages
239
I did my best))
Well problem is solved,and there is no need to write here anymore))
But if he do this again(I mean calling people idiots and anything else),I will write to him again:p))))
 
Status
Not open for further replies.
Top