Metamorphosis.

Ryuu

I am back with Chocolate (:
Reaction score
64
Hello, this is not a problem, but rather a 'how?' thread.
You see, my old unit has this ability x, but my new unit has the ability y.
y replaces x when the unit has morphed.
x and y are both supposed to have the same level.

But how do I make it that way?
 

Avaleirra

Is back. Probably.
Reaction score
128
Event
a unit starts the effect of an ability
condition
ability equal to Metamorphosis
actions
add " spell y" to triggering unit
set level of "spell y" to level of "spell x" for triggering unit
remove "spell y" from triggering unit



This is just a guess. Sorry for the freehand

avaleirra
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Nope, it doesnt work. For some reason when I morph the ability y didnt appear at all.
 

Avaleirra

Is back. Probably.
Reaction score
128
Really? Try adding spell y to the metamorphosis unit in the OE. Then remove the line
add ability spell y.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Nope, it doesnt work. For some reason regardless or not i have the ability x, y still appears. My main purpose was to put y the same level as x. But in this case, even when I did not have x on the old unit, the new unit still has y.
 

Joccaren

You can change this now in User CP.
Reaction score
54
Check if the level of x is greater than zero before adding y?
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Nope, still didn't work. y was added at all, regardless or not if x was level 1 or 100.

My current code:

Trigger:
  • spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of x for (Triggering unit)) Greater than 0
        • Then - Actions
          • Unit - Add y to (Triggering unit)
        • Else - Actions
      • Unit - Set level of y for (Triggering unit) to (Level of x for (Triggering unit))
      • Unit - Remove x from (Triggering unit)
 

Avaleirra

Is back. Probably.
Reaction score
128
put the last 2 actions under the "then-actions" although I'm not sure if that will do anything.
 

reyghost

New Member
Reaction score
14
Hi, Im not sure but I dont think you can use triggering unit to refer to the unit before morphing and after; as metamorphosis uses 2 diferent units, probably triggering unit will refer to the unit that actually casts the spell wich is the unit supposed to have x ability,but after that it morphs to another units,doesnt matter how similar to the first one it is,and therefore triggering unit will not refer to the desired one.
Anyone with more knowledge can confirm this ?
 

tooltiperror

Super Moderator
Reaction score
231
Metamorphosis replaces the unit with a new unit with the same items and relative health and mana, waits a period of time, then brings the original unit back.

I think you need to set the new unit in a variable somehow, but I'm not sure.
 

Avaleirra

Is back. Probably.
Reaction score
128
I thought of that, but apparently adding spell y to the metamorphosis unit in OE doesn't work.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Both units can be referred to by the same variables, it should. I remembered looking in to a map and seeing this ..
 

the_ideal

user title
Reaction score
61
I can't figure out why it doesn't work, but here's a troubleshooting tip:
Try to do this same thing but with an ability other than metamorphosis. If it works, then the problem is with the way Warcraft III "thinks" about metamorphosis. If it still doesn't work, then the problem is with the code.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Use "unit finishes casting an ability" instead, because that's the point at which it has changed into the new unit-type.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Right, I'm kind of a noob if you would excuse me.
Anyway, I've made this:

Trigger:
  • trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUIsetting Equal to 8000
        • Then - Actions
          • Set MUIsetting = 0
        • Else - Actions
          • Set MUIsetting = (MUIsetting + 1)
      • Set CastingUnit[MUIsetting] = (Triggering unit)
      • Set Level_of_x[MUIsetting] = (Level of x for CastingUnit[MUIsetting])


Trigger:
  • trigger 2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • For each (Integer A) from 1 to MUIsetting, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CastingUnit[(Integer A)] Equal to (Triggering unit)
            • Then - Actions
              • Unit - Add y to (Triggering unit)
              • Unit - Set level of y for (Triggering unit) to Level_of_x[(Integer A)]
            • Else - Actions


Unfortunately, that still didn't work.
y was added, regardless or not if x was level 1 or 100.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
This should do:

Trigger:
  • Morph Ability Swap
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of X for (Triggering unit)) Greater than 0
        • Then - Actions
          • Unit - Add Y to (Triggering unit)
          • Unit - Set level of Y for (Triggering unit) to (Level of X for (Triggering unit))
          • Unit - Remove X from (Triggering unit)
        • Else - Actions
          • Unit - Add X to (Triggering unit)
          • Unit - Set level of X for (Triggering unit) to (Level of Y for (Triggering unit))
          • Unit - Remove Y from (Triggering unit)
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Sorry to say once again, this didn't work.
Again, the ability y was added, regardless or not if the original unit has x.

However, Weep, I would like to question you on this point:

Code:
          Then - Actions
                Unit - Add Y to (Triggering unit)
                Unit - Set level of Y for (Triggering unit) to (Level of X for (Triggering unit))
                Unit - Remove X from (Triggering unit)
          Else - Actions
                Unit - Add Y to (Triggering unit)
                Unit - Set level of Y for (Triggering unit) to (Level of X for (Triggering unit))
                Unit - Remove X from (Triggering unit)

Did you realise that the Else - Actions is actually a repeat of Then - Actions ?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Sorry to say once again, this didn't work.
Again, the ability y was added, regardless or not if the original unit has x.
What kind of ability is X, unit or hero? Do both forms of the unit have it by default? (That is, does the unit retain X after morphing without the trigger?)

If not, it'll be harder to retain the unit's level of the ability.

Did you realise that the Else - Actions is actually a repeat of Then - Actions ?
My mistake. Edited.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> What kind of ability is X, unit or hero?

x is a hero ability. y is a unit ability.​

> Do both forms of the unit have it by default? (That is, does the unit retain X after morphing without the trigger?)

Yeah, it does without the trigger. However, that isn't my intention.​
 

vypur85

Hibernate
Reaction score
803
Code:
Event
 A unit starts the effect of an ability
Condition
 Ability being cast Equal to Metamorphosis
Actions
 If then else
  Condition
    Unit-type of (Triggering unit) Equal to YourNormalUnitType
  Then - Action
    Unit - Add Ability Y to (Triggering unit)
    Unit - Set level of Ability Y to level of Ability X...
    Player - Disable Ability X for (Owner of (Triggering unit))
  Else - Action
    Player - Enable Ability X for (Owner of (Triggering unit))
    Unit - Remove Ability Y to (Triggering unit)

Try this. Not sure if it works. It's MPI though. And while morphed, the Ability X cannot be leveled.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top