- 好友
- 6
- 在线时间
- 0 小时
- 最后登录
- 2024-11-13
骑士
- UID
- 3398051
- 第纳尔
- 1841
- 精华
- 0
- 互助
- 48
- 荣誉
- 5
- 贡献
- 10
- 魅力
- 341
- 注册时间
- 2022-8-13
鲜花( 57) 鸡蛋( 0)
|
本帖最后由 ggfgfgf 于 2023-4-2 12:18 编辑
游戏中,国王都有100兵力上限加成,那么玩家自立也是国王,却没有这个dbuff
其实,兵力上限主要由script.py中两个脚本计算的,分别是:
script_game_get_party_companion_limit
和
script_party_get_ideal_size
script_party_get_ideal_size计算的是NPC和领主等的兵力上限,其中明显的一段
其中蓝色的是国王加兵的代码
#default limit is 10 for kingdom lords#领主默认上限为10
(assign, ":limit", 10),
#each (leadership level) gives 15 to limit#一级统御升15上限,原来是5,这里我改大了
(store_skill_level, ":skill", "skl_leadership", ":party_leader"),
(store_attribute_level, ":charisma", ":party_leader", ca_charisma),
(val_mul, ":skill", 15),#一级统御升15上限,原来是5,这里我改大了
(val_add, ":limit", ":skill"),
#each (charisma level) gives 1 to limit#一点魅力加1上限
(val_add, ":limit", ":charisma"),
#each (25 renown) gives 1 to limit#每25声望加1上限
(troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown),
(store_div, ":renown_bonus", ":troop_renown", 25),#每25声望加1上限
(val_add, ":limit", ":renown_bonus"),
#if this party is faction leader it takes additional 100 limit #是国王就加100上限
(try_begin),
(faction_slot_eq, ":faction_id", slot_faction_leader, ":party_leader"),
(val_add, ":limit", 100),
(try_end),
但是script_game_get_party_companion_limit才是计算玩家兵力上限的,其中并没有这段
当然,添加!
script.py 中找到script_game_get_party_companion_limit
修改为
#script_game_get_party_companion_limit:
# This script is called from the game engine when the companion limit is needed for a party.
# INPUT: arg1 = none
# OUTPUT: reg0 = companion_limit
("game_get_party_companion_limit",
[
(assign, ":troop_no", "trp_player"),#设置变量 ":troop_no" 为玩家
(assign, ":limit", 30),
(store_skill_level, ":skill", "skl_leadership", ":troop_no"),
(store_attribute_level, ":charisma", ":troop_no", ca_charisma),
(val_mul, ":skill", 15),#一级统御加15上限,改了(作乘法操作)
(val_add, ":limit", ":skill"),#修改上限(作加法操作)
(val_add, ":limit", ":charisma"),#一点魅力加1上限
##新增代码
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
(val_add, ":limit", 100),
(try_end),
##新增代码
(troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown),
(store_div, ":renown_bonus", ":troop_renown", 25),#每25声望加1上限
(val_add, ":limit", ":renown_bonus"),
(assign, reg0, ":limit"),
(set_trigger_result, reg0),
]),
注意不要把中文注释添加进去,没有申明UTF-8,编译会报错的
如果你实在想添加中文注释,请你在你需要添加的文件开头第一行添加 #coding=utf-8
OK!完成。
下面是解释:
(try_begin),
(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),#判断玩家是否自立,fac_player_supporters_faction已启用
(val_add, ":limit", 100), #启发自#script_activate_player_faction玩家自立是调用
(try_end),
##which below is second old code,that inabled #(store_troop_faction, ":faction_id", ":troop_no"), #获取玩家阵营 id(编号)
#(troop_get_slot, ":party_leader", ":faction_id", slot_faction_leader), #获取玩家阵营的国王编号
#(try_begin), #判断玩家是否为国王
# (neq, ":faction_id", "fac_player_faction"), #判断玩家是否没加入任何阵营,也没自立,是初始玩家阵营的国王
# (troop_slot_eq, ":troop_no", ":party_leader"), #玩家编号是否等于其阵营国王编号
# (val_add, ":limit", 100), #玩家是国王就加100兵力上限
#(try_end), #判断玩家是否为国王
##which below is old code
# (store_troop_faction, ":faction_id", ":troop_no"), #获取玩家阵营 id(编号)
# (faction_get_slot, ":party_leader", ":faction_id", slot_faction_leader), #获取玩家阵营的国王编号
# (try_begin),#判断玩家是否为国王
# (neg|faction_slot_eq, ":troop_no","fac_player_faction"),#判断玩家是否没加入任何阵营,也没自立,是初始玩家阵营的国王
# (faction_slot_eq, ":troop_no", slot_faction_leader, ":party_leader"),#玩家编号是否等于其阵营国王编号
# (val_add, ":limit", 100), #玩家是国王就加100兵力上限
# (try_end),#判断玩家是否为国王
##old code
|
评分
-
查看全部评分
鲜花鸡蛋殇垣 在2023-9-4 17:48 送朵鲜花 并说:感谢分享,我把它运用在 封邑兵临城下里。 幼稚园殺手 在2022-10-5 12:17 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下 半世尘埃 在2022-10-3 10:35 送朵鲜花 并说:我非常同意你的观点,送朵鲜花鼓励一下
|