• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Alternate Training

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
There is a condition which checks whether a unit is loaded into a transport. So maybe give that building an ability and tell the loaded units to exit and give them a chas ability which changes them into the upgrade. Depends how you want to work it.
 
Level 19
Joined
Jul 19, 2006
Messages
2,307
Call to Arms with modified unit-type?

No...

I mean there being like a footman unit icon on your barracks, and to train one you merely have to select a peasant within a limited range, or a peasant can be sent to that building to automatically be trained for a cost of gold. I want this to be universal so it can be used with any building and any unit outcome, as well as any cost.
 
  • Melee Initialization
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Footman
    • Actions
      • Set Unit0 = (Selling unit)
      • Set Point = (Position of Unit0)
      • Set Group = (Units within 600.00 of Point matching ((Unit-type of (Matching unit)) Equal to Peasant))
      • Unit Group - Pick every unit in (Random 1 units from Group) and do (Actions)
        • Loop - Actions
          • Set Unit = (Picked unit)
          • Unit - Turn collision for Unit Off
          • Unit - Order Unit to Move To Point
      • Trigger - Turn on Change Unit <gen>
      • Custom script: call RemoveLocation (udg_Point)
      • Custom script: call DestroyGroup (udg_Group)
  • Change Unit
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Point = (Position of Unit)
      • Set Point2 = (Position of Unit0)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Point and Point2) Less than or equal to 25.00
        • Then - Actions
          • Unit - Replace Unit with a Footman using The old unit's relative life and mana
        • Else - Actions
      • Custom script: call RemoveLocation (udg_Point)
      • Custom script: call RemoveLocation (udg_Point2)
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
1. Create unit-target spell (Chain Lightning, Channel, Storm Bolt etc...) with footman icon
2. Implement this trigger:
  • Train
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Your Ability>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current gold) Greater than or equal to <Gold Cost>
        • Then - Actions
          • Player - Set (Owner of (Triggering unit)) Current gold to (((Owner of (Triggering unit)) Current gold) - <Gold Cost>)
          • Unit - Replace (Target unit of ability being cast) with a Footman using The new unit's max life and mana
        • Else - Actions
 
Status
Not open for further replies.
Top