• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[ASK] Upgrade normal hero to anothers stronger hero using item ?

Status
Not open for further replies.
Level 4
Joined
Aug 13, 2010
Messages
60
Is there any way to permanently upgrade hero from normal hero to anothers stronger hero and in another form by using an item ( item category is charged) ???

Example : a normal hero (example : blademaster ) buy an item "Scroll of God" ( changed from scroll of animation thats has been modified ) and after use it the hero will change to another form ( example : ILLIDAN ) with stronger : ability , attack speed , damage , movement ,etc. The Transformation is permanent.

and if the hero thats already transformed to another stronger version of hero , bought again the scroll ( this time is Scroll of God lvl 2 , Second scroll/anothers scroll ) the hero thats already transformed to ILLIDAN will transform again to another stronger hero form ( example : Dreadlord ) and of course with the increasing of ability ,damage , etc. of course the transformation is permanent

Note :
i want the Transformation is already determined in the scroll example :
*Scroll of God" Transformation is Illidan
*Scroll of God lvl 2" Transformation is Dreadlord
*Scroll of God lvl 3" Transformation is Lich
and ETC to maybe scroll lvl 4 or 5 with the different Transformation and of course all transformation is permanent.

And i want every player only able to use 1 time each scroll if the hero already successful Transformed. So if the hero already transform ( example : Scroll of God ) using the scroll that hero wont be able to use ( Scroll of god ) again although the hero can buy it but cant use it.

if it possible please include the map and the trigger is in GUI version since iam newbie for more understandable.

Please i really need to know how to do it.:confused:




iam sorry i think its different from what i want. What i want is the hero only change if he acquired the item i mention before. Please read the question again THX. The hero transform to anothers form using an item not passively.

and beside the link you give to me i already tried it but because iam still newbie i failed and its a little hard for me to understand especially trigger part. add to you unit ( i put to triggering unit failed , i put leveling hero and failed to ) :confused::confused:
 
