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

Units can't build/construct?

Status
Not open for further replies.
Level 1
Joined
Apr 18, 2010
Messages
2
I want to make a hero that can build stuff on top of using abilities etc,. but I cannot get him to construct anything once it's been placed on the map ready for construction. It just stays at low health. I've even tried using a peasant template but that didn't work either.

How do I get my units to build?
 
Level 5
Joined
Jul 12, 2007
Messages
113
I just tested it and you need to give your hero the 'Repair' ability. I dunno why but it seems this is needed to make your hero build the building and not just placing it. Please try it and then tell me if you got it to work.
 
Level 6
Joined
Mar 22, 2009
Messages
276
Or via triggering..
Create a dummy worker assuming that his rawcode is 'h000' .
Create a trigger for that event like:
  • Events
    • Unit - A unit Begins construction
  • Conditions
    • ((Triggering Unit) is a Hero) equal to true
  • Actions
    • Custom script: local location tmp_loc = GetUnitLoc(GetTriggerUnit())
    • Custom script: local unit bldg = GetConstructingStructure()
    • Custom script: local unit bldr = CreateNUnitsAtLoc( 1, 'h000', UnitOwner(GetTriggerUnit()), tmp_loc, bj_UNIT_FACING )
    • Custom script: call IssueTargetOrder( bldr, "repair", bldg )
    • Custom script: call RemoveLocation(tmp_loc)
    • Custom script: set bldg = null
    • Custom script: set bldr = null
and to remove the bldr after completing the structure.
  • Events
    • Unit - A unit Finishes construction.
  • Conditions
    • (Unit type of (Triggering Unit)) equal to DUMMYWORKER
  • Actions
    • Custom script: call KillUnit(GetTriggerUnit())
 
Status
Not open for further replies.
Top