Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 3.93 KB

Buildings.md

File metadata and controls

49 lines (34 loc) · 3.93 KB

Creating Buildings

From the perspective of the plugin, buildings are just units with a few additional components. There's no special class for buildings; their setup has just been moved to this manual section because that many people would explicitly look for that. In fact, you can mix and match the setup outlined in this section with all of the other sections. This allows you to create truly deep gameplay, such as units that serve as resource sources, or produce other units.

Construction

  1. See Creating Units (Appearance, Health & Damage, Projectiles).
  2. Add an RTSConstructionSiteComponent and set the Construction Time.
  3. Set the Construction Costs to any resources required for construction.
  4. Set the Construction Cost Type to to Pay Immediately if all costs should be paid in full when starting construction, or to Pay Over Time for continuously paying costs (similar to Command & Conquer).
  5. Set the Refund Factor to the factor to multiply refunded resources with after cancelation.
  6. Set the Consumes Builders flag if builders working at the construction site should be destroyed when finished (similar to Zerg in StarCraft).
  7. Set Max Assigned Builders if you want to require a builder to work at the construction site to make progress, and/or to allow multi-building (similar to Age of Empires).
  8. Set the Progress Made Automatically and Progress Made Per Builder factors.
  9. Set Initial Health Percentage to a value between 0 and 1 to specify how much health the construction site should start with.
  10. Set the Start Immediately flag unless you want to trigger construction start from script.
  11. If you want to use grid-based building placement, set the Grid Width and Height.
  12. Set the Finished Sound to the sound cue to play when the construction is finished.
  13. Add an RTSContainerComponent if you want builders to enter the building site while building. Its capacity value will be automatically set at runtime to reflect Max Assigned Builders of the construction site.
  14. Add your RTSConstructionProgressBarWidgetComponent (see User Interface).

Production

  1. Add an RTSProductionComponent to any actors you want to be able to produce units or research technology.
  2. Add everything you want to produce or research to the Available Products for these factories.
  3. Set the Queue Count, specifying how many products can be produced in parallel.
  4. Set the Capacity Per Queue, specifying how many products can be produced one after another.
  5. Add your RTSProductionProgressBarWidgetComponent (see User Interface).

Note that, technically, producing units does not differ from researching technology. You can create actor blueprints without physical representation for each technology to research, and add them as products. Then, you can check whether any player owns an actor of that technology for checking a tech tree.

Resource Drain

  1. Add an RTSResourceDrainComponent for each type of building gatherers may return resources to.
  2. Set the resource types to all resources accepted by the drain.

Defense

  1. If your building has an RTSAttackComponent, check Preview Attack Range if you want the attack range of your building to be previewed while placing the building.

Vision

  1. At the RTSVisiblecomponent of your building, check Don't Hide After Seen if you want your building to stay visible even through for of war.

Projectile Impacts

  1. While your building is under attack, you might want to prevent every single projectile hitting the exact same location. You can add a RTSProjectileTargetComponent to your actor, and specify the Target Sockets to have projectile fly towards. These sockets have to be added to your static mesh using the built-in Unreal socket manager.
  2. If your building has multiple mesh components, add a component tag to the desired mesh component and specify the same tag at your RTSProjectileTargetComponent.