Last edited:
Level 9
Joined
Apr 23, 2010
Messages
312
I think this is what you need. You will need to change "YourItem" to the item that will be used for the transformation and farther down you will need to change "YourUnit" with the unit your turning into

  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
    • Set ReplacedUnit_u = (Triggering Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated) Equal to "YourItem"
        • Then - Actions
          • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
          • Set Strength_int = (Strength of ReplacedUnit_u (Exclude bonuses))
          • Set Agility_int = (Agility of ReplacedUnit_u (Exclude bonuses))
          • Set Intellignece_int = (Intelligence of ReplacedUnit_u (Exclude bonuses))
          • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
          • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
          • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
          • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
          • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
          • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
          • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
          • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
          • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
          • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
          • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
          • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
          • If ((Unit-type of (ReplacedUnit_u)) Equal to "YourUnit") then do (Unit - Replace (ReplacedUnit_u) with a "YourNewUnit" using The old unit's relative life and mana) else do (Do nothing)
          • Set NewUnit_u = (Last replaced unit)
          • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
          • Hero - Modify Strength of NewUnit_u: Set to Strength_int
          • Hero - Modify Agility of NewUnit_u: Set to Agility_int
          • Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int
          • For each (Integer A) from 0 to 5, do (Actions)
            • Loop - Actions
              • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
              • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
        • Else - Actions
If (which I am assuming if you use this that you will be doing this for more unit transformations) you need to transform again, just copy + paste the single action ITE (If/Then/Else) and change the unit-type check and again, "YourUnit"

Hope this helped!
 
Level 4
Joined
Aug 13, 2010
Messages
60
I think this is what you need. You will need to change "YourItem" to the item that will be used for the transformation and farther down you will need to change "YourUnit" with the unit your turning into

  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
    • Set ReplacedUnit_u = (Triggering Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated) Equal to "YourItem"
        • Then - Actions
          • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
          • Set Strength_int = (Strength of ReplacedUnit_u (Exclude bonuses))
          • Set Agility_int = (Agility of ReplacedUnit_u (Exclude bonuses))
          • Set Intellignece_int = (Intelligence of ReplacedUnit_u (Exclude bonuses))
          • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
          • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
          • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
          • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
          • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
          • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
          • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
          • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
          • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
          • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
          • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
          • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
          • If ((Unit-type of (ReplacedUnit_u)) Equal to "YourUnit") then do (Unit - Replace (ReplacedUnit_u) with a "YourNewUnit" using The old unit's relative life and mana) else do (Do nothing)
          • Set NewUnit_u = (Last replaced unit)
          • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
          • Hero - Modify Strength of NewUnit_u: Set to Strength_int
          • Hero - Modify Agility of NewUnit_u: Set to Agility_int
          • Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int
          • For each (Integer A) from 0 to 5, do (Actions)
            • Loop - Actions
              • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
              • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
        • Else - Actions
If (which I am assuming if you use this that you will be doing this for more unit transformations) you need to transform again, just copy + paste the single action ITE (If/Then/Else) and change the unit-type check and again, "YourUnit"

Hope this helped!

So... with this trigger can we change from example Blade Master ( using Scroll of God ) to Illidan. And the model can be changed at will ??
and is this trigger fulfill my request of this ??? :
Note :
i want the Transformation is already determined in the scroll example :
*Scroll of God" Transformation is to Illidan
*Scroll of God lvl 2" Transformation is to Dreadlord
*Scroll of God lvl 3" Transformation is to Lich
and ETC to maybe scroll lvl 4 or 5 with the different Transformation and of course all transformation is permanent. And the model of transformation can be changed at will by me
 
Level 9
Joined
Apr 23, 2010
Messages
312
Yes, you can change from anything into anything as long as you have an ITE (If/Then/Else) that checks the current unit and peplaces it with th eunit you want accordingly. You can use the same item to do more powerful transformations as well, instead of using different scrolls for each one, but that's up to you :)

Example:
  • If ((Unit-type of (ReplacedUnit_u)) Equal to "Unit_A") then do (Unit - Replace (ReplacedUnit_u) with a "Unit_B" using The old unit's relative life and mana) else do (Do nothing)
You would then add more of these for more transformations
  • If ((Unit-type of (ReplacedUnit_u)) Equal to "Unit_B") then do (Unit - Replace (ReplacedUnit_u) with a "Unit_C" using The old unit's relative life and mana) else do (Do nothing)
I am assuming this is going to be used for heroes only correct?
 
Level 4
Joined
Aug 13, 2010
Messages
60
Yes, you can change from anything into anything as long as you have an ITE (If/Then/Else) that checks the current unit and peplaces it with th eunit you want accordingly. You can use the same item to do more powerful transformations as well, instead of using different scrolls for each one, but that's up to you :)

Example:
  • If ((Unit-type of (ReplacedUnit_u)) Equal to "Unit_A") then do (Unit - Replace (ReplacedUnit_u) with a "Unit_B" using The old unit's relative life and mana) else do (Do nothing)
You would then add more of these for more transformations
  • If ((Unit-type of (ReplacedUnit_u)) Equal to "Unit_B") then do (Unit - Replace (ReplacedUnit_u) with a "Unit_C" using The old unit's relative life and mana) else do (Do nothing)
I am assuming this is going to be used for heroes only correct?

so its will look like upgrading the hero using 1 scroll like :
if the hero already use Scroll of God and transform to hero lvl 2 and using scroll of god same item again it will transform to hero lvl 3 ???

and can it be made that after the hero transform to the highest level the hero cannot again using the item although it still can be bought.

But could you please make me the example map for me to understand it easily ??? Please i really need to know it.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Instead of replace (creating new units, replacing the old ones), you better use Hide/Unhide action as it doesn't create excess units.
It will cause a degradation of performance if you use replace units for a long-term game (1 hour and above)
 
Level 9
Joined
Apr 23, 2010
Messages
312
I;m not going to put it on a map for you. I will post the trigger and variables but you can do the rest. There is only one way to learn and that's to do it yourself.

Place the variables first otherwise all the triggers will be disabled.
  • ReplacedUnit_u = Unit
  • TempPoint = Point
  • UnitExperience_int = Integer
  • Strength_int = Integer
  • Agility_int = Integer
  • Intelligence_int = Integer
  • Item_i = Item Array
  • ItemCharges_int = Integer Array
  • NewUnit_u = Unit

Now that you have put in the variables, you can now begin entering the triggers!
  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
  • -------- ----- --------
  • -------- First we must set the killing unit --------
  • -------- ----- --------
    • Set ReplacedUnit_u = (Killing Unit)
  • -------- ----- --------
  • -------- Then we must set where that killing unit is --------
  • -------- ----- --------
    • Set TempPoint = (Position of (Killing unit))
  • -------- ----- --------
  • -------- Now we must run a check to make sure the unit has the correct item --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
  • -------- ----- --------
  • -------- If the unit has the correct item, we then set the units experience, attributes, item's and how many charges are in the item's --------
  • -------- ----- --------
    • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
    • Set Strength_int = (Strength of ReplacedUnit_u (Exclude bonuses))
    • Set Agility_int = (Agility of ReplacedUnit_u (Exclude bonuses))
    • Set Intellignece_int = (Intelligence of ReplacedUnit_u (Exclude bonuses))
  • -------- ----- --------
  • -------- Here is where we set the item's --------
  • -------- ----- --------
    • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
    • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
    • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
    • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
    • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
    • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- Here is where we set the charges in those item's --------
  • -------- ----- --------
    • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
    • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
    • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
    • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
    • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
    • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- We must then run a check to make sure we are replacing the correct unit --------
  • -------- You will want to add more of these checks if you want to turn into more units --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
    • Then - Actions
      • Unit - Hide (ReplacedUnit_u)
      • Unit - Remove (ReplacedUnit_u) from the game
      • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
    • Else - Actions
  • -------- ----- --------
  • -------- We then set the transformed unit and give it it's experience, attributes, and item's with correct abmount of charges back --------
  • -------- ----- --------
    • Set NewUnit_u = (Last created unit)
    • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
    • Hero - Modify Strength of NewUnit_u: Set to Strength_int
    • Hero - Modify Agility of NewUnit_u: Set to Agility_int
    • Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int
  • -------- ----- --------
  • -------- This gives the item's and their respective charges back to the unit --------
  • -------- ----- --------
    • For each (Integer A) from 0 to 5, do (Actions)
      • Loop - Actions
        • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
        • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ----- --------
  • -------- Clear the point leak --------
  • -------- ----- --------
  • Custom script: call RemoveLocation(udg_TempPoint)
I have shown you how to do it, now it's up to you to put it in your map.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Using Unit - replace a unit will keep the old unit's items and exp if the units are heroes so those actions are useless.

Also, if one is using any kind of unit indexer or hastable system, they migth fail since the unit id will change. The unit's name will also change and there's no way to change a unit's name in-game with triggers.

I recommed using a solution based on bear form or metamorphosis.
 
Level 4
Joined
Aug 13, 2010
Messages
60
Using Unit - replace a unit will keep the old unit's items and exp if the units are heroes so those actions are useless.

Also, if one is using any kind of unit indexer or hastable system, they migth fail since the unit id will change. The unit's name will also change and there's no way to change a unit's name in-game with triggers.

I recommed using a solution based on bear form or metamorphosis.

so will the trigger of 13oot-Me ok if i use it ??
and if i use solution on bear form or metamorphosis what steps i must do ???

Instead of replace (creating new units, replacing the old ones), you better use Hide/Unhide action as it doesn't create excess units.
It will cause a degradation of performance if you use replace units for a long-term game (1 hour and above)

so which part of trigger from 13oot-Me should be changed ??? can you make me the example trigger ???
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
so will the trigger of 13oot-Me ok if i use it ??

Yes, if you don't mind the side effects I mentioned.

and if i use solution on bear form or metamorphosis what steps i must do ???

Use the tutorial I linked and a simple trigger that checks the unit- and item types. That method however keeps the hero abilities of the original unit.

@Maker, So I should get rid of the item's and the experience before I hide the unit to avoid unused data?

Yes.

And wouldn't it be possible to call the unit's custom ID before removing it and giving the same ID to the new unit or would that create confilct and call both units?

The idea of ID is to differentiate an object (a unit in this case) from every other object. It would not make sense if two objects could have the same ID.
 
Level 9
Joined
Apr 23, 2010
Messages
312
Here, thanks to Maker this trigger now removes the replaced units item's and all of it's experience to avoid unused data.

  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
  • -------- ----- --------
  • -------- First we must set the killing unit --------
  • -------- ----- --------
    • Set ReplacedUnit_u = (Killing Unit)
  • -------- ----- --------
  • -------- Then we must set where that killing unit is --------
  • -------- ----- --------
    • Set TempPoint = (Position of (Killing unit))
  • -------- ----- --------
  • -------- Now we must run a check to make sure the unit has the correct item --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
  • -------- ----- --------
  • -------- If the unit has the correct item, we then set the units experience, attributes, item's and how many charges are in the item's --------
  • -------- ----- --------
    • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
    • Set Strength_int = (Strength of ReplacedUnit_u (Exclude bonuses))
    • Set Agility_int = (Agility of ReplacedUnit_u (Exclude bonuses))
    • Set Intellignece_int = (Intelligence of ReplacedUnit_u (Exclude bonuses))
  • -------- ----- --------
  • -------- Here is where we set the item's --------
  • -------- ----- --------
    • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
    • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
    • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
    • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
    • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
    • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- Here is where we set the charges in those item's --------
  • -------- ----- --------
    • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
    • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
    • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
    • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
    • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
    • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- We must then run a check to make sure we are replacing the correct unit --------
  • -------- You will want to add more of these checks if you want to turn into more units --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
    • Then - Actions
  • -------- ----- --------
  • -------- Now we have to remove all the experience and item's to avoid unused data --------
  • -------- ----- --------
    • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
        • Item - Remove (Last dropped item)
    • Unit - Hide (ReplacedUnit_u)
    • Unit - Remove (ReplacedUnit_u) from the game
    • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
    • Else - Actions
  • -------- ----- --------
  • -------- We then set the transformed unit and give it it's experience, attributes, and item's with correct abmount of charges back --------
  • -------- ----- --------
    • Set NewUnit_u = (Last created unit)
    • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
    • Hero - Modify Strength of NewUnit_u: Set to Strength_int
    • Hero - Modify Agility of NewUnit_u: Set to Agility_int
    • Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int
  • -------- ----- --------
  • -------- This gives the item's and their respective charges back to the unit --------
  • -------- ----- --------
    • For each (Integer A) from 0 to 5, do (Actions)
      • Loop - Actions
        • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
        • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ----- --------
  • -------- Clear the point leak --------
  • -------- ----- --------
  • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 4
Joined
Aug 13, 2010
Messages
60
Here, thanks to Maker this trigger now removes the replaced units item's and all of it's experience to avoid unused data.

  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
  • -------- ----- --------
  • -------- First we must set the killing unit --------
  • -------- ----- --------
    • Set ReplacedUnit_u = (Killing Unit)
  • -------- ----- --------
  • -------- Then we must set where that killing unit is --------
  • -------- ----- --------
    • Set TempPoint = (Position of (Killing unit))
  • -------- ----- --------
  • -------- Now we must run a check to make sure the unit has the correct item --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
  • -------- ----- --------
  • -------- If the unit has the correct item, we then set the units experience, attributes, item's and how many charges are in the item's --------
  • -------- ----- --------
    • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
    • Set Strength_int = (Strength of ReplacedUnit_u (Exclude bonuses))
    • Set Agility_int = (Agility of ReplacedUnit_u (Exclude bonuses))
    • Set Intellignece_int = (Intelligence of ReplacedUnit_u (Exclude bonuses))
  • -------- ----- --------
  • -------- Here is where we set the item's --------
  • -------- ----- --------
    • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
    • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
    • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
    • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
    • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
    • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- Here is where we set the charges in those item's --------
  • -------- ----- --------
    • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
    • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
    • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
    • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
    • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
    • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
  • -------- ----- --------
  • -------- We must then run a check to make sure we are replacing the correct unit --------
  • -------- You will want to add more of these checks if you want to turn into more units --------
  • -------- ----- --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
    • Then - Actions
  • -------- ----- --------
  • -------- Now we have to remove all the experience and item's to avoid unused data --------
  • -------- ----- --------
    • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
        • Item - Remove (Last dropped item)
    • Unit - Hide (ReplacedUnit_u)
    • Unit - Remove (ReplacedUnit_u) from the game
    • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
    • Else - Actions
  • -------- ----- --------
  • -------- We then set the transformed unit and give it it's experience, attributes, and item's with correct abmount of charges back --------
  • -------- ----- --------
    • Set NewUnit_u = (Last created unit)
    • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
    • Hero - Modify Strength of NewUnit_u: Set to Strength_int
    • Hero - Modify Agility of NewUnit_u: Set to Agility_int
    • Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int
  • -------- ----- --------
  • -------- This gives the item's and their respective charges back to the unit --------
  • -------- ----- --------
    • For each (Integer A) from 0 to 5, do (Actions)
      • Loop - Actions
        • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
        • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ----- --------
  • -------- Clear the point leak --------
  • -------- ----- --------
  • Custom script: call RemoveLocation(udg_TempPoint)

hmmm what does it mean of "now removes the replaced units item's and all of it's experience to avoid unused data." If we change to anothers form the item that from previous form will dispear or will still remain ??? and what does it mean about the experience part ???


on this trigger "Set TempPoint = (Position of (Killing unit))" Killing unit is killing unit not like change to magina right ???

and what this trigger part mean ??? this trigger modifying the hero stats or something ??? hasnt new hero stats already been alter when we make a new unit hero ?
Hero - Modify Strength of NewUnit_u: Set to Strength_int
Hero - Modify Agility of NewUnit_u: Set to Agility_int
Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int"


and to change to anothers hero. First we must make a new unit hero and alter the new unit hero stats to later enable the trigger to change a hero to the new hero right ???

sorry iam a little confuse.
 
Level 9
Joined
Apr 23, 2010
Messages
312
hmmm what does it mean of "now removes the replaced units item's and all of it's experience to avoid unused data." If we change to anothers form the item that from previous form will dispear or will still remain ??? and what does it mean about the experience part ???
If we don't remove the item's and experience from the unit before we remove the unit, there will be data still stored for the removed unit and could cause lag or delay once built up. It's just extra game information that doesn't need to be stored at all since were getting rid of the unit, and thank you Maker for pointing this out.

on this trigger "Set TempPoint = (Position of (Killing unit))" Killing unit is killing unit not like change to magina right ???
Oops, everything that says "killing unit" should be changed to "Hero manipulating item". I copy + pasted this trigger (mostly) from another post and it used a unit dies event, sorry for that mix up.

and what this trigger part mean ??? this trigger modifying the hero stats or something ??? hasnt new hero stats already been alter when we make a new unit hero ?
Hero - Modify Strength of NewUnit_u: Set to Strength_int
Hero - Modify Agility of NewUnit_u: Set to Agility_int
Hero - Modify Intelligence of NewUnit_u: Set to Intellignece_int"
That's a good point, once the hero has his experience back there is no need to set the attributes, that should be removed.

and to change to anothers hero. First we must make a new unit hero and alter the new unit hero stats to later enable the trigger to change a hero to the new hero right ???

sorry iam a little confuse.
I'm not exactly sure what you mean to say here, but before we can change the unit we would have to save the experiience, item's and charges on all the item's into variables so that we can give the new unit all the experience and item's with the proper amount of charges as before the unit was changed.

Hopefully this updated trigger will do the trick!
  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • -------- ------------------------- --------
      • -------- First we must set the unit --------
      • -------- ------------------------- --------
      • Set ReplacedUnit_u = (Hero manipulating item)
      • -------- ----------------------------------- --------
      • -------- Then we must set where that unit is --------
      • -------- ----------------------------------- --------
      • Set TempPoint = (Position of (Hero manipulating item))
        • -------- ------------------------------------------------------------------ --------
        • -------- Now we must run a check to make sure the unit has the correct item --------
        • -------- ------------------------------------------------------------------ --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated) Equal to "YourItem"
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • -------- If the unit has the correct item, we then set the units experience, item's and how many charges are in the item's --------
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
          • --------------------------------- ----- --------
          • -------- Here is where we set the item's --------
          • -------- ------------------------------ --------
          • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
          • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
          • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
          • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
          • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
          • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
          • -------- ----------------------------------------------- --------
          • -------- Here is where we set the charges in those item's --------
          • -------- ----------------------------------------------- --------
          • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
          • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
          • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
          • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
          • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
          • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
          • -------- ---------------------------------------------------------------------- --------
          • -------- We must then run a check to make sure we are replacing the correct unit --------
          • -------- You will want to add more of these checks if you want to turn into more units --------
          • -------- -------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
          • Then - Actions
            • -------- ------------------------------------------------------------------------ --------
            • -------- Now we have to remove all the experience and item's to avoid unused data --------
            • -------- ------------------------------------------------------------------------ --------
            • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
            • For each (Integer A) from 1 to 6, do (Actions)
              • Loop - Actions
                • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
                • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
          • Else - Actions
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • -------- We then set the transformed unit and give it it's experience and item's with correct abmount of charges back --------
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • Set NewUnit_u = (Last created unit)
          • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
          • -------- --------------------------------------------------------------- --------
          • -------- This gives the item's and their respective charges back to the unit --------
          • -------- --------------------------------------------------------------- --------
          • For each (Integer A) from 0 to 5, do (Actions)
            • Loop - Actions
              • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
              • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ------------------- --------
  • -------- Clear the point leak --------
  • -------- ------------------- --------
  • Custom script: call RemoveLocation(udg_TempPoint)
If you don't want to give the experience or item's back to the unit, simply remove the corresponding variable(s) and the actions for those variables.

Maker said:
The idea of ID is to differentiate an object (a unit in this case) from every other object. It would not make sense if two objects could have the same ID.
But if I was to remove the unit it would therefor remove the unit's ID right? Then I would be able to give the new unit the same ID. Assuming this is right.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Hopefully this updated trigger will do the trick!
  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • -------- ------------------------- --------
      • -------- First we must set the unit --------
      • -------- ------------------------- --------
      • Set ReplacedUnit_u = (Hero manipulating item)
      • -------- ----------------------------------- --------
      • -------- Then we must set where that unit is --------
      • -------- ----------------------------------- --------
      • Set TempPoint = (Position of (Hero manipulating item))
        • -------- ------------------------------------------------------------------ --------
        • -------- Now we must run a check to make sure the unit has the correct item --------
        • -------- ------------------------------------------------------------------ --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated) Equal to "YourItem"
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • -------- If the unit has the correct item, we then set the units experience, item's and how many charges are in the item's --------
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
          • --------------------------------- ----- --------
          • -------- Here is where we set the item's --------
          • -------- ------------------------------ --------
          • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
          • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
          • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
          • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
          • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
          • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
          • -------- ----------------------------------------------- --------
          • -------- Here is where we set the charges in those item's --------
          • -------- ----------------------------------------------- --------
          • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
          • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
          • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
          • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
          • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
          • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
          • -------- ---------------------------------------------------------------------- --------
          • -------- We must then run a check to make sure we are replacing the correct unit --------
          • -------- You will want to add more of these checks if you want to turn into more units --------
          • -------- -------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
          • Then - Actions
            • -------- ------------------------------------------------------------------------ --------
            • -------- Now we have to remove all the experience and item's to avoid unused data --------
            • -------- ------------------------------------------------------------------------ --------
            • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
            • For each (Integer A) from 1 to 6, do (Actions)
              • Loop - Actions
                • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
                • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
          • Else - Actions
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • -------- We then set the transformed unit and give it it's experience and item's with correct abmount of charges back --------
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • Set NewUnit_u = (Last created unit)
          • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
          • -------- --------------------------------------------------------------- --------
          • -------- This gives the item's and their respective charges back to the unit --------
          • -------- --------------------------------------------------------------- --------
          • For each (Integer A) from 0 to 5, do (Actions)
            • Loop - Actions
              • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
              • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ------------------- --------
  • -------- Clear the point leak --------
  • -------- ------------------- --------
  • Custom script: call RemoveLocation(udg_TempPoint)

Replace unit function gives the new unit the items and exp of the old unit. So you can remove all lines dealing with exp or items from that trigger.

But if I was to remove the unit it would therefor remove the unit's ID right? Then I would be able to give the new unit the same ID. Assuming this is right.

The engine might recycle ids, but it is not possible to set a unit's id.
 
Level 4
Joined
Aug 13, 2010
Messages
60
If we don't remove the item's and experience from the unit before we remove the unit, there will be data still stored for the removed unit and could cause lag or delay once built up. It's just extra game information that doesn't need to be stored at all since were getting rid of the unit, and thank you Maker for pointing this out.


Oops, everything that says "killing unit" should be changed to "Hero manipulating item". I copy + pasted this trigger (mostly) from another post and it used a unit dies event, sorry for that mix up.


That's a good point, once the hero has his experience back there is no need to set the attributes, that should be removed.


I'm not exactly sure what you mean to say here, but before we can change the unit we would have to save the experiience, item's and charges on all the item's into variables so that we can give the new unit all the experience and item's with the proper amount of charges as before the unit was changed.

Hopefully this updated trigger will do the trick!
  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • -------- ------------------------- --------
      • -------- First we must set the unit --------
      • -------- ------------------------- --------
      • Set ReplacedUnit_u = (Hero manipulating item)
      • -------- ----------------------------------- --------
      • -------- Then we must set where that unit is --------
      • -------- ----------------------------------- --------
      • Set TempPoint = (Position of (Hero manipulating item))
        • -------- ------------------------------------------------------------------ --------
        • -------- Now we must run a check to make sure the unit has the correct item --------
        • -------- ------------------------------------------------------------------ --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated) Equal to "YourItem"
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • -------- If the unit has the correct item, we then set the units experience, item's and how many charges are in the item's --------
          • -------- ------------------------------------------------------------------------------------------------------------ --------
          • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
          • --------------------------------- ----- --------
          • -------- Here is where we set the item's --------
          • -------- ------------------------------ --------
          • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
          • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
          • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
          • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
          • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
          • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
          • -------- ----------------------------------------------- --------
          • -------- Here is where we set the charges in those item's --------
          • -------- ----------------------------------------------- --------
          • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
          • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
          • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
          • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
          • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
          • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
          • -------- ---------------------------------------------------------------------- --------
          • -------- We must then run a check to make sure we are replacing the correct unit --------
          • -------- You will want to add more of these checks if you want to turn into more units --------
          • -------- -------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
          • Then - Actions
            • -------- ------------------------------------------------------------------------ --------
            • -------- Now we have to remove all the experience and item's to avoid unused data --------
            • -------- ------------------------------------------------------------------------ --------
            • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
            • For each (Integer A) from 1 to 6, do (Actions)
              • Loop - Actions
                • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
                • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
          • Else - Actions
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • -------- We then set the transformed unit and give it it's experience and item's with correct abmount of charges back --------
          • -------- -------------------------------------------------------------------------------------------------------- --------
          • Set NewUnit_u = (Last created unit)
          • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
          • -------- --------------------------------------------------------------- --------
          • -------- This gives the item's and their respective charges back to the unit --------
          • -------- --------------------------------------------------------------- --------
          • For each (Integer A) from 0 to 5, do (Actions)
            • Loop - Actions
              • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
              • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • -------- ------------------- --------
  • -------- Clear the point leak --------
  • -------- ------------------- --------
  • Custom script: call RemoveLocation(udg_TempPoint)
If you don't want to give the experience or item's back to the unit, simply remove the corresponding variable(s) and the actions for those variables.


But if I was to remove the unit it would therefor remove the unit's ID right? Then I would be able to give the new unit the same ID. Assuming this is right.

so here a few question of mine :
1. Example before the first changed to second form hero. The first hero is lvl 10 and after transform to second form hero with stronger stats , will the second form of hero still remain in lvl 10 or after transform to second form of hero the hero will roll back to lvl 1 ???

2. item from first hero after changed to second form hero, will the item still remain exist and transfer to second form of hero or will dispeared after transform to second form hero ???

3. To change to anothers form , First we must make a new unit hero right then put in to trigger part "YOur new unit" Right ???

4. From the trigger how many form will the trigger cause ???

Note : I just want to change the form of the hero and including the Stats thats all.
 
Level 9
Joined
Apr 23, 2010
Messages
312
1. Example before the first changed to second form hero. The first hero is lvl 10 and after transform to second form hero with stronger stats , will the second form of hero still remain in lvl 10 or after transform to second form of hero the hero will roll back to lvl 1 ???
Yes, the new hero will be level 10. Let's say we stored the level instead of the experience. If you were let's say, level 9 and more then half way to level 10, you would lose that experience after the transformation. Since we are storing the experience however, we are fixing that problem. We are storing the experience by doing this line
  • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
2. item from first hero after changed to second form hero, will the item still remain exist and transfer to second form of hero or will dispeared after transform to second form hero ???
Again, we are storing all the item's that the first hero has in it's inventory with these lines
  • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
    • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
    • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
    • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
    • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
    • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
The second hero will get all of the first heroes item's with the correct amount of charges.

3. To change to anothers form , First we must make a new unit hero right then put in to trigger part "YOur new unit" Right ???
Yes, that is correct.

4. From the trigger how many form will the trigger cause ???
with every addition line of
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "YourUnit"
    • Then - Actions
    • -------- ------------------------------------------------------------------------ --------
    • -------- Now we have to remove all the experience and item's to avoid unused data --------
    • -------- ------------------------------------------------------------------------ --------
    • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
    • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
    • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
    • Item - Remove (Last dropped item)
    • Unit - Hide (ReplacedUnit_u)
    • Unit - Remove (ReplacedUnit_u) from the game
    • Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
    • Else - Actions
there can be another transformation, one ITE (If/Then/Else) for each transformation.

Note : I just want to change the form of the hero and including the Stats thats all.
If that's so and you really don't want to transfer the item's over, then you can remove all of this code
  • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
    • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
    • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
    • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
    • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
    • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
  • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
    • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
    • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
    • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
    • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
    • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
  • For each (Integer A) from 0 to 5, do (Actions)
    • Loop - Actions
    • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
    • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
Don't worry about PMing me a thousand times for questions, that's what were all here for right? :)
 
Level 4
Joined
Aug 13, 2010
Messages
60
so if we want to change 3 times , we must make this trigger below 3 times ??

----------------------------------------------------------- --------
Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
Item - Remove (Last dropped item)
Unit - Hide (ReplacedUnit_u)
Unit - Remove (ReplacedUnit_u) from the game
Unit - Create 1 "YourNewUnit" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
Else - Actions[/trigger]
there can be another transformation, one ITE (If/Then/Else) for each transformation.

about this trigger below we just add it to your trigger right ?? if it right , which part we must add this trigger ??

We are storing the experience by doing this line
  • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)

i forgot something important question.

according your trigger if we use the item and transform to the first form new form and use it again will we change to the second new form or nothing happened or we must add new unit to transform to anothers form ??


according your trigger. Is that true if

first hero have transform to first new form and if the hero use the item again he will transform to second new form ???

but the second hero hasnt tranform to first form so if the hero use the item he will transform to the first new form not to the second new form ( because he hasnt use the item again ) ????

after the hero already transform to the max form he will not be able to use the item again although its still be able to be bought. Because if it still be able to be used i afraid it just transform again to the final form. So can you make it unable to be used ( altough it maybe can be bought again ) ???

iam sorry before about "Iam only want to change the form not the item" because first i think it will erase the item if we have changed to anothers new form. But its solved and i almost understand all about your trigger
 
Level 9
Joined
Apr 23, 2010
Messages
312
Yes, if you want to change 3 times, all you have to do is add this code below 3 times. But you will need to change the unit that uses the item and what it will turn into, I will show you.
  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
    • Then - Actions
      • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
          • Item - Remove (Last dropped item)
      • Unit - Hide (ReplacedUnit_u)
      • Unit - Remove (ReplacedUnit_u) from the game
      • Unit - Create 1 "UnitRank1" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "UnitRank1"
    • Then - Actions
      • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
          • Item - Remove (Last dropped item)
      • Unit - Hide (ReplacedUnit_u)
      • Unit - Remove (ReplacedUnit_u) from the game
      • Unit - Create 1 "UnitRank2" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "UnitRank2"
    • Then - Actions
      • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
          • Item - Remove (Last dropped item)
      • Unit - Hide (ReplacedUnit_u)
      • Unit - Remove (ReplacedUnit_u) from the game
      • Unit - Create 1 "UnitRank3" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
about this trigger below we just add it to your trigger right ?? if it right , which part we must add this trigger ??
We would add the experience line in this section of the trigger.
  • Set NewUnit_u = (Last created unit)
  • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
  • For each (Integer A) from 0 to 5, do (Actions)
  • Loop - Actions
  • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
  • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
The only way for, let's say, the base unit to transform into the last transform unit in one transformation would be if you accidentally did something like this...
  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
    • Then - Actions
      • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
          • Item - Remove (Last dropped item)
      • Unit - Hide (ReplacedUnit_u)
      • Unit - Remove (ReplacedUnit_u) from the game
      • Unit - Create 1 "FinalTransform" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
What we can do for the last rank of the unit is if that unit acquires the item to transform, we can remove it and refund whatever resources were spent on it. That triggering would go something like this.
  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
    • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
    • Skip remaining actions
    • Else - Actions
Your probably wondering where that "TempForce" variable came from, it's a new variable I added so that we can clear the player group leak that occurs from game message's. This below trigger is the new, complete trigger (assuming you DO want the item's to transfer over).

Complete Variables List
Item_i = Item-Type Array
ItemCharges_int = Integer Array
NewUnit_u = Unit
ReplacedUnit_u = Unit
TempPoint = Point
UnitExperience_int = Integer
  • Replace Unit
    • Events
    • Unit - A unit Uses an item
    • Conditions
    • Actions
      • Set ReplacedUnit_u = (Hero manipulating item)
      • Set TempPoint = (Position of (Hero manipulating item))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
      • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
      • Set TempForce = (Player Group (Owner of (ReplacedUnit_u)))
      • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
      • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
      • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
      • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
      • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
      • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
      • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
      • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
      • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
      • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
      • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
      • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
        • Then - Actions
          • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
              • Item - Remove (Last dropped item)
              • Unit - Hide (ReplacedUnit_u)
              • Unit - Remove (ReplacedUnit_u) from the game
              • Unit - Create 1 "1stTransform" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "1stTransform"
        • Then - Actions
          • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
              • Item - Remove (Last dropped item)
              • Unit - Hide (ReplacedUnit_u)
              • Unit - Remove (ReplacedUnit_u) from the game
              • Unit - Create 1 "2ndTransform" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "2ndTransform"
        • Then - Actions
          • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
              • Item - Remove (Last dropped item)
              • Unit - Hide (ReplacedUnit_u)
              • Unit - Remove (ReplacedUnit_u) from the game
              • Unit - Create 1 "3rdTransform" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
        • Else - Actions
        • Set NewUnit_u = (Last created unit)
        • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
        • For each (Integer A) from 0 to 5, do (Actions)
          • Loop - Actions
            • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
            • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
iam sorry before about "Iam only want to change the form not the item" because first i think it will erase the item if we have changed to anothers new form. But its solved and i almost understand all about your trigger
Don't worry about it!

I know you asked for the map to "understand it easier" but I feel just giving maps out to people who don't even know what the trigger(s) do, is pointless. So I'm glad your asking lot's of question's!

Maker said:
Replace unit function gives the new unit the items and exp of the old unit. So you can remove all lines dealing with exp or items from that trigger.
In that case, the trigger should look like this...

Complete Variables List
ReplacedUnit_u = Unit
TempPoint = Point
UnitExperience_int = Integer
  • Replace Unit
    • Events
    • Unit - A unit Uses an item
    • Conditions
    • Actions
      • Set ReplacedUnit_u = (Hero manipulating item)
      • Set TempForce = (Player Group (Owner of (Replacedunit_u)
      • Set TempPoint = (Position of (Hero manipulating item))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "1stTransform" using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "1stTransform"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "2ndTransform" using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "2ndTransform"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "FinalTransform" using The old unit's relative life and mana
        • Else - Actions
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
 
Level 4
Joined
Aug 13, 2010
Messages
60
"BaseUnitRank" <<< what should i change from this part trigger ???
and what is the variable of "TempForce" ????

"1stTransform" <<< we change it to the new form of unit right example change to Magina Same as the rest change it to another new form to right ( "2ndTransform" and "3rdTransform" ) ???

about this new trigger below you made , is leakless right ? hmm that simplified trigger will it influence the existence of item ?? like maybe after transform the item will dispeared ???


  • Replace Unit
    • Events
    • Unit - A unit Uses an item
    • Conditions
    • Actions
      • Set ReplacedUnit_u = (Hero manipulating item)
      • Set TempForce = (Player Group (Owner of (Replacedunit_u)
      • Set TempPoint = (Position of (Hero manipulating item))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "1stTransform" using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "1stTransform"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "2ndTransform" using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "2ndTransform"
        • Then - Actions
          • Unit - Replace (ReplacedUnit_u) with a "FinalTransform" using The old unit's relative life and mana
        • Else - Actions
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
[/QUOTE]

About "This trigger" below its should be added to the last section before the "Last Part of Complete trigger" right

  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
    • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
    • Skip remaining actions
    • Else - Actions
"FinalUnitRank" <<< what should i change from this part trigger ???

  • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)

and the last question : is there any way to modify a stat of hero 2x stronger every time it change.
example : after the hero has transform to the "1st new form" the stats ( agi , Str, Int ) of "1st new form" will 2x stronger than the previous hero ( Normal Hero ) and if 1st new form change to "2nd new form" the stats of "2nd new form" will 2x stronger than the "1st new form" stats. So every time transform the stats will 2x stronger by using trigger ????
 
Level 9
Joined
Apr 23, 2010
Messages
312
BaseUnitRank should be the unit you start with when the game begins, or whatever the first unit you get in the game is.

The variable "TempForce" is a player group variable. Sorry, I thought I added that to the variables list, my bad!

"1stTransform" <<< we change it to the new form of unit right example change to Magina Same as the rest change it to another new form to right ( "2ndTransform" and "3rdTransform" ) ???
If you gave me a list of all the units you are planning on using for this trigger, and number them from 1 to last number of units, I could explain this easier.

about this new trigger below you made , is leakless right ? hmm that simplified trigger will it influence the existence of item ?? like maybe after transform the item will dispeared ???
Yes it's leakless, and as Maker said before, "Replace unit function gives the new unit the items and exp of the old unit. So you can remove all lines dealing with exp or items from that trigger." So there is no need (for the simplified trigger) to set the experience, item's or item charges, they will all just carry over to the new unit.

About "This trigger" below its should be added to the last section before the "Last Part of Complete trigger" right
Yes.

Don't change anything from the last part of the trigger. Those custom scripts are removing the location and player group leaks.

and the last question : is there any way to modify a stat of hero 2x stronger every time it change.
example : after the hero has transform to the "1st new form" the stats ( agi , Str, Int ) of "1st new form" will 2x stronger than the previous hero ( Normal Hero ) and if 1st new form change to "2nd new form" the stats of "2nd new form" will 2x stronger than the "1st new form" stats. So every time transform the stats will 2x stronger by using trigger ????
If you want to do that, we will have to take a step back and re-add the Strenth_int, Intelligence_int and Agility_int variables. It is fairly simple to add, just like the expereince we would be setting our new variables to the strength, intelligence and agility of the "ReplacedUnit_u" then once we change to the new form we would simple set strength, intelligence and agility all to 2x corresponding variable. Below is an example.
  • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
  • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
  • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
  • Hero - Modify Strength of (NewUnit_u): Set to (Strength_int x 2)
  • Hero - Modify Intelligence of (NewUnit_u): Set to (Intelligence_int x 2)
  • Hero - Modify Agility of (NewUnit_u): Set to (Agility_int x 2)
Here is the new simplified trigger, for adding double stats (if you want it).

Complete Variables List
Agility_int = Integer
Intelligence_int = Integer
Strength_int = Integer
ReplacedUnit_u = Unit
TempForce = Player Group
TempPoint = Point
UnitExperience_int = Integer
  • Replace Unit
  • Events
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • Set ReplacedUnit_u = (Hero manipulating item)
    • Set TempForce = (Player Group (Owner of (Replacedunit_u)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
      • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
      • Custom script: call DestroyForce(udg_TompForce)
      • Skip remaining actions
    • Else - Actions
    • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
    • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
    • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
    • Set TempPoint = (Position of (Hero manipulating item))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "BaseUnitRank"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "1stTransform" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "1stTransform"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "2ndTransform" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "2ndTransform"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "FinalTransform" using The old unit's relative life and mana
          • Else - Actions
      • Hero - Modify Strength of (Last Replaced Unit): Set to (Strength_int x 2)
      • Hero - Modify Intelligence of (Last Replaced Unit): Set to (Intelligence_int x 2)
      • Hero - Modify Agility of (Last Replaced Unit): Set to (Agility_int x 2)
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
 
Last edited:
Level 4
Joined
Aug 13, 2010
Messages
60
(Question 1 ) So which trigger is better "Complete trigger" or "Simplified" ???


(Question 2 ) hmm. "BaseUnitRank" << is made by using variable right ?? if it right what the variable/how to make it ?? i want any hero to be able to transform if the hero using the item. That mean any hero can use the item and any hero can transform

(Question 3 ) And "FInalUnitRank" << is made by using variable or Replace the "FInalUnitRank" to the "finaltransformation" ?
Example Final Form is "Archmage" so we replace the Word of "FinalUnitRank" to "Archmage"

(Question 4 ) then how about this trigger below , where should we put this trigger below if we want to add to your "Complete trigger" Type

  • If - Conditions
    • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
    • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
    • Skip remaining actions
    • Else - Actions

(Question 5 ) and for this trigger below if we want add this trigger to your "Complete Trigger" where should we put it ????

  • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
  • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
  • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
  • Hero - Modify Strength of (NewUnit_u): Set to (Strength_int x 2)
  • Hero - Modify Intelligence of (NewUnit_u): Set to (Intelligence_int x 2)
  • Hero - Modify Agility of (NewUnit_u): Set to (Agility_int x 2)


If you gave me a list of all the units you are planning on using for this trigger, and number them from 1 to last number of units, I could explain this easier.

oh here example : 1stTransform is TerrorBlade , 2ndTransform is Paladin , 3rdTtransform is Archmage
So. if we use the item the first transformation will be terror blade then used item again will transform to paladin and the last and final transform should be Archmage.
 
Level 9
Joined
Apr 23, 2010
Messages
312
I would recommend using the "Simplified" trigger, it's shorter and replace unit does all the replacing of experience and item's as Maker says.

BaseUnitRank is not a variable, that is supposed to be the unit you start out with, but if you want this to work for any hero we will change it up :)

And "FInalUnitRank" << is made by using variable or Replace the "FInalUnitRank" to the "finaltransformation" ?
Example Final Form is "Archmage" so we replace the name of "FinalUnitRank" to "Archmage"
Yup, that's correct.

If you still want to use the "Complete" trigger, it will look something like this with all the additions that the "Simplified" trigger has.

Complex Variables
Agility_int = Integer
Intelligence_int = Integer
Strength_int = Integer
Item_i = Item-Type Array
ItemCharges_int = Integer Array
NewUnit_u = Unit
ReplacedUnit_u = Unit
TempPoint = Point
UnitExperience_int = Integer
  • Replace Unit
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • Set ReplacedUnit_u = (Hero manipulating item)
      • Set TempForce = (Player Group (Owner of (ReplacedUnit_u)))
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "Archmage"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
      • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
      • Skip remaining actions
    • Else - Actions
      • Set TempPoint = (Position of (Hero manipulating item))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
      • Then - Actions
        • Set UnitExperience_int = (Hero experience of ReplacedUnit_u)
        • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
        • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
        • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
        • Set Item_i[0] = (Item-type of (Item carried by ReplacedUnit_u in slot 1))
        • Set Item_i[1] = (Item-type of (Item carried by ReplacedUnit_u in slot 2))
        • Set Item_i[2] = (Item-type of (Item carried by ReplacedUnit_u in slot 3))
        • Set Item_i[3] = (Item-type of (Item carried by ReplacedUnit_u in slot 4))
        • Set Item_i[4] = (Item-type of (Item carried by ReplacedUnit_u in slot 5))
        • Set Item_i[5] = (Item-type of (Item carried by ReplacedUnit_u in slot 6))
        • Set ItemCharges_int[0] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 1))
        • Set ItemCharges_int[1] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 2))
        • Set ItemCharges_int[2] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 3))
        • Set ItemCharges_int[3] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 4))
        • Set ItemCharges_int[4] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 5))
        • Set ItemCharges_int[5] = (Charges remaining in (Item carried by ReplacedUnit_u in slot 6))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • ((ReplacedUnit_u) is A Hero) Equal to True
            • (Unit-type of (ReplacedUnit_u)) Not equal to "TarrorBlade"
            • (Unit-type of (ReplacedUnit_u)) Not equal to "Paladin"
            • (Unit-type of (ReplacedUnit_u)) Not equal to "Archmage"
      • Then - Actions
        • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
        • For each (Integer A) from 1 to 6, do (Actions)
          • Loop - Actions
            • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
            • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "TerrorBlade" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
      • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "TerrorBlade"
      • Then - Actions
        • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
        • For each (Integer A) from 1 to 6, do (Actions)
          • Loop - Actions
            • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
            • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "Paladin" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
      • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (ReplacedUnit_u)) Equal to "Paladin"
      • Then - Actions
        • Hero - Set (ReplacedUnit_u) experience to 0, Hide level-up graphics
        • For each (Integer A) from 1 to 6, do (Actions)
          • Loop - Actions
            • Hero - Drop the item from slot (Integer A) of (ReplacedUnit_u)
            • Item - Remove (Last dropped item)
            • Unit - Hide (ReplacedUnit_u)
            • Unit - Remove (ReplacedUnit_u) from the game
            • Unit - Create 1 "Archmage" for (Owner of (ReplacedUnit_u)) at TempPoint facing Default building facing degrees
      • Else - Actions
      • Set NewUnit_u = (Last created unit)
      • Hero - Set NewUnit_u experience to UnitExperience_int, Hide level-up graphics
      • Hero - Modify Strength of (NewUnit_u): Set to (Strength_int x 2)
      • Hero - Modify Intelligence of (NewUnit_u): Set to (Intelligence_int x 2)
      • Hero - Modify Agility of (NewUnit_u): Set to (Agility_int x 2)
      • For each (Integer A) from 0 to 5, do (Actions)
        • Loop - Actions
        • Hero - Create Item_i[(Integer A)] and give it to NewUnit_u
        • Item - Set charges remaining in (Last created item) to ItemCharges_int[(Integer A)]
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
But again, I recommend using this instead.

