- 好友
- 1
- 在线时间
- 0 小时
- 最后登录
- 2024-9-7
扈从
![Rank: 2](static/image/common/star_level1.gif) ![Rank: 2](static/image/common/star_level1.gif)
- UID
- 3588356
- 第纳尔
- 41
- 精华
- 0
- 互助
- 11
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 30
- 注册时间
- 2023-12-7
![](source/plugin/floweregg/images/flower.gif) 鲜花( 6) ![](source/plugin/floweregg/images/egg.gif) 鸡蛋( 0)
|
感谢东海,感谢编年史白菜和中文站的各位大佬让我学到了很多有用的东西
这只是一个简单的大体有错误,请大佬指出
破碎山河模组中的一个自己写的小小功能,不过还是非常感谢东海教了我这么多的
第一次发帖帖子可能看着有点不舒服
在module_game_menus.py
搜索trade_with_merchants
######################
("trade_with_merchants",
[
(party_slot_eq,"$current_town",slot_party_type, spt_town)
],
"Go to the marketplace.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu,"mnu_town_trade"),
(try_end),
]),
########################
在这一段的下面空一行写进
######代码#####
("jinko1",
[
],
"进 口 武 器 ",
[
(jump_to_menu, "mnu_jinko"),
]
),
######代码#######
添加完以后在module_game_menus.py最底下的】上面一行添加这一段
######代码#######
("jinko", 0,
"进 口 ",
"none", [],
[
("fanhui11", [],
"进 入 进 口 武 器 面 板 ",
[
(start_presentation, "prsnt_jinko"),
], ),
("fanhui", [],
"Continue",
[
(change_screen_return),
], ),
]),
######代码#######
添加完以后打开module_presentations.py
在module_presentations.py最底下的】上面一行添加这一段
###############代码########
("jinko", prsntf_manual_end_only, mesh_load_window, [
(ti_on_presentation_load, [
(try_begin),
(presentation_set_duration, 99999),
(set_fixed_point_multiplier, 1000),
(assign, ":pos_x", 30),
(assign, ":pos_y", 650),
(assign, ":offset_y", 30),
(create_button_overlay, reg1, "@_2万_5进_口_马_克_沁_"),
(position_set_x, pos1, ":pos_x"),
(position_set_y, pos1, ":pos_y"),
(overlay_set_position, reg1, pos1),
(assign, "$makqin", reg1),
##############
(val_sub, ":pos_y", ":offset_y"),
(create_button_overlay, reg1, "@_2万_5进_口_哈_奇_开_斯_重_机_枪_"),
(position_set_y, pos1, ":pos_y"),
(position_set_x, pos1, ":pos_x"),
(overlay_set_position, reg1, pos1),
(assign, "$92shi", reg1),
##############
(val_sub, ":pos_y", ":offset_y"),
(create_button_overlay, reg1, "@_2万_5进_口_mg08重_机_枪_"),
(position_set_y, pos1, ":pos_y"),
(position_set_x, pos1, ":pos_x"),
(overlay_set_position, reg1, pos1),
(assign, "$jinkomgo8", reg1),
##############
(val_sub, ":pos_y", ":offset_y"),
(create_button_overlay, reg1, "@_1万_8进_口_布_伦_轻_机_枪_"),
(position_set_y, pos1, ":pos_y"),
(position_set_x, pos1, ":pos_x"),
(overlay_set_position, reg1, pos1),
(assign, "$jinkobren_prone", reg1),
##############
(val_sub, ":pos_y", ":offset_y"),
(create_button_overlay, reg1, "@_1万_8进_口_苏_联_DP27_"),
(position_set_y, pos1, ":pos_y"),
(position_set_x, pos1, ":pos_x"),
(overlay_set_position, reg1, pos1),
(assign, "$jinkp", reg1),
##############
(val_sub, ":pos_y", ":offset_y"),
(create_button_overlay, reg1, "@_1万_8进_口_捷_克_式_机_枪_"),
(position_set_y, pos1, ":pos_y"),
(position_set_x, pos1, ":pos_x"),
(overlay_set_position, reg1, pos1),
(assign, "$jinkozb26_deployed", reg1),
(try_end),
]),
(ti_on_presentation_run, [
(try_begin),
(key_clicked, key_escape),
(presentation_set_duration, 0),
(try_end),
]),
######################################################个人理解#####
(ti_on_presentation_event_state_change, [
(try_begin),###开头 判断开始
(store_trigger_param_1, ":object"),#存储调用触发器时的第1个参数。
(eq, "$makqin", ":object"),
(try_begin),##########尝试开始
(store_troop_gold, ":wuqi", "trp_player"),############把玩家的金钱存入wuqi临时变量
(ge, ":wuqi", 25000),######wuqi临时变量=25000
(troop_remove_gold, "trp_player", 25000),##就扣除玩家25000
(troop_add_item, "trp_player","itm_jinkomakqin",1),##然后为玩家添加物品itm_jinkomakqin
(display_message, "@购_买_成 功 "),###并提示购买成功
(try_end),########结束
(lt, ":wuqi", 25000),##如果wuqi临时变量金钱数量小于25000
(display_message, "@你 没 有 钱 !"),#######提示你没有钱
(else_try),
(eq, ":object", "$92shi"),
(try_begin),
(store_troop_gold, ":wuqi1", "trp_player"),
(ge, ":wuqi1", 25000),
(troop_remove_gold, "trp_player", 25000),
(troop_add_item, "trp_player","itm_jinkhaqi",1),
(display_message, "@购_买_成 功 "),
(try_end),
(lt, ":wuqi1", 25000),
(display_message, "@你 没 有 钱 !"),
(else_try),
(eq, ":object", "$jinkomgo8"),
(try_begin),
(store_troop_gold, ":wuqi2", "trp_player"),
(ge, ":wuqi2", 25000),
(troop_remove_gold, "trp_player", 25000),
(troop_add_item, "trp_player","itm_jinkomgo8",1),
(display_message, "@购_买_成 功 "),
(try_end),
(lt, ":wuqi2", 25000),
(display_message, "@你 没 有 钱 !"),
######
(else_try),
(eq, ":object", "$jinkobren_prone"),
(try_begin),
(store_troop_gold, ":wuqi3", "trp_player"),
(ge, ":wuqi3", 18000),
(troop_remove_gold, "trp_player", 18000),
(troop_add_item, "trp_player","itm_jinkobren_prone",1),
(display_message, "@购_买_成 功 "),
(try_end),
(lt, ":wuqi3", 18000),
(display_message, "@你 没 有 钱 !"),
############
(else_try),
(eq, ":object", "$jinkp"),
(try_begin),
(store_troop_gold, ":wuqi4", "trp_player"),
(ge, ":wuqi4", 18000),
(troop_remove_gold, "trp_player", 18000),
(troop_add_item, "trp_player","itm_jinkp",1),
(display_message, "@购_买_成 功 "),
(try_end),
(lt, ":wuqi4", 18000),
(display_message, "@你 没 有 钱 !"),
##########
(else_try),
(eq, ":object", "$jinkozb26_deployed"),
(try_begin),
(store_troop_gold, ":wuqi5", "trp_player"),
(ge, ":wuqi5", 18000),
(troop_remove_gold, "trp_player", 18000),
(troop_add_item, "trp_player","itm_jinkozb26_deployed",1),
(display_message, "@购_买_成 功 "),
(try_end),
(lt, ":wuqi5", 18000),
(display_message, "@你 没 有 钱 !"),
(try_end),###结尾停止运行
])
]),
###############代码########
大佬就别喷了哈,本人新手写的不是很好有问题欢迎指出
顺便放几张我的模组破碎山河的模型图片
、
伪蒙古
东北抗ri联军
29军
加了补丁的衣服
|
|