modding help request

hi, im looking for help in modding the game

ive tried searching the website for tools for modding the game, ive looked at the sticky link here

([Mod List] A Compilation Thread of Community made Mod´s)

that has information on how to mod and modding tools, but unless im missing something none of it helps, the only tool there is a deadlink

so could someone tell me what tool i need and what files it is i need to edit if i want to edit the demigods and their skills

help appreciated

2,968 views 3 replies
Reply #1 Top

You don't need any special tools - the moddable parts of the game are all dynamically-compiled lua code, so you only need a text editor.

 

Basically, you create a mod folder with a mod_info.lua (copying someone else's and changing the name, version and UID is the easiest way to learn how) and a \hook folder, where you place files to be merged ('hooked') with original Demigod files, using the same directory structure found \Demigod\dgdata.zip (where all the game's moddable code resides).

In other words, if you want to modify some of Oculus' abilities, you create a blank file called \units\heroes\HOculus\HOculus_Abilities.lua in your mod's hook folder, and only override the functions or ability blueprints you want to change (you can copy-paste these individually from the original file in dgdata.zip while you're starting out and they'll override the original function/blueprint, but this is not the best way to make a mod once you're accustomed to lua).

 

Reading this thread might help you understand how to add or edit items and abilities.  I made a post further down (here) about how to make these kinds of changes without breaking other mods, which is something you need to know how to do if for example you want be able to use the Uberfix or other people's item mods along with yours.

Changing unit blueprints (which control things like base damage, speed, etc) is a bit simpler, and can all be done in one mod_units.bp file in your mod's base folder.  I briefly touched on how to do this a few posts down in that thread; basically you need to specify the blueprint id (the unit's folder name in dgdata.zip, e.g. 'hoculus' for Oculus or 'hgsa01' for Regulus) and Merge = true inside the blueprint table, and then only specify the values you want changed, e.g. for changing Regulus' base speed:

 

Code: c++
  1. UnitBlueprint {
  2.     BlueprintId = "hgsa01",
  3.     Merge = true,
  4.     Physics = {
  5.         MaxSpeed = 6.3, # 6.0
  6.     },
  7. }

..you don't need to include anything else from the Physics table in the original blueprint, as anything not specified in your merge goes unchanged.  (The '#' is a comment character and everything after it on that line is not interpreted, which I used in this example to list the original value for that variable)

Reply #2 Top

Oh, and you also MUST have logging enabled if you want to be able to make serious changes or learn to mod by trial and error.  Make a new debugging shortcut for Demigod that you run whenever you're testing your mod.  Use these commandline switches:

/skipintro  (obvious)

/size x y  (runs in windowed mode, where x and y are the resolution of the window - use something smaller than your desktop, like 1024 768)

/showlog  (displays the log window, which is updated in realtime)

/log 'filename'  (dumps all log messages to a text file with the file path and name provided - I think the default directory with no path is the main demigod directory, but it could also be bindata or something like that)

 

The log will tell you the exact line number that the parse error(s) occurred on, however, that's the ENTIRE length of the joined file, which includes all hooked copies in mods.  This means you have to subtract the number of lines in the original file from the line number in the error message to get the actual line number of the error in YOUR file.  This assumes you aren't running any other mods that modify this file, which you should not be when debugging a mod.  If you are, you need to know their load order (are they before or after yours?) and subtract their total number of lines as well if they're loaded before yours

It's a really good idea to run only your mod when you're first debugging it.  Only introduce other mods once you need to test its compatibility with them.

Reply #3 Top

thanks for the reply miriyaka it is appreciated, very detailed,

i was hoping it would be a simple notepad editing job

i just wasnt sure where the files were to mod, and i wouldnt have known about the mod_info.lua or the hook folder, im going to go and try some modding, thanks again

 

 

well i got my changes done, but they only seem to work in single player, is there anyway in getting changes to heroes to work in tournament?