Simplified Variables
Agility_int = Integer
Intelligence_int = Integer
Strength_int = Integer
ReplacedUnit_u = Unit
TempForce = Player Group
  • Replace Unit
  • Events
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • Set ReplacedUnit_u = (Hero manipulating item)
    • Set TempForce = (Player Group (Owner of (Replacedunit_u)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
      • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
      • Custom script: call DestroyForce(udg_TompForce)
      • Skip remaining actions
    • Else - Actions
    • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
    • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
    • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • ((ReplacedUnit_u) is A Hero) Equal to True
                • (Unit-type of (ReplacedUnit_u)) Not equal to "TarrorBlade"
                • (Unit-type of (ReplacedUnit_u)) Not equal to "Paladin"
                • (Unit-type of (ReplacedUnit_u)) Not equal to "Archmage"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "TarrorBlade" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "TarrorBlade"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "Paladin" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "Paladin"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "Archmage" using The old unit's relative life and mana
          • Else - Actions
      • Hero - Modify Strength of (Last Replaced Unit): Set to (Strength_int x 2)
      • Hero - Modify Intelligence of (Last Replaced Unit): Set to (Intelligence_int x 2)
      • Hero - Modify Agility of (Last Replaced Unit): Set to (Agility_int x 2)
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)
 
Level 4
Joined
Aug 13, 2010
Messages
60
Simplified Variables
Agility_int = Integer
Intelligence_int = Integer
Strength_int = Integer
ReplacedUnit_u = Unit
TempForce = Player Group
  • Replace Unit
  • Events
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • Set ReplacedUnit_u = (Hero manipulating item)
    • Set TempForce = (Player Group (Owner of (Replacedunit_u)
    • If - Conditions
      • (Unit-type of (ReplacedUnit_u)) Equal to "FinalUnitRank"
    • Then - Actions
      • Hero - Drop (Last created item) from (Last created unit)
      • Item - Remove (Last dropped item)
      • Player - Add "However much gold it cost" to (Owner of (ReplacedUnit_u)) Current gold
      • Player - Add "However much lumber it cost" to (Owner of (ReplacedUnit_u)) Current lumber
      • Game - Display to TempForce for 10.00 seconds the text: You cannot transform anymore, your already the top rank!
      • Custom script: call DestroyForce(udg_TompForce)
      • Skip remaining actions
    • Else - Actions
    • Set Strength_int = (Strength of (ReplacedUnit_u) (Exclude bonuses))
    • Set Intelligence_int = (Intelligence of (ReplacedUnit_u) (Exclude bonuses))
    • Set Agility_int = (Agility of (ReplacedUnit_u) (Exclude bonuses))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated) Equal to "YourItem"
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • ((ReplacedUnit_u) is A Hero) Equal to True
                • (Unit-type of (ReplacedUnit_u)) Not equal to "TarrorBlade"
                • (Unit-type of (ReplacedUnit_u)) Not equal to "Paladin"
                • (Unit-type of (ReplacedUnit_u)) Not equal to "Archmage"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "TarrorBlade" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "TarrorBlade"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "Paladin" using The old unit's relative life and mana
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (ReplacedUnit_u)) Equal to "Paladin"
          • Then - Actions
            • Unit - Replace (ReplacedUnit_u) with a "Archmage" using The old unit's relative life and mana
          • Else - Actions
      • Hero - Modify Strength of (Last Replaced Unit): Set to (Strength_int x 2)
      • Hero - Modify Intelligence of (Last Replaced Unit): Set to (Intelligence_int x 2)
      • Hero - Modify Agility of (Last Replaced Unit): Set to (Agility_int x 2)
    • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call DestroyForce(udg_TompForce)

So the New "simplified Trigger" you gave me is usable/activable by any hero right and not just 1 hero right ????
 
Level 9
Joined
Apr 23, 2010
Messages
312
Yes, this part in that trigger makes it so any hero besides the one it can turn into can start transforming.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((ReplacedUnit_u) is A Hero) Equal to True
        • (Unit-type of (ReplacedUnit_u)) Not equal to "TarrorBlade"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Paladin"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Archmage"
  • Then - Actions
    • Unit - Replace (ReplacedUnit_u) with a "TarrorBlade" using The old unit's relative life and mana
  • Else - Actions
 
Level 4
Joined
Aug 13, 2010
Messages
60
Well about this part of trigger Below. How about if we change the unit hero name by creating another copy of hero and change the name to better cool name to example :
*TerroBlade to Shadow Terror
*Paladin to Crusader
*AchMage to Supreme sorcerer


Before
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((ReplacedUnit_u) is A Hero) Equal to True
        • (Unit-type of (ReplacedUnit_u)) Not equal to "TarrorBlade"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Paladin"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Archmage"
  • Then - Actions
    • Unit - Replace (ReplacedUnit_u) with a "TarrorBlade" using The old unit's relative life and mana
  • Else - Actions


Then that part of trigger should be changed to like this ( below ) ???? or no need to change ????

After
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((ReplacedUnit_u) is A Hero) Equal to True
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Shadow Terror"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Crusader"
        • (Unit-type of (ReplacedUnit_u)) Not equal to "Supreme sorcerer"
  • Then - Actions
    • Unit - Replace (ReplacedUnit_u) with a "TarrorBlade" using The old unit's relative life and mana
  • Else - Actions
 
Last edited by a moderator:
Level 9
Joined
Apr 23, 2010
Messages
312
The name has nothing to do with it. You have to place a specific unit in those locations, in this case they would the unit with those names.

You would not need to change the trigger, just the names of the units :)

