• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Polymorph

Status
Not open for further replies.
Level 4
Joined
Nov 14, 2009
Messages
63
I made a dialog.I want my unit to polymorp into a flying sheep for 20 seconds when i click yes but ı couldnt make the trigger correctly.How to do that trigger?
 
Level 14
Joined
Jan 5, 2009
Messages
1,127
I will help ye out in a min
There
  • PolyMorph
    • Events
      • Dialog - A dialog button is clicked for Polymorph
    • Conditions
      • (Clicked dialog button) Equal to Yes
    • Actions
      • Set Unit_Typ_Unit = (Unit-type of Unit)
      • Unit - Replace Unit with a Sheep using The new unit's max life and mana
      • Wait 20.00 seconds
      • Unit - Replace Unit with a (Unit-type of Unit) using The new unit's max life and mana
 
Level 4
Joined
Nov 14, 2009
Messages
63
Couldnt get it to work.Here is my triggers can someone tell me where ı'm doing a mistake:

adszji.png
 
Level 14
Joined
Jan 5, 2009
Messages
1,127
You gotta have a Unit Varible. In Chibi Dialog Trigger thing. Add Set (Your Varible) = (Entering Unit)
Ok.
Then
  • Set Unit_Typ_Unit = (Unit_Type of Your_Varible
  • Replace (Your Varible) with a Flying Sheep using the New unit's max life and mana.
  • Wait 20.00 Seconds
  • Replace (Your_Varible) with a (Unit_Typ_Unit) using the New unit's max life and mana.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This works only one time, and only for one unit. If you need it to work with several units you need to modify it a bit.

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of Race_Dialog to Select
      • Dialog - Create a dialog button for Race_Dialog labelled Sheep
  • Untitled Trigger 003
    • Events
      • Unit - A unit enters Region 015 <gen>
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Dialog - Show Race_Dialog for (Owner of (Triggering unit))
      • Set Temp_Unit_1 = (Triggering unit)
      • Set Temp_UnitType = (Unit-type of (Triggering unit))
      • Trigger - Turn on Untitled Trigger 005 <gen>
  • Untitled Trigger 005
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Replace Temp_Unit_1 with a Peasant using The old unit's relative life and mana
      • Wait 3.00 seconds
      • Unit - Replace (Last replaced unit) with a Temp_UnitType using The old unit's relative life and mana
 
Level 4
Joined
Nov 14, 2009
Messages
63
Thx guys.

Crazed_seal2 it realy worked but i need one more thing.When hero turns to sheep and after 40 minutes turns back to its orijinal form it starts from level 1.How can i solve this?
 
Level 9
Joined
Dec 12, 2007
Messages
489
if you replace a unit, every single info you have on it will be resetted when replaced again...
so I believe you should take Crazed_seal2's last suggestion to use polymorph ability, or hex maybe. it will revert back with all info remain like before polymorphed or hexed when the duration ends.
 
Level 4
Joined
Nov 14, 2009
Messages
63
İ can use polymorph i quess but if so i need a "unit enters a region cast polymorph spell" like trigger.Can someone do it?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Events
    • Unit enters *some region*
  • Conditions
    • Add some conditions here if needed
  • Actions
    • Temp_Loc_1 = Position of (triggering unit)
    • Create 1 dummy unit at Temp_Loc_1...
    • Add Polymorph to (last created unit)
    • Order (last created unit) to Polymorph (triggering unit)
    • Unit - Add 1 second generic expiration timer for (last created unit)
    • Custom Script: call RemoveLocation(udg_Temp_Loc_1)
That should do it.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You have the trigger that has "unit enters region" and that trigger brings up the dialog box. Do all players only have one hero? If that's the case then create a unit array. Then in that same trigger do this:

  • Set UnitArray[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
And in the "dialog button is clicked":

  • Temp_Loc_1 = Position of UnitArray[(Player number of (Triggering Player))]
  • ...
  • Order (last created unit) to Polymorph UnitArray[(Player number of (Triggering Player))]
 
Last edited:
Level 4
Joined
Nov 14, 2009
Messages
63
[(Player number of (Owner of (Triggering Player)))] = ???

Can it be [(Player number of (Triggering Player)))]
 
[(Player number of (Owner of (Triggering Player)))] = ???

Can it be [(Player number of (Triggering Player)))]

nope.. because your event is Unit - A unit enters a region... its obvious that you only have triggering unit because it is a unit event... Triggering Player works with player events only... and so on for the other TriggeringSomethings....
 
Level 4
Joined
Nov 14, 2009
Messages
63
i think i did something wrong cause it did not worked."UnitArray" what kind of variable is this?
 
Level 5
Joined
May 3, 2009
Messages
129
in object editor
did you change the setting

mana cost 0
stats- target allowed Air,ground
techtree- requirements (nothing)
tedhtree -requiremeants-levels (nothing)

cos the trigger works fine i just did a fast test
  • Melee Initialization
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Set unit[(Player number of (Owner of (Entering unit)))] = (Entering unit)
      • Dialog - Change the title of dialogtest to test
      • Dialog - Create a dialog button for dialogtest labelled 1
      • Set buttontest[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialogtest labelled 2
      • Set buttontest[2] = (Last created dialog Button)
      • Dialog - Show dialogtest for (Owner of (Entering unit))
  • Untitled Trigger 001
    • Events
      • Dialog - A dialog button is clicked for dialogtest
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to buttontest[1]
        • Then - Actions
          • Set point = (Position of unit[(Player number of (Triggering player))])
          • Unit - Create 1 Sorceress for Player 11 (Dark Green) at point facing Default building facing degrees
          • Unit - Add Polymorph to (Last created unit)
          • Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Polymorph unit[(Player number of (Triggering player))]
          • Custom script: call RemoveLocation(udg_point)
        • Else - Actions
 
Status
Not open for further replies.
Top