• 🏆 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!

[Solved] Workers Won't Build After Morphing

Status
Not open for further replies.
Level 15
Joined
Sep 6, 2015
Messages
576
I've been trying to make a faultless morphing spell/trigger for morphing Peons into Fel Orc Peons, but so far all of the things I've tried had some faults.
First, I tried creating the spell using Destroyer Form as a base, but when I tried building with them, I place a building, the peon approaches and nothing happens, the building doesn't appear under construction.
After that, I tried creating the spell using Metamorphosis, but the same happened again.
Then, I tried with triggers of various kinds, and the only one that would somehow work was this one:
  • Pot Woodcutter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Invulnerability Potion (Woodcutter)
    • Actions
      • Wait 0.90 seconds
      • Unit - Replace (Casting unit) with a Mutant Woodcutter using The old unit's life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
But, when cast with more than one peon immediately, the trigger would ignore the required payment of lumber of the spell, and it would create one extra peon and sometimes also one dead peon. Note that the cast time of the spell in the trigger is 1.0 seconds, and the trigger would only work as it did if the wait time in it was less than, but nearly 1.0 seconds, but no matter what I tried I received either that strange bug or the spell not working at all.
I've also searched for an already-existing thread about this problem, but as far as I could see none exist.
Note also that the trigger works perfectly with non-morphing spells, but those can't be set to have payment for them, except with a trigger, but then the payment won't be shown normally in the tooltip.
 
Level 19
Joined
Jul 14, 2011
Messages
875
If I recall correctly, Casting unit was not local. Unlike Triggering unit (and other), Casting unit will return the last casting unit, and not remain attached to the trigger (for lack of better words). If you use Triggering unit the spell shouldn't cause problems when multiple are cast at the same time.
Also, wasnt there a couple of spells that requires gold/lumber in order to be cast? Exchange gold/lumber or something. I think it should enough to just use that one as a base.
 
Level 15
Joined
Sep 6, 2015
Messages
576
If I recall correctly, Casting unit was not local. Unlike Triggering unit (and other), Casting unit will return the last casting unit, and not remain attached to the trigger (for lack of better words). If you use Triggering unit the spell shouldn't cause problems when multiple are cast at the same time.
Also, wasnt there a couple of spells that requires gold/lumber in order to be cast? Exchange gold/lumber or something. I think it should enough to just use that one as a base.
Thanks, Triggering Unit worked, they don't duplicate or die any more, but the payment is still not there, so I'll just put the payment into a trigger with the same spell, since I can't think of any other spells which require payment, except the morphing ones at the moment.

Do the workers have the "Repair" ability? Without it they cannot build.
Yes, they do. It seems morphing abilities have some hard-coded feature which prevents builders casting them from constructing.
 
Level 11
Joined
Jun 2, 2013
Messages
613
There's actually an action underneath a "Unit - Issue Order with No Target" that you can use to order a peon to automatically harvest the nearest tree or gold resource. That Might work.

Here's what the trigger looks like:

  • Unit - Order (your unit) to Harvest Nearby Gold
*EDIT* Boy, that wasn't your question at all, my bad. Probably should have read everything.

Yes, they do. It seems morphing abilities have some hard-coded feature which prevents builders casting them from constructing.

On an actual topic related note, This is true, I had problems using bear form for multiple build trees. I actually had to manually replace the unit with a trigger, which I see you are doing. Also, your trigger may be working incorrectly because you are using a wait, which can generally cause problems when multiple units trigger it.
 
Level 15
Joined
Sep 6, 2015
Messages
576
After the upgrade that is required for the spell is researched. Here's my trigger for it which works with the spell based on Morph Into Destroyer:
  • Pot
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • ((Researched tech-type) Equal to Invincibility Potion) and (((Triggering player) controller) Equal to Computer)
    • Actions
      • Wait 1.00 seconds
      • Set UG = (Random 3 units from (Units owned by (Triggering player) of type Woodcutter))
      • If ((All units of UG are dead) Equal to True) then do (Do nothing) else do (Unit Group - Order UG to Undead Obsidian Statue - Morph Into Destroyer)
      • Custom script: call DestroyGroup(udg_UG)
      • Set UG = (Random 2 units from (Units owned by (Triggering player) of type Grunt))
      • If ((All units of UG are dead) Equal to True) then do (Do nothing) else do (Unit Group - Order UG to Undead Obsidian Statue - Morph Into Destroyer)
      • Custom script: call DestroyGroup(udg_UG)
      • Set UG = (Random 2 units from (Units owned by (Triggering player) of type Raider))
      • If ((All units of UG are dead) Equal to True) then do (Do nothing) else do (Unit Group - Order UG to Undead Obsidian Statue - Morph Into Destroyer)
      • Custom script: call DestroyGroup(udg_UG)
 
Status
Not open for further replies.
Top