@Maker (or anyone else who knows), will replaced unit keep the unit ID the same?
 
Last edited:
Level 4
Joined
Aug 13, 2010
Messages
60
The name has nothing to do with it. You have to place a specific unit in those locations, in this case they would the unit with those names.

You would not need to change the trigger, just the names of the units :)

@Maker (or anyone else who knows), will replaced unit keep the unit ID the same?

Ok i will try it
 
Level 4
Joined
Aug 13, 2010
Messages
60
[Question 1 ] That custom script below is causing the trigger error or causing the trigger to disable. i dont know why. maybe because temppoint doesnt exist ???
  • Custom script: call RemoveLocation(udg_TempPoint)

[Question 2 ] i have made according your trigger but its only succesful transform to only 1 time 1 form. and i have used so many time of the item but its only causing transform 1 time at the first form and cannot transform to the 2nd form or 3rd form. ????

[Question 3 ] hmm if we change to anothers form why the skill is change too ???
example : paladin use the item and transform to blademaster and after that all paladin skill will be replaced by blademaster skill.
So... Can we make that even after the hero transform to another new form that the skill will remain as before ( the skill of hero that hasnt transform to any form )
>> Example : the hero that using the item is paladin and after the transformation into blademaster the skill is still the skill of paladin not blademaster skill. So even the hero transform to 2nd form or 3rd form the skill will still remain as before the hero take any transformation.

