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

Converting an enemy unit

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Hi!

I have made this trigger:

  • Convert Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Convert (Neutral Hostile)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Minion
          • (Unit-type of (Triggering unit)) Equal to Wraith
          • (Unit-type of (Triggering unit)) Equal to Villager (Male)
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Ent using The new unit's max life and mana
          • Unit - Change ownership of (Triggering unit) to Player 1 (Red) and Change color
        • Else - Actions
The spell "Convert" is based on Fireball.

The enemy has Minions and Wraiths and the Villagers are neutral units.
The caster of this spell is supposed to convert any of these units into friendly Ents.

But I can not get my trigger to work. How can I do this instead?
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
yes or conditions is needed

and also the change ownership cant be triggering unit as it alrdy have been replaced, isnt there any other "event unit type" which is used for replaced units?

even I'm not sure if this replaced unit event refers to GetTriggeringUnit()
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks for all your suggestions, I have tried it out but it does not work exactly as I want it to.

If I base this spell on Charm, would the trigger be a lot more simple?
Can anyone here please show me the complete trigger with Charm?
 
Try this

  • Convert Trigger
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Convert (Neutral Hostile)
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any condition is true
        • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Minion
        • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Wraith
        • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Villager (Male)
    • Then - Actions
    • Unit - Replace (Target Unit of Ability Being Cast) with a Ent using The new unit's max life and mana
    • Unit - Change ownership of (Last Replaced Unit) to Owner of (Triggering Unit) and Change color
    • Else - Actions
 
Thanks a lot! Since there might be many heros in the game for different players who has this spell, do you think this trigger will "bug" if many players casts this spell?

it will not bug since I used Owner of (Triggering unit), just don't put any wait in there... also you can move that Or-Condition into the conditions tab like this...

  • Convert Trigger
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Convert (Neutral Hostile)
    • Or - Any condition is true
      • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Minion
      • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Wraith
      • (Unit-type of (Target Unit of Ability Being Cast)) Equal to Villager (Male)
  • Actions
    • Unit - Replace (Target Unit of Ability Being Cast) with a Ent using The new unit's max life and mana
    • Unit - Change ownership of (Last Replaced Unit) to Owner of (Triggering Unit) and Change color
anyway, is it really only those 3 units that you can convert???
 
Level 10
Joined
Nov 5, 2008
Messages
536
anyway, is it really only those 3 units that you can convert???

The other side will have a similar spell that converts the other race units into their own. I thought of copy this trigger and then just replace all unit-types with their counter-parts.

But if I add more units later, would it be possible to remove the "conditions" and then the spell would be able to convert everything into Ents?

For some reason, no effect appears on the unit that I target with Charm. It looks a little odd when the unit vanishes and is replaced with a new one. Can some effects be added via triggers or would that be to complicated?
 
The other side will have a similar spell that converts the other race units into their own. I thought of copy this trigger and then just replace all unit-types with their counter-parts.

But if I add more units later, would it be possible to remove the "conditions" and then the spell would be able to convert everything into Ents?

For some reason, no effect appears on the unit that I target with Charm. It looks a little odd when the unit vanishes and is replaced with a new one. Can some effects be added via triggers or would that be to complicated?

yeah, if you remove the Or-conditions, every unit that is casted by the spell will be converted...

add the special effects into the location and not on the unit...

  • Actions
    • Set Temp_Loc = Position of (Target Unit of Ability Being Cast)
    • Special Effect - Add Special effect blah blah
    • Custom Script: call RemoveLocation(udg_Temp_Loc)
also its better to use the "Channel" ability as a dummy instead of firebolt or Charm...
 
Status
Not open for further replies.
Top