全面战争:战锤3

全面战争:战锤3

Tabletop Caps: Thrones of Decay
DrunkFlamingo  [开发者] 2022 年 4 月 12 日 下午 5:48
Unit Submod Code Template
NOTE: Starting with the last update, you should put these files in script/ttc/. Scripts inside of script/campaign/mod will still work, but won't be included in Mod Configuration Tool options.



Use this template to make your unit mod support tabletop caps.


local modded_units = { {"a_unit", "core"}, {"a_better_unit", "special", 2}, {"a_bester_unit", "rare", 1} } local ttc = core:get_static_object("tabletopcaps") if ttc then ttc.add_setup_callback(function() ttc.add_unit_list(modded_units) end) end


Place this inside a .lua script file in script/ttc/

This file is safe to include directly in other mods - the script will do nothing when TTC is not present.
最后由 DrunkFlamingo 编辑于; 2022 年 6 月 2 日 上午 10:48
< >
正在显示第 1 - 9 条,共 9 条留言
Laevatain II 2022 年 4 月 20 日 下午 5:06 
local wh3_units = {

----Cathay_radious
--Common
{"wh3_cat_jade_spear", "core"},
{"wh3_cat_peasa_sword", "core"},
{"wh3_cat_fear_archer", "core"},
{"wh3_cat_fear_axe", "core"},
{"wh3_cat_feat_halb", "core"},
--Special
{"wh3_cat_impe_sword", "special", 1},
{"wh3_cat_impe_spear", "special", 1},
{"wh3_cat_impe_rifle", "special", 1},
{"wh3_cat_tera", "special", 3},
--Rare
{"wh3_cat_sworn_heavy", "rare", 1},
{"wh3_cat_sworn_halb", "rare", 1},
{"wh3_cat_cele_sword", "rare", 1},
{"wh3_cat_saphire", "rare", 1},
{"wh3_cat_onyx", "rare", 1},
{"wh3_cat_onyx_cav", "rare", 1},
{"wh3_cat_front_sword", "rare", 1},
{"wh3_cat_front_spear", "rare", 1},
{"wh3_cat_front_cros", "rare", 1},
{"wh3_cat_front_bow", "rare", 1},
{"wh3_cat_sea_fire", "rare", 1},
{"wh3_cat_sea_repeat", "rare", 1},
{"wh3_cat_sea_mace", "rare", 1},
{"wh3_cat_sea_spear", "rare", 1},



local ttc = core:get_static_object("tabletopcaps")
if ttc then
ttc.add_setup_callback(function()
ttc.add_unit_list(wh3_units, true)
end)
end

all right, here is the code that i try to put into a new lua. it do not work, but when i copy this to your lua, put it under cathay park, works. those units from radious parks, I want do a Submod that can compatible to Radious unit park.
最后由 Laevatain II 编辑于; 2022 年 4 月 20 日 下午 5:11
DrunkFlamingo  [开发者] 2022 年 4 月 20 日 下午 5:45 
引用自 Laevatain II
local wh3_units = {

----Cathay_radious
--Common
{"wh3_cat_jade_spear", "core"},
{"wh3_cat_peasa_sword", "core"},
{"wh3_cat_fear_archer", "core"},
{"wh3_cat_fear_axe", "core"},
{"wh3_cat_feat_halb", "core"},
--Special
{"wh3_cat_impe_sword", "special", 1},
{"wh3_cat_impe_spear", "special", 1},
{"wh3_cat_impe_rifle", "special", 1},
{"wh3_cat_tera", "special", 3},
--Rare
{"wh3_cat_sworn_heavy", "rare", 1},
{"wh3_cat_sworn_halb", "rare", 1},
{"wh3_cat_cele_sword", "rare", 1},
{"wh3_cat_saphire", "rare", 1},
{"wh3_cat_onyx", "rare", 1},
{"wh3_cat_onyx_cav", "rare", 1},
{"wh3_cat_front_sword", "rare", 1},
{"wh3_cat_front_spear", "rare", 1},
{"wh3_cat_front_cros", "rare", 1},
{"wh3_cat_front_bow", "rare", 1},
{"wh3_cat_sea_fire", "rare", 1},
{"wh3_cat_sea_repeat", "rare", 1},
{"wh3_cat_sea_mace", "rare", 1},
{"wh3_cat_sea_spear", "rare", 1},



local ttc = core:get_static_object("tabletopcaps")
if ttc then
ttc.add_setup_callback(function()
ttc.add_unit_list(wh3_units, true)
end)
end

all right, here is the code that i try to put into a new lua. it do not work, but when i copy this to your lua, put it under cathay park, works. those units from radious parks, I want do a Submod that can compatible to Radious unit park.

You're missing a } to close the list and the last item in the list should not have a comma after it.
Laevatain II 2022 年 4 月 20 日 下午 6:06 
thanks you, so can I submit a Radious compatible mod?
Captain Freakout 2022 年 5 月 23 日 下午 4:57 
Hi DF and modders, I was hoping you could help. I'm a complete newbie at this and not very good, to be honest. I'm trying to make a submod for Stratovarius' Gnoblar Horde and Lost2Insanity's Yehtees. I added your code to the Yhetees and it worked; tried doing it as a "patch" and it worked. Then I tried doing it to SGH and it's not working, not even when I try to add it directly into the mod itself. I'm certain I have the unit names set down correctly, but maybe I'm doing something else wrong.

Here's the code:

local modded_units = {

----Gnoblar Horde by Stratovarius
--Common
{"str_gnoblar_shield", "core"},
{"str_gnoblar_dw", "core"},
{"str_gnoblar_groin", "core"},
{"str_gnoblar_flinger", "core"},
{"str_gnoblar_man", "core"},
{"str_gnoblar_squig", "core"},
{"str_gnoblar_squig_ror", "core"},
{"str_gnoblar_flinger_ror", "core"},
{"str_gnoblar_groin_ror", "core"},
{"str_gnoblar_man_ror", "core"},
--Special
{"str_gnoblar_lucky", "special", 1},
{"str_gnoblar_lucky_ror", "special", 1}
--Rare
{"str_gnoblar_boglar", "rare", 1},
{"str_gnoblar_blood", "rare", 1},
{"str_gnoblar_boglar_ror", "rare", 1},
{"str_gnoblar_blood_ror", "rare", 1}

}


local ttc = core:get_static_object("tabletopcaps")
if ttc then
ttc.add_setup_callback(function()
ttc.add_unit_list(modded_units)
end)
end

Is there something wrong with it? Or am I doing something else incorrectly?
DrunkFlamingo  [开发者] 2022 年 5 月 24 日 上午 5:03 
You're missing a comma on the file entry in the special list.

All entries except the last need a comma following them.
Captain Freakout 2022 年 5 月 24 日 上午 7:22 
Thank you so much!!
Cipher 2023 年 6 月 6 日 上午 6:10 
@DrunkFlamingo Hey, I've edited the script for my 'Asrai Unit Pack (Wood Elves)' and it works perfectly. I'm trying to decide if its better to make it a submod or have it integrated.

My question is; do you see any issues with leaving the script in the mod when not used alongside this mod? It seems fine on my end but thought I'd check with you just to be safe. Thanks :)
DrunkFlamingo  [开发者] 2023 年 6 月 6 日 上午 6:55 
As long as you used the template, containing the "if ttc then" line, there is no issue with you including the script in your mod.

If the person isn't using the mod, then "ttc" won't exist and the code inside the 'if ttc then' block will never be executed, so nothing will happen. If they are using TTC, then the integration will work.
Cipher 2023 年 6 月 6 日 上午 7:16 
Perfect, yep I've got the script containing the full template just with my own units added in.

Thanks for the quick answer, the script is well made too, I'm just overly cautious! I'll update it now and mention compatibility in the description. :steamthumbsup:
< >
正在显示第 1 - 9 条,共 9 条留言
每页显示数: 1530 50