[Question 4 ] and i dont know why but my stats didnt become stronger after i transform.


Here the sample map that have a trigger i made according to the trigger you gave me. Please look at the map.
 

Attachments

  • Transformation Test.w3x
    18.9 KB · Views: 50
Level 9
Joined
Apr 23, 2010
Messages
312
[Question 1 ] That custom script below is causing the trigger error or causing the trigger to disable. i dont know why. maybe because temppoint doesnt exist ???
That's because you didn't create TempPoint variable.

[Question 2 ] i have made according your trigger but its only succesful transform to only 1 time 1 form. and i have used so many time of the item but its only causing transform 1 time at the first form and cannot transform to the 2nd form or 3rd form. ????

[Question 4 ] and i dont know why but my stats didnt become stronger after i transform.

I fixed these and attached your new map below.


[Question 3 ] hmm if we change to anothers form why the skill is change too ???
example : paladin use the item and transform to blademaster and after that all paladin skill will be replaced by blademaster skill.
So... Can we make that even after the hero transform to another new form that the skill will remain as before ( the skill of hero that hasnt transform to any form )
>> Example : the hero that using the item is paladin and after the transformation into blademaster the skill is still the skill of paladin not blademaster skill. So even the hero transform to 2nd form or 3rd form the skill will still remain as before the hero take any transformation.

