1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Units can't build/construct?

Discussion in 'World Editor Help Zone' started by Ghangis24, Apr 18, 2010.

  1. Ghangis24

    Ghangis24

    Joined:
    Apr 18, 2010
    Messages:
    2
    Resources:
    0
    Resources:
    0
    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?
     
  2. Link_Iceblader

    Link_Iceblader

    Joined:
    Jul 12, 2007
    Messages:
    114
    Resources:
    0
    Resources:
    0
    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.
     
  3. reason 3

    reason 3

    Joined:
    Aug 11, 2009
    Messages:
    1,549
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Or an alternate solution ...you can edit a worker(example- change the model file-attack-damage-armor etc and make him like your hero--you only need to copy paste vaules) but at the end he will be able to build.
     
  4. swipe5weep

    swipe5weep

    Joined:
    Mar 22, 2009
    Messages:
    273
    Resources:
    0
    Resources:
    0
    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())
     
  5. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    627
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Just add the Repair ability to the unit, and it will work perfectly.