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

[Help] So, New Dota 2 Map Editor Came Out

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
I was wondering if anyone was pretty good with the Lua API. I'm staring at some of this stuff and I am just absolutely clueless as to what it means.

For example, here is a game event ->


  • antiaddiction_toast


As to what that actually does, I have no idea. I guess it keeps players from getting addicted to toast.


I saw a few functions for reading all of the contents from a file to a string and writing a string to a file, but saw nothing to synchronize that data. I assume that it's not synchronous, because that would be bad.


If you don't yet have the Dota 2 tools, here is how to get them


  • In your Steam Settings under Account you must opt into Steam Beta Updateparticipation.
  • Right-click on Dota 2 in Steam and select View Downloadable Content.
  • Check the box in the Install column next to Dota 2 Workshop Tools DLC.
  • Click Close. The required content will begin downloading.
  • In Steam, go to the Library menu and click on Tools and install the Dota 2 Workshop Tools Alpha.
  • Once the download is complete, the launcher is found in Steam under the Library menu under the Tools category. Double-click Dota 2 Workshop Tools to start.
Here is how to get to steam settings

Click the Steam icon in your dock. On the very top of the screen, there will be an Apple logo and then Steam in bold right next to it on the right. Click on Steam and then click on Preferences.
Here is getting started for Lua scripting

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/Getting_Started

engine events

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/Built-In_Engine_Events

API

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/API

and file structure

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Addon_Overview/File_Structure

as well as creating an addon

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Addon_Overview/Addon_Creation

publishing it

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Addon_Overview/Publishing_Addons

and playing it

https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Addon_Overview/Playing_Addons


So, are there any experts around at the moment that can tell me about some of these functions? There is certainly a lot to cover o_O. I'm curious about synchronization, packet events (I saw it), dedicated servers, file size limitations (I see nothing about it), setting data of ability (does the text file need to be modified, and is that text file only ever interpreted once?), and some other things too.


With the new Dota 2 map editor out as well as the Source 2 engine, I think that we can say farewell to Warcraft 3 and Starcraft 2, lol.


To end with, if you don't know Lua and would like to learn it, I recommend Programming in Lua 2nd Edition and the Lua 5.1 API. Dota 2 was verified by me to use Lua 5.1.
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
So, this just in...

The DotA 2 Lua distribution supports dynamic linking. What does this mean? You can write a c++ library and then load it up with Lua!

So this kind of opens the floodgates and allows you to do literally anything you want...

I don't believe there is a file size limit either. I mean.. jeezes o_O.


So DotA 2 supports machine code that works as a Lua library. I think this puts the final nail in the coffin for Warcraft 3 and Starcraft 2.

Have fun

edit
updates

os is replaced with nil
require is replaced with something that will only ever look at .lua files. If you try to put a . into it, it'll replace it with a \
package.path is not used

package.loadlib is still viable, but I have yet to get it to work

edit
cwd is C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota_ugc\game\bin\win64

io will work out of that location

lua path is C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\dota_ugc\game\dota_addons\ADDON_NAME\scripts\vscripts

require and so on will search from that directory



am I like the only person interested in this stuff? : (

what if I write a Lua tutorial? Will you all join then? : D
 
Last edited:
Level 11
Joined
Oct 11, 2012
Messages
711
I have installed everything needed and even start making a simple map. But the problem is the custom abilities, there are sample abilities given by Valve, but that's not enough. Moreover, I don't even know how to edit hero attributes. :( I know there are txt files to be edited, but that's also not enough! We need more details, such as hp regen or mana regen editing for a hero and stats gain when leveling up. :D

I hope there will be tutorials out soon.

+Rep, Nes

Edit: Lua tutorial is needed badly! Had you posted this earlier, I would not have bought the Lua book online. How about also making a tutorial about C++? (It seems its also needed for making dota2 abilities) LOL
 
Last edited:
Level 12
Joined
Mar 13, 2012
Messages
1,121
I had a first look at it and imho it bears more resemblance to a complete game development environment like Unity rather than wc3 world editor. Especially the scripting. There seems to be not really a central place but things are bound to entities(/prefabs?) and a lot of preexisting functions which are called automatically where you can write your implementation.

The LUA abilities, etc. confuses me a bit. I mean, you type in text files and there is no direct list which subelements are allowed /can be used in parent elements?

You can write a c++ library and then load it up with Lua!
Isnt that dangerous as hell?

Would like to hear Nestharus' or anyones opinion on those points who has some experience with it.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Ok, almost got DotA 2 working with Lua c++ extensions. I just need to somehow compile all of this in 64-bit format. I keep getting errors D:. I think it has something to do with the Lua dll being x86 even though it says 64. I might try compiling Lua myself to see if that fixes it.

Otherwise yes, very close to getting it to work. I had it trying to load, but it was 32 bit and the new DotA 2 is 64-bit, so threw an error. This means that it is indeed possible to run c++ out of DotA 2! o_O. This is an alpha release of the toolset though, so they very well may block my efforts : (


I'll start working on a Lua tutorial soon using Javascript. We'll need a Flash tutorial too. I don't know Flash atm, so I gotta learn it >.>. It'll take me like 3-5 hours (depending on size of API) to go through everything.
 
Level 11
Joined
Oct 11, 2012
Messages
711
Ok, almost got DotA 2 working with Lua c++ extensions. I just need to somehow compile all of this in 64-bit format. I keep getting errors D:. I think it has something to do with the Lua dll being x86 even though it says 64. I might try compiling Lua myself to see if that fixes it.

Otherwise yes, very close to getting it to work. I had it trying to load, but it was 32 bit and the new DotA 2 is 64-bit, so threw an error. This means that it is indeed possible to run c++ out of DotA 2! o_O. This is an alpha release of the toolset though, so they very well may block my efforts : (


I'll start working on a Lua tutorial soon using Javascript. We'll need a Flash tutorial too. I don't know Flash atm, so I gotta learn it >.>. It'll take me like 3-5 hours (depending on size of API) to go through everything.

Looking forward to it !
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
This might be interesting for some. That subreddit has also some other nice things.
Nestharus it would be cool if you could be more responsive to the questions of us other posters.
 
Status
Not open for further replies.
Top