The skills change because we are replacing the old unit with a new one, which has different skills. I'm not a 100% sure on how to do what you want here, i'll look into it though.
 

Attachments

  • Transformation Test.w3x
    20.3 KB · Views: 54
Level 4
Joined
Aug 13, 2010
Messages
60
Question 1 : hmm.. why i can still get scroll of god and even use it if i bought the scroll of god after i have already in the last form ( yeah although i cannot transform anymore because i already in the last form ) ???

so can you make it if i already in the last form and i bought it again i wont get the scroll of god and the money i use to bought it will adding back to me ( adding back money is already OK and not the problem any more. So.. the only problem is as i mention above )

here the map below. Sorry for the trouble i caused
 

Attachments

  • Transformation Test.w3x
    20.3 KB · Views: 49
Level 9
Joined
Apr 23, 2010
Messages
312
Question 1 : hmm.. why i can still get scroll of god and even use it if i bought the scroll of god after i have already in the last form ( yeah although i cannot transform anymore because i already in the last form ) ???
I'm not to sure what your talking about here. In the map I posted for you I made it so the last form cannot have the "Scroll of God". Anyways, I attached the updated version of your map.
 

Attachments

  • Transformation Test.w3x
    21 KB · Views: 39
Level 4
Joined
Aug 13, 2010
Messages
60
i dont why but after i transform to the last form. Any item i got , it will showing the message of "You are already in the last form. cannot transform any more" ???? . So the message not only appear for when you got the "Scroll of GOd" and the message will appear for any/all item i get.
 

