Giter Site home page Giter Site logo

phundio-dota2 / dota-2-building-helper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oswynb/dota-2-building-helper

0.0 1.0 0.0 8.56 MB

:school: Library to help make RTS-style and Tower Defense custom games in Dota 2

License: GNU General Public License v3.0

JavaScript 12.87% CSS 1.29% Lua 85.83%

dota-2-building-helper's Introduction

Dota 2 Building Helper - Reborn

For the updated script codebase, head over https://github.com/MNoya/BuildingHelper

简体中文版说明

After various iterations, the dream of client-side particles is real, and Building Helper has now been fully updated for Panorama, allowing for building ghost and grid effects as well as providing all the core features you'd expect for building and builder management.

Contents

Core BH Features

  • Building placement with a building grid preview on the world
  • Queueing multiple buildings for individual workers
  • Basic support for an additional resource (Lumber)
  • Building cancel process, continuing the queue
  • Various construction behaviours: Self-Building, Builder-Inside, Repair-Required, Consumes-Builder.
  • Repairing buildings, with multiple builders being able to assist the process
  • Support for left-/right-click mouse callbacks and orders

Tech Tree Upgrades, Building Queue System, and More!

In addition to the construction-related features, you'll find a couple of systems to do very common things in RTS & TD games, which is unlocking different upgrades/researches and automatically enable them when the requirements are met.

Whenever a building starts channeling an ability with certain research time, a queue will be created using the item slots of the building, without any extra UI, and just requires that every ability also gets an item copy to be able to cancel at will any point of the queue.

Note: The following 2 systems were excluded from the basic library:

  • Unit production
  • Gather Gold/Lumber

If you are interested in said features, you can take a look at the DotaCraft repository

Installation

There are two ways to use this library. After downloading, you can either get the samplerts addon to see the features ingame, or if you have a pre-existing addon which you'd like to utilize Building Helper. I'll explain the necessary files and configuration for it.

SampleRTS Sandbox Addon

  1. Copy the entire content and game folders in your dota folder \Steam\SteamApps\common\dota 2 beta\.
  2. Start the workshop tools, you'll see samplerts in your list of addons.
  3. Launch the samplerts map, either through Hammer or copying and pasting dota_launch_custom_game samplerts samplerts into your console.

Adding Building Helper Scripts to Your Game Mode

There are multiple elements you'll need to incorporate for a successful implementation of this library:

  1. Panorama Content.
  • Merge the Panorama folder content\dota_addons\samplerts\panorama with the Panorama folder in your addon.
  • If you already have a <custom_ui_manifest.xml>, you'll have to add these lines to it:
 <CustomUIElement type="Hud" 	layoutfile="file://{resources}/layout/custom_game/scripts.xml" />
 <CustomUIElement type="Hud"  layoutfile="file://{resources}/layout/custom_game/resource.xml" />
 <CustomUIElement type="Hud"  layoutfile="file://{resources}/layout/custom_game/notifications.xml" />
  1. Lua Scripts
  • Go inside the \game\dota_addons\samplerts\scripts\vscripts folder and copy all the files excluding:
    • addon_game_mode.lua (Require all files and precache lines)
    • gamemode.lua (This contains necessary events and table initializations)
    • Change all the ocurrences of CustomGameMode to your own addon game mode class (orders.lua and the listeners/handlers copied from gamemode.lua)
  1. DataDriven Ability Examples.
  • BH abilities are already split to conveniently combine with Dota-2-ModKit. There are both essential abilities and ability examples in game\dota_addons\samplerts\scripts\npc.
  • Copy the sub folders abilities, items.
  • The other two folders (heroes and units) aren't necessary but contain important keys which will be explained later
  1. Particles
  • Copy the Building Helper compiled particles (vpcf_c) from game\dota_addons\samplerts\particles into your addon's game particle folder. You can also get the sources in same directory under content.
  1. Tech Tree
  • The requirements for the upgrade system are defined in the tech_tree.kv file inside the game\dota_addons\samplerts\scripts\kv folder. Copy it into your addon's scripts folder.

Grid and Model Ghost Options

In buildinghelper.lua, you will find these variables to control the properties of the ghost particles.

  • GRID_ALPHA: Defines the transparency of the ghost squares in Panorama
  • MODEL_ALPHA: Defines the transparency of both the ghost model in Panorama and Building Placed in Lua
  • RECOLOR_GHOST_MODEL: Whether to recolor the ghost model green/red or not
  • RECOLOR_BUILDING_PLACED: Whether to recolor the queue of buildings placed in Lua

Help, Bug Reports and Feature Requests

We can be reached through various ways:

*Create an issue on GitHub

Contributing

Contributing to this repo is absolutely welcomed. Building Helper's goal is to make Dota 2 a more compatible platform to create RTS-style and Tower Defense mods. It will take a community effort to achieve this goal.

If you implement any fix or feature you'd like to see it included in this library, make a pull request or make an issue with the necessary script changes.

Credits

  • Myll, original dev
  • BMD, helped figure out how to get mouse clicks in Flash. Made the particles in BH.
  • Perry, contributed to the old scaleform version
  • zed, contributed with old scaleform
  • snipplets, first panorama implementation and queue system
  • Noya, new release, updates and maintenance

Notes

If you're a new modder we highly recommend forking a new starter addon using D2ModKit program.

License

Building Helper is licensed under the GNU General Public license. If you use Building Helper in your mod, please state so in your credits.

dota-2-building-helper's People

Contributors

aerohand avatar archibaldy4prez avatar gitter-badger avatar ivanradanov avatar mnoya avatar musshorn avatar shrugtal avatar tidesofdark avatar xavierchn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.