全面战争:战锤2

全面战争:战锤2

Dogs of War: Cross-Faction Unit Recruitment + Mercenary Camps
sn0wsh00 2020 年 9 月 3 日 下午 6:42
Adding custom units
I've created some custom units and I would like to make those units selectable through this mod. The description mentions creating a submod, but how exactly do I do that?
< >
正在显示第 1 - 5 条,共 5 条留言
sn0wsh00 2020 年 9 月 10 日 下午 4:28 
I finally figured out how to add my custom units to this mod. To do this:

  1. I copied the LUA script from the Skavin Unit Pack and added that LUA file into <packfile name>/script/campaign/mod
  2. Then I modified the line race_name to a custom race, which, in my case, was named "Cheap Sea Guards"
  3. For the local localization_string_to_check, I set the value to "land_units_onscreen_name_cheap_sea_guards," which was my .loc name for that unit
  4. Finally, under the local units section, I added an entry for my custom unit's main_units name, which, in my case was "cheap_sea_guards"

You can download my custom units below:
https://drive.google.com/file/d/1DQxTiHFRDb59EVpksL8tKCljHmFGrHRt/view?usp=sharing

And you can see my LUA script below for those who want to use it as a template:
https://drive.google.com/file/d/1veoileCBux9olPsvwvFMBdj-4xsdpzaX/view?usp=sharing
最后由 sn0wsh00 编辑于; 2020 年 9 月 10 日 下午 4:30
prop joe  [开发者] 2020 年 9 月 13 日 上午 10:52 
hey, good job, that all looks correct
sn0wsh00 2020 年 9 月 16 日 下午 8:12 
I also managed to add a recruiting cost to my custom unit without it interfering with the costs of the other units. To do this:

  1. I added a LUA file inside the <packfile name>/script/campaign/mod/pj_dogs_of_war folder, which, in my case, I named unit_to_cost_cheap_sea_guards.lua
  2. Inside unit_to_cost_cheap_sea_guards.lua, I copied the unit to cost format of the original unit_to_cost.lua
  3. Back in pj_dogs_of_war_cheap_fast_sea_guards.lua in the script/campaign/mod/ folder, I added the following block of code:

    for unit_name, unit_cost in pairs(require("pj_dogs_of_war/unit_to_cost_cheap_sea_guards")) do PJDOW.unit_to_cost[unit_name] = unit_cost end

I've updated my previously posted pack file[drive.google.com] and LUA file[drive.google.com] to reflect this
最后由 sn0wsh00 编辑于; 2020 年 9 月 16 日 下午 8:18
Joangar_Wrathfal 2020 年 10 月 14 日 下午 6:50 
Any chance someone could make a stupid people friendly version?
Sp3rm Wh4le 2021 年 2 月 6 日 上午 3:45 
hey i know this sound cool and all that but can you make a video about that :)))
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50