Attachments

  • Transformation Test.w3x
    21 KB · Views: 46
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Here's the things with Metamorphosis for demonstration: Pastebin link

  • Transform
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set Unit = (Hero manipulating item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of MetAbil for (Triggering unit)) Less than 3
        • Then - Actions
          • Set Level = (Level of MetAbil for Unit)
          • Player - Enable MetAbil for (Triggering player)
          • Unit - Remove MetAbil from Unit
          • Unit - Add MetAbil to Unit
          • Unit - Set level of MetAbil for Unit to (Level + 1)
          • Unit - Order Unit to Night Elf Demon Hunter - Metamorphosis
          • Player - Disable Metamorphosis custom for (Triggering player)
        • Else - Actions
          • Set TempForce = (Player group((Triggering player)))
          • Set Point = (Position of Unit)
          • Item - Create GodItem at Point
          • Custom script: call RemoveLocation(udg_Point)
          • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call UnitRemoveAbility(udg_Unit, 'Bbsk')
 
Level 4
Joined
Aug 13, 2010
Messages
60
Here's the things with Metamorphosis for demonstration: Pastebin link

  • Transform
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set Unit = (Hero manipulating item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of MetAbil for (Triggering unit)) Less than 3
        • Then - Actions
          • Set Level = (Level of MetAbil for Unit)
          • Player - Enable MetAbil for (Triggering player)
          • Unit - Remove MetAbil from Unit
          • Unit - Add MetAbil to Unit
          • Unit - Set level of MetAbil for Unit to (Level + 1)
          • Unit - Order Unit to Night Elf Demon Hunter - Metamorphosis
          • Player - Disable Metamorphosis custom for (Triggering player)
        • Else - Actions
          • Set TempForce = (Player group((Triggering player)))
          • Set Point = (Position of Unit)
          • Item - Create GodItem at Point
          • Custom script: call RemoveLocation(udg_Point)
          • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call UnitRemoveAbility(udg_Unit, 'Bbsk')

