How i modding right?

Hi at all modders,

I have some questions how to mod right. So this is my first one.

1. If i want to mod for example a something on a demigod, i have to find the right lua data in the dgdata.zip of the demigod an change some values if i want to make him stronger, or?

2. Shall the mod start with the structure Hook/mymod/whateverthestructurewasbefore/...?

3. In the mod must only the changed things and not the whole dgdata.zip, or?

4. How is the easyest way too find the right think i want? i mean not the search function too use for all finds for only one code snippet. So is the structure of the folders good, so i can find everything easy?

Hopefully these are not the basics questions and i got you on nervs, but i only found tuts for special mods lik item mod. So these are in genrall the right way to start with the project or?

Greez Bruttus

1,106 views 3 replies
Reply #1 Top

First you will want to setup a modfolder for your mod in: Demigod\bindata\mods\

Copy a mod_info.lua from another mod and change the values to describe your mod.  Generate a unique id for your mod (http://www.somacon.com/p113.php )

 

1. If i want to mod for example a something on a demigod, i have to find the right lua data in the dgdata.zip of the demigod an change some values if i want to make him stronger, or?

Those values are in dgdata.zip - \units\heroes.  Extract the files you want to edit and put them in a hook folder with the same path in your mod folder.

Example:

Demigod\bindata\mods\Skirmish_AI_v26m\hook\units\heroes\HDemon\HDemon_AIActions.lua

For .bp files you usually just have to make your changes and add a 'merge = true,' as value in the blueprint you changed. 

2. Shall the mod start with the structure Hook/mymod/whateverthestructurewasbefore/...?

You can also put files in the root of your mod and the game will load them and try to merge them as appropriate.  I haven't used this much, so not sure what the process is on these.

3. In the mod must only the changed things and not the whole dgdata.zip, or?

Mod only needs changed items.  dgdata.zip is still loaded.  Once it is done mods are loaded and if a mod changes an existing file, or parts of a file those parts are used in place of the original.

4. How is the easyest way too find the right think i want? i mean not the search function too use for all finds for only one code snippet. So is the structure of the folders good, so i can find everything easy?
 

Structure is pretty good.   Units folder and LUA folder generally have everything you would want to edit.   I extracted the dgdata.zip to a folder and use notepad++ to search in all the files to find what i need.

Reply #2 Top

The most important part is not overriding things you don't need to.  You should be starting with blank files, and only adding the functions or variables you need overridden.  Some functions can be hooked non-destructively, but you probably won't know or need to know how to do this at first, as long as you're only overriding the functions that you need changed, and not every other one in the file.

 

Read this post and those following it for instructions on how to change Abilities, Buffs, Items, and so forth in the best possible way.  It's pretty simple to do once you understand how it works, and takes a lot less copy-pasted code - most changes can be done in one line, instead of re-doing an entire blueprint.

This means that if you just want to change Demon Assassin's Warp Strike damage, don't copy the entire HDemon_Abilities.lua file, create a blank one in your mod's hook folder with the same directory structure (as Peppe demonstrated above), and only add one line for each changed damage value that will look something like:

Code: c++
  1. Ability.HDemonWarpStrike01.DamageAmt = 300

 

This post covers unit blueprints, which for Demigods, can change things like their base speed, starting stats, and weapon rate of fire.  Note that you don't have to create individual blueprint files for modding blueprints - just one mod_units.bp in your base mod directory can contain all of the unit blueprint changes, each changed unit consisting of a UnitBlueprint{} table with the BlueprintId value determining which unit it modifies.

You'll probably be mostly changing buffs and abilities however, since that's where Demigods get most of their capabilities from.  The unit blueprint just determines starting values.  This is not true with minions and creeps however, who get most of their capability from their unit blueprint (e.g. weapon damage, health, etc).

 

As for WHY you would want to do things like this, the most obvious reason is so your mod will play nicely with fix mods like the UberFix, so you can run both without either your mod being broken, or your mod breaking the UberFix.  I don't think anyone else has made a non-destructive mod for Demigod, so I can't really cite any other examples; the Skirmish AI mod only changes files related to the AI, so it's pretty safe from this problem.

 

If you have any questions about the best way to do a specific thing, don't hesitate to ask.

Reply #3 Top

Thank you for your help with my start questions :grin: .

I made me at work and made a little mod here . Hopefully i can work on much more mods^^.

Greez Bruttus-