一个小功能,很早前写的今天重弄了一下,还能改进
对一些刚起步开发,且替换了大地图的新MOD有用
即是将文本输出到日志里,然后复制粘贴到代码里,不用再边看游戏边写了
有啥问题评论留言…
使用须知:
1、需要打开编辑模式,否则无效
2、代码部分可以分为两种,红色标注的是设置坐标的,绿色是设置图标朝向的,根据自己需要添加
3、如使用设置图标的代码,需要将相关触发器中的 * (party_set_icon, "p_main_party" , "xxxx") *操作暂时注释掉
4、大地图鼠标右键点击目标单位,选择设置坐标,再次右键将目标单位设置到当前玩家部队所在处
5、大地图鼠标右键点击目标单位,选择设置图标,即将目标单位的图标应用至玩家部队之上,然后通过鼠标移动部队改变图标朝向,按1键输出文本到日志,2键选择默认图标,PgUp/PgDn键按顺序切换图标
6、在骑砍的根目录里找到 rgl_log 文本文档,找到输出的相关代码后,手动将 % 符号替换为 _ 下划线,然后粘贴到相关代码中
7、建议在英文模式下运行
注释部分即是新加的
1、script.py
搜索 game_context_menu_get_buttons
……………………………………………………………………
(try_begin),
(is_between, ":party_no", centers_begin, centers_end),
(context_menu_add_item, "@View notes", 1),
## LJY
(context_menu_add_item, "@Selection party", 3),
(context_menu_add_item, "@Selection party icon", 4),
## LJY
(else_try),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(gt, ":num_stacks", 0),
(party_stack_get_troop_id, ":troop_no", ":party_no", 0),
(is_between, ":troop_no", active_npcs_begin, active_npcs_end),
(context_menu_add_item, "@View notes", 2),
(try_end),
……………………………………………………………………
接着搜索 game_event_context_menu_button_clicked
("game_event_context_menu_button_clicked",
[(store_script_param, ":party_no", 1),
(store_script_param, ":button_value", 2),
(try_begin),
(eq, ":button_value", 1),
(change_screen_notes, 3, ":party_no"),
(else_try),
(eq, ":button_value", 2),
(party_stack_get_troop_id, ":troop_no", ":party_no", 0),
(change_screen_notes, 1, ":troop_no"),
## LJY
(else_try),
(eq, ":button_value", 3),
(assign, "$g_selection_party", ":party_no"),
(else_try),
(eq, ":button_value", 4),
(party_get_icon, ":party_icon", ":party_no"),
(party_set_icon, "p_main_party", ":party_icon"),
## LJY
(try_end),
]),
2、simple_triggers.py
在最下方 ] 内添加以下代码
## LJY
(0,
[
(set_show_messages, 0),
(try_begin),
(key_clicked, key_right_mouse_button),
(set_fixed_point_multiplier, 100),
(gt, "$g_selection_party", 0),
(party_get_position, pos1, "p_main_party"),
(party_set_position, "$g_selection_party", pos1),
(str_store_party_name, s1, "$g_selection_party"),
(party_get_position, pos2, "$g_selection_party"),
(position_get_x, ":selection_pos_x", pos2),
(position_get_y, ":selection_pos_y", pos2),
(store_div, reg1, ":selection_pos_x", 100),
(try_begin),
(lt, reg1, 0),
(store_mod, ":selection_pos_x2", ":selection_pos_x", 100),
(val_add, ":selection_pos_x2", 100),
(store_sub, ":selection_pos_x2", 100, ":selection_pos_x2"),
(store_mod, reg2, ":selection_pos_x2", 100),
(else_try),
(store_mod, reg2, ":selection_pos_x", 100),
(try_end),
(store_mod, ":curmod_x", reg2, 100),
(store_div, reg3, ":selection_pos_y", 100),
(try_begin),
(lt, reg3, 0),
(store_mod, ":selection_pos_y2", ":selection_pos_y", 100),
(val_add, ":selection_pos_y2", 100),
(store_sub, ":selection_pos_y2", 100, ":selection_pos_y2"),
(store_mod, reg4, ":selection_pos_y2", 100),
(else_try),
(store_mod, reg4, ":selection_pos_y", 100),
(try_end),
(store_mod, ":curmod_y", reg4, 100),
(party_get_slot, ":party_type", "$g_selection_party", slot_party_type),
(try_begin),
(eq, ":party_type", spt_town),
(store_sub, reg7, "$g_selection_party", "p_town_1"),
(val_add, reg7, 1),
(str_store_string, s2, "@(\"town%{reg7}\", \"{s1}\", icon%town|pf%town, no%menu, pt%none, fac%neutral, 0, ai%bhvr%hold, 0, "),
(else_try),
(eq, ":party_type", spt_castle),
(store_sub, reg7, "$g_selection_party", "p_castle_1"),
(val_add, reg7, 1),
(str_store_string, s2, "@(\"castle%{reg7}\", \"{s1}\", icon%castle%a|pf%castle, no%menu, pt%none, fac%neutral, 0, ai%bhvr%hold, 0, "),
(else_try),
(eq, ":party_type", spt_village),
(store_sub, reg7, "$g_selection_party", "p_village_1"),
(val_add, reg7, 1),
(str_store_string, s2, "@(\"village%{reg7}\", \"{s1}\", icon%village%a|pf%village, no%menu, pt%none, fac%neutral, 0, ai%bhvr%hold, 0, "),
(try_end),
(store_random_in_range, ":rotation", -360, 360),
(assign, reg8, ":rotation"),
(set_show_messages, 1),
(try_begin),
(ge, ":curmod_x", 10),
(ge, ":curmod_y", 10),
(display_log_message, "@{s2} ({reg1}.{reg2}, {reg3}.{reg4}), [],{reg8}),", 0xff0000),
(else_try),
(ge, ":curmod_x", 10),
(neg|ge, ":curmod_y", 10),
(display_log_message, "@{s2} ({reg1}.{reg2}, {reg3}.0{reg4}), [],{reg8}),", 0xff0000),
(else_try),
(neg|ge, ":curmod_x", 10),
(ge, ":curmod_y", 10),
(display_log_message, "@{s2} ({reg1}.0{reg2}, {reg3}.{reg4}), [],{reg8}),", 0xff0000),
(else_try),
(neg|ge, ":curmod_x", 10),
(neg|ge, ":curmod_y", 10),
(display_log_message, "@{s2} ({reg1}.0{reg2}, {reg3}.0{reg4}), [],{reg8}),", 0xff0000),
(try_end),
(assign, "$g_selection_party", 0),
(else_try),
(key_is_down, key_1),
(set_show_messages, 1),
(party_get_position, pos1, "p_main_party"),
(position_get_rotation_around_z, ":rotation_z", pos1),
(assign, reg1, ":rotation_z"),
(display_message, "@rotation = {reg1}."),
(else_try),
(key_is_down, key_2),
(assign, "$g_dest_icon", "icon_town"),
(party_set_icon, "p_main_party", "$g_dest_icon"),
(else_try),
(key_is_down, key_page_up),
(val_add, "$g_dest_icon", 1),
(party_set_icon, "p_main_party", "$g_dest_icon"),
(else_try),
(key_is_down, key_page_down),
(neg|eq, "$g_dest_icon", "icon_town"),
(val_sub, "$g_dest_icon", 1),
(party_set_icon, "p_main_party", "$g_dest_icon"),
(try_end),
]),
## LJY
|