hmm some trigger in the map are disable is that ok ??? or should i delete that disable trigger ???
and how to modify hero stats to 2x stronger every times succesfully transform ?

and about an ability called "Metamorphosis Custom" in ability editor is needed or not ??
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
and how to modify hero stats to 2x stronger every times succesfully transform ?


  • Transform
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set Unit = (Hero manipulating item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of MetAbil for (Triggering unit)) Less than 3
        • Then - Actions
          • Hero - Modify Strength of Unit: Add (Strength of Unit (Exclude bonuses))
          • Hero - Modify Agility of Unit: Add (Agility of Unit (Exclude bonuses))
          • Hero - Modify Intelligence of Unit: Add (Intelligence of Unit (Exclude bonuses))
          • Set Level = (Level of MetAbil for Unit)
          • Player - Enable MetAbil for (Triggering player)
          • Unit - Remove MetAbil from Unit
          • Unit - Add MetAbil to Unit
          • Unit - Set level of MetAbil for Unit to (Level + 1)
          • Unit - Order Unit to Night Elf Demon Hunter - Metamorphosis
          • Player - Disable Metamorphosis custom for (Triggering player)
        • Else - Actions
          • Set TempForce = (Player group((Triggering player)))
          • Set Point = (Position of Unit)
          • Item - Create GodItem at Point
          • Custom script: call RemoveLocation(udg_Point)
          • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call UnitRemoveAbility(udg_Unit, 'Bbsk')


and about an ability called "Metamorphosis Custom" in ability editor is needed or not ??

It is the ability used for the transformation, it is needed. It is assigned to the MetAbil variable in the initialization trigger.

Link
 
Level 4
Joined
Aug 13, 2010
Messages
60
i dont why when i copy it to another map for testing it, its failed. i Cant Transform to any form and only my stats doubling and i can bought it with unlimited amount. here the map please look at it TQ
NOte : I have copy all Unit , ability , trigger to another map.
 

Attachments

  • TestMap.w3x
    1.4 MB · Views: 38
Level 37
Joined
Mar 6, 2006
Messages
9,240
You're not running Tra trigger, thus the values are not set. Run the trigger at Map Initialization.

Also, update the Gets Item to this:


  • Last Transform Gets Item
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Godlike
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set TempForce = (Player group((Owner of (Hero manipulating item))))
      • Hero - Drop (Item carried by (Triggering unit) of type GodItem) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Selling unit) Not equal to No unit
        • Then - Actions
          • Player - Add 1000 to (Owner of (Triggering unit)) Current gold
          • Player - Add 500 to (Owner of (Triggering unit)) Current lumber
        • Else - Actions
      • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call DestroyForce(udg_TempForce)


It should then differentiate between picked up items and sold items.
 
Level 4
Joined
Aug 13, 2010
Messages
60
Hmm... is that ok to have two
  • Events
    • Map initialization
in 1 map ????

because ( example )

  • Events
    • Map initialization
<< first Map initialization is to run the Game but Event , Condition , And Action already have a variable/trigger. And is not allowed to add a new variable or trigger like this Below to First "Map initialization" That use to run the Game :
  • Actions
    • Set MetAbil = Metamorphosis custom
    • Set GodItem = Scroll of God
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Player - Disable Metamorphosis custom for (Player((Integer A)))
>>> SO can we make a new trigger with New "Map initialization" to run the Transformation Trigger within 1 Map , Will it causing error or lagg maybe ?????

>> or maybe there is another way without add this trigger to "Map initialization" but adding it somewhere maybe and still enable to do transformation ? ??
  • Actions
    • Set MetAbil = Metamorphosis custom
    • Set GodItem = Scroll of God
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Player - Disable Metamorphosis custom for (Player((Integer A)))

THis Trigger you show me

  • Last Transform Gets Item
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Godlike
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set TempForce = (Player group((Owner of (Hero manipulating item))))
      • Hero - Drop (Item carried by (Triggering unit) of type GodItem) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Selling unit) Not equal to No unit
        • Then - Actions
          • Player - Add 1000 to (Owner of (Triggering unit)) Current gold
          • Player - Add 500 to (Owner of (Triggering unit)) Current lumber
        • Else - Actions
      • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call DestroyForce(udg_TempForce)

has a little problem. I may not be able to buy a scroll of god again when iam already in the last Form ( Solved ) but why the money didnt adding back ???
its should Adding back my money when i want to buy it in the max form but when i change using the trigger you gave me , its just disable me to buy the Scroll of god if i have already in the max form but didnt adding back the money i spent to buy the Scroll.
 
Last edited:
Level 4
Joined
Aug 13, 2010
Messages
60
THis Trigger you show me

  • Last Transform Gets Item
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Godlike
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set TempForce = (Player group((Owner of (Hero manipulating item))))
      • Hero - Drop (Item carried by (Triggering unit) of type GodItem) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Selling unit) Not equal to No unit
        • Then - Actions
          • Player - Add 1000 to (Owner of (Triggering unit)) Current gold
          • Player - Add 500 to (Owner of (Triggering unit)) Current lumber
        • Else - Actions
      • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call DestroyForce(udg_TempForce)

has a little problem. I may not be able to buy a scroll of god again when iam already in the last Form ( Solved ) but why the money didnt adding back ???
its should Adding back my money when i buy it in the max form but when i change using the trigger you gave me , its just disable me to buy the Scroll of god if i have already in the max form but didnt adding back the money i spent to buy the Scroll.
so if i buy the scroll of god in the max form , i wont get the scroll but my money being consumed and didnt adding back
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
It should be buying unit.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Selling unit) Not equal to No unit
    • Then - Actions
      • Player - Add 1000 to (Owner of (Buying unit)) Current gold
      • Player - Add 1000 to (Owner of (Buying unit)) Current lumber
    • Else - Actions
 
Level 4
Joined
Aug 13, 2010
Messages
60
It should be buying unit.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Selling unit) Not equal to No unit
    • Then - Actions
      • Player - Add 1000 to (Owner of (Buying unit)) Current gold
      • Player - Add 1000 to (Owner of (Buying unit)) Current lumber
    • Else - Actions


Same as before. i have changed the trigger as you told me but the money and lumber that i spent to bought the scroll of god when in max form is still dont adding back. I dont know why ???

but if the trigger on "Last Transform gets item" i change it to to this Trigger below ( this trigger is the is the first trigger you gave me when this thread being created ) its completely work ( disable buying scroll on max form and adding back lumber and gold i spent to bbought a scroll of god )

and sorry but the transformation trigger you gave me is not permanent. After transformation complete and if the hero died and revive the hero will back to the original form before transformation except


  • Last Transform Gets Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Godlike
      • (Item-type of (Item being manipulated)) Equal to GodItem
    • Actions
      • Set TempForce = (Player group((Owner of (Hero manipulating item))))
      • Hero - Drop (Item carried by (Triggering unit) of type GodItem) from (Triggering unit)
      • Item - Remove (Last dropped item)
      • Player - Add 1000 to (Owner of (Triggering unit)) Current gold
      • Player - Add 500 to (Owner of (Triggering unit)) Current lumber
      • Game - Display to TempForce for 10.00 seconds the text: You are already the...
      • Custom script: call DestroyForce(udg_TempForce)
 
Last edited:
Status
Not open for further replies.
Top