本帖最后由 vegetto 于 2024-9-3 13:58 编辑
一、前言 csgo这些fps游戏一般FPS第一人称射击镜头下,其实动画只有手臂和枪,俗称枪模动画,这样手臂和枪更细节的拉栓枪体装填等动画就可以实现。效果参考下面视频,但不全面,这个csgo模组的代码是直接取消战团身体模式的,后面代码示例将战团身体和cs枪模做了功能切换和衔接,并且由于csgo模型精度较高比较大,故后面我提供的百度云资源是CS经典的一款二战mod类型的枪模动画,DOD即胜利之日,也是比较出名的cs mod。
二、准备模型和sceneprop注册 准备好适配成骑砍顶点动画格式的cs系列枪模动画模型导入brf,module in注册brf,sceneprop py文件注册名称propskill0-propskill12共13个示例cs枪模动画,模型参考文件见百度云分享。 ----- 通过百度网盘分享的文件:cs dod胜利最后之日枪模动画模型(骑砍用).zip 提取码:7456 --来自百度网盘超级会员V5的分享 ----
三、场景控制 MT中需要使用的场景中加入如下代码, (0.000000, 0.000000, 0.000000, 条件
(set_fixed_point_multiplier, 1000), (get_player_agent_no, ":var_0"), (agent_get_position, pos1, ":var_0"), (agent_get_horse, ":var_1", ":var_0"), (assign, ":var_2", "spr_propskill13"), #用来判断刷枪模的prop到几,如果后续做到propskill20即第21个枪模动画,则这里可以改成spr_propskill20 (try_begin), (agent_slot_eq, ":var_0", 604, 0), #agent slot604表示是否启动cs枪模fps镜头动画模式,0为默认战团模式,1为cs模式 (store_random_in_range, ":var_3", "spr_propskill0", ":var_2"), #随机数判断切换枪模类型,你也可以改成按顺序循环切换,枪模切换当前名称储存在agent slot605 (agent_set_slot, ":var_0", 605, ":var_3"), (else_try), (agent_slot_eq, ":var_0", 604, 1), #下述else内容是判断每次切换cs枪模,强制没有选中而刷出的其他枪模的模型影身 (try_for_range, ":var_4", "spr_propskill0", ":var_2"), (neg|agent_slot_eq, ":var_0", 605, ":var_4"), (scene_prop_get_num_instances, ":var_5", ":var_4"), (try_for_range, ":var_6", 0, ":var_5"), (scene_prop_get_num_instances, ":var_7", ":var_4", ":var_6"), (scene_prop_set_visibility, ":var_7", 0), (try_end), (try_end), (try_end), (try_begin), (agent_slot_eq, ":var_0", 601, 0), #agent slot 601表示是否处于不适合用cs枪模模式的状态,比如因为mod有飞行等功能,会影响视角,此时强制slot为1,不允许去切换cs模式 (eq, ":var_1", -1), #上马的时候不允许使用cs模式,只有无马才可以 (try_begin), (agent_slot_eq, ":var_0", 604, 0), (key_clicked, key_v), #根据前置条件,按键盘v键切换cs模式,开启 (agent_set_slot, ":var_0", 604, 1), (try_for_range, ":var_8", 0, 4), (agent_get_item_slot, ":var_9", ":var_0", ":var_8"), (neg|eq, ":var_9", -1), (neg|eq, ":var_9", "itm_longer_falchion"), (agent_unequip_item, ":var_0", ":var_9"), (try_end), (agent_equip_item, ":var_0", "itm_10_bullets_pack"), (agent_equip_item, ":var_0", "itm_rusty_mosin_nagant"), (agent_equip_item, ":var_0", "itm_longer_falchion"), (agent_set_wielded_item, ":var_0", "itm_longer_falchion"), #cs模式状态下装备近战物品,避免受到原有远程武器干扰,此外重制一个武器弹药界面及准星界面见后一个模块。 (else_try), (agent_slot_eq, ":var_0", 604, 1), (key_clicked, key_v), #根据前置条件,按键盘v键切换cs模式,关闭 (agent_set_slot, ":var_0", 604, 0), (try_end), (try_end), (try_begin), (this_or_next|key_clicked, key_tilde), #判断一些影响cs枪模真实性的操作,一旦使用,强制关闭cs模式 (this_or_next|key_clicked, key_t), (key_clicked, key_y), (agent_set_slot, ":var_0", 604, 0), (agent_set_slot, ":var_0", 606, 0), (try_end), (try_begin), (neg|is_camera_in_first_person), #不在第一人称且开启cs模式判断的slot604为1时且不骑马,则玩家战团身体模型隐身 (agent_slot_eq, ":var_0", 604, 1), (eq, ":var_1", -1), (agent_set_visibility, ":var_0", 0), (else_try), (agent_set_visibility, ":var_0", 1), #否则玩家战团身体显形,然后其他枪模动画模型隐身。 (try_for_range, ":var_4", "spr_propskill0", ":var_2"), (scene_prop_get_num_instances, ":var_5", ":var_4"), (try_for_range, ":var_6", 0, ":var_5"), (scene_prop_get_instance, ":var_7", ":var_4", ":var_6"), (scene_prop_set_visibility, ":var_7", 0), (try_end), (try_end), (try_end), (try_begin), (agent_get_slot, ":var_10", ":var_0", 606), #slot606是一个根据切换枪滚轮后自动1-50变化的延时用数据,在延时一段时间处理枪模动画的切换类型。 (try_begin), (eq, ":var_10", 0), (else_try), (is_between, ":var_10", 1, 50), (store_add, ":var_11", ":var_10", 1), (agent_set_slot, ":var_0", 606, ":var_11"), (eq, ":var_11", 20), (agent_set_slot, ":var_0", 604, 1), (try_end), (try_end), (agent_slot_eq, ":var_0", 604, 1), #这里接下来是正式判断cs枪模的一系列行为。 (agent_get_slot, ":var_12", ":var_0", 605), (try_begin), (scene_prop_get_num_instances, ":var_13", ":var_12"), (eq, ":var_13", 0), (copy_position, pos2, pos1), (set_spawn_position, pos2), (spawn_scene_prop, ":var_12"), (scene_prop_set_visibility, reg0, 0), (agent_set_slot, ":var_0", 608, 30), (try_begin), (eq, ":var_12", "spr_propskill0"), #刷出spr_propskill0-12这13个cs枪模,并且立即初始化设置相应的枪模属性,都是共性的,我只注释一个 (scene_prop_set_slot, reg0, 301, 10), #枪模动画的待机开始动画帧 (scene_prop_set_slot, reg0, 302, 1200), #枪模动画的待机结尾动画帧 (scene_prop_set_slot, reg0, 303, 1210), #枪模动画的开枪开始动画帧 (scene_prop_set_slot, reg0, 304, 1860), #枪模动画的开枪结尾动画帧 (scene_prop_set_slot, reg0, 305, 2540), #枪模动画的换弹开始动画帧 (scene_prop_set_slot, reg0, 306, 3490), #枪模动画的换弹结尾动画帧 (scene_prop_set_slot, reg0, 307, 3500), #枪模动画的换枪开始动画帧 (scene_prop_set_slot, reg0, 308, 3800), #枪模动画的换枪结尾动画帧 (scene_prop_set_slot, reg0, 309, 2400), #枪模待机动画帧数的播放速度 (scene_prop_set_slot, reg0, 310, 1600), #枪模开枪动画帧数的播放速度 (scene_prop_set_slot, reg0, 311, 1800), #枪模换弹动画帧数的播放速度 (scene_prop_set_slot, reg0, 312, 1800), #枪模换枪动画帧数的播放速度 (scene_prop_set_slot, reg0, 313, 0), #判断是单发枪还是连发枪,0为单发,1为连发 (else_try), (eq, ":var_12", "spr_propskill1"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 800), (scene_prop_set_slot, reg0, 303, 3090), (scene_prop_set_slot, reg0, 304, 3200), (scene_prop_set_slot, reg0, 305, 810), (scene_prop_set_slot, reg0, 306, 1910), (scene_prop_set_slot, reg0, 307, 1920), (scene_prop_set_slot, reg0, 308, 3000), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 300), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill2"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 280), (scene_prop_set_slot, reg0, 303, 6780), (scene_prop_set_slot, reg0, 304, 8660), (scene_prop_set_slot, reg0, 305, 10540), (scene_prop_set_slot, reg0, 306, 11930), (scene_prop_set_slot, reg0, 307, 580), (scene_prop_set_slot, reg0, 308, 870), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 3000), (scene_prop_set_slot, reg0, 311, 3600), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill3"), (scene_prop_set_slot, reg0, 301, 1970), (scene_prop_set_slot, reg0, 302, 2840), (scene_prop_set_slot, reg0, 303, 300), (scene_prop_set_slot, reg0, 304, 500), (scene_prop_set_slot, reg0, 305, 600), (scene_prop_set_slot, reg0, 306, 1650), (scene_prop_set_slot, reg0, 307, 1660), (scene_prop_set_slot, reg0, 308, 1950), (scene_prop_set_slot, reg0, 309, 5000), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 3600), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill4"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 600), (scene_prop_set_slot, reg0, 303, 3180), (scene_prop_set_slot, reg0, 304, 3400), (scene_prop_set_slot, reg0, 305, 610), (scene_prop_set_slot, reg0, 306, 2150), (scene_prop_set_slot, reg0, 307, 2160), (scene_prop_set_slot, reg0, 308, 2570), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill5"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 580), (scene_prop_set_slot, reg0, 303, 2000), (scene_prop_set_slot, reg0, 304, 2700), (scene_prop_set_slot, reg0, 305, 2710), (scene_prop_set_slot, reg0, 306, 3750), (scene_prop_set_slot, reg0, 307, 3760), (scene_prop_set_slot, reg0, 308, 4240), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 1600), (scene_prop_set_slot, reg0, 311, 1800), (scene_prop_set_slot, reg0, 312, 1800), (scene_prop_set_slot, reg0, 313, 0), (else_try), (eq, ":var_12", "spr_propskill6"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 600), (scene_prop_set_slot, reg0, 303, 3180), (scene_prop_set_slot, reg0, 304, 3400), (scene_prop_set_slot, reg0, 305, 610), (scene_prop_set_slot, reg0, 306, 2150), (scene_prop_set_slot, reg0, 307, 2160), (scene_prop_set_slot, reg0, 308, 2570), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill7"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 1200), (scene_prop_set_slot, reg0, 303, 3600), (scene_prop_set_slot, reg0, 304, 3670), (scene_prop_set_slot, reg0, 305, 1210), (scene_prop_set_slot, reg0, 306, 2430), (scene_prop_set_slot, reg0, 307, 2440), (scene_prop_set_slot, reg0, 308, 2980), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill8"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 1200), (scene_prop_set_slot, reg0, 303, 3250), (scene_prop_set_slot, reg0, 304, 3500), (scene_prop_set_slot, reg0, 305, 1210), (scene_prop_set_slot, reg0, 306, 2460), (scene_prop_set_slot, reg0, 307, 2470), (scene_prop_set_slot, reg0, 308, 2960), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill9"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 800), (scene_prop_set_slot, reg0, 303, 2280), (scene_prop_set_slot, reg0, 304, 2500), (scene_prop_set_slot, reg0, 305, 810), (scene_prop_set_slot, reg0, 306, 1910), (scene_prop_set_slot, reg0, 307, 1920), (scene_prop_set_slot, reg0, 308, 2260), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill10"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 600), (scene_prop_set_slot, reg0, 303, 2600), (scene_prop_set_slot, reg0, 304, 2700), (scene_prop_set_slot, reg0, 305, 610), (scene_prop_set_slot, reg0, 306, 1750), (scene_prop_set_slot, reg0, 307, 1760), (scene_prop_set_slot, reg0, 308, 2050), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill11"), (scene_prop_set_slot, reg0, 301, 10), (scene_prop_set_slot, reg0, 302, 700), (scene_prop_set_slot, reg0, 303, 2600), (scene_prop_set_slot, reg0, 304, 2850), (scene_prop_set_slot, reg0, 305, 710), (scene_prop_set_slot, reg0, 306, 1960), (scene_prop_set_slot, reg0, 307, 1970), (scene_prop_set_slot, reg0, 308, 2310), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 400), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 1), (else_try), (eq, ":var_12", "spr_propskill12"), (scene_prop_set_slot, reg0, 301, 110), (scene_prop_set_slot, reg0, 302, 320), (scene_prop_set_slot, reg0, 303, 10), (scene_prop_set_slot, reg0, 304, 100), (scene_prop_set_slot, reg0, 305, 330), (scene_prop_set_slot, reg0, 306, 1710), (scene_prop_set_slot, reg0, 307, 1730), (scene_prop_set_slot, reg0, 308, 1990), (scene_prop_set_slot, reg0, 309, 2400), (scene_prop_set_slot, reg0, 310, 1200), (scene_prop_set_slot, reg0, 311, 2400), (scene_prop_set_slot, reg0, 312, 2400), (scene_prop_set_slot, reg0, 313, 0), (try_end), (try_end), (assign, ":var_14", ":var_12"), (scene_prop_get_num_instances, ":var_15", ":var_14"), (try_for_range, ":var_16", 0, ":var_15"), (scene_prop_get_instance, ":var_17", ":var_14", ":var_16"), (scene_prop_get_slot, ":var_18", ":var_17", 301), (scene_prop_get_slot, ":var_19", ":var_17", 302), (scene_prop_get_slot, ":var_20", ":var_17", 303), (scene_prop_get_slot, ":var_21", ":var_17", 304), (scene_prop_get_slot, ":var_22", ":var_17", 305), (scene_prop_get_slot, ":var_23", ":var_17", 306), (scene_prop_get_slot, ":var_24", ":var_17", 307), (scene_prop_get_slot, ":var_25", ":var_17", 308), (scene_prop_get_slot, ":var_26", ":var_17", 309), (scene_prop_get_slot, ":var_27", ":var_17", 310), (scene_prop_get_slot, ":var_28", ":var_17", 311), (scene_prop_get_slot, ":var_29", ":var_17", 312), (scene_prop_get_slot, ":var_30", ":var_17", 313), (prop_instance_get_current_deform_frame, ":var_35", ":var_17"), (try_begin), (neg|is_camera_in_first_person), (agent_slot_eq, ":var_0", 604, 1), (eq, ":var_1", -1), (agent_set_visibility, ":var_0", 0), (scene_prop_set_visibility, ":var_17", 1), (else_try), (agent_set_visibility, ":var_0", 1), (scene_prop_set_visibility, ":var_17", 0), (try_begin), (neg|gt, ":var_35", ":var_19"), (ge, ":var_35", ":var_18"), (else_try), (prop_instance_deform_in_range, ":var_17", ":var_18", ":var_19", ":var_26"), (try_end), (try_end), (try_begin), (copy_position, pos2, pos1), (position_move_z, pos2, 120), (copy_position, pos3, pos2), (mission_cam_get_position, pos4), (position_copy_rotation, pos3, pos4), (try_begin), (key_is_down, key_s), (assign, ":var_38", 1), (else_try), (assign, ":var_38", 5), (try_end), (prop_instance_animate_to_position, ":var_17", 3, ":var_38"), #这段是让选择使用的枪模动画模型跟随玩家坐标及镜头方向,由于animate有移动延迟,所以按s键时提高移动速度,避免手臂后面露出来穿帮 (try_end), (try_begin), (neg|61), (agent_slot_eq, ":var_0", 604, 1), (eq, ":var_1", -1), (try_begin), (key_is_down, key_left_mouse_button), #下面这段是判断开枪状态使用的枪模动画 (agent_get_ammo, ":var_39", ":var_0", 1), (try_begin), (neg|gt, ":var_35", ":var_21"), (ge, ":var_35", ":var_20"), (else_try), (prop_instance_deform_in_range, ":var_17", ":var_20", ":var_21", ":var_27"), (try_end), (else_try), (eq, ":var_35", ":var_21"), (prop_instance_deform_in_cycle_loop, ":var_17", ":var_18", ":var_19", ":var_26"), (try_end), (try_begin), #下面这段是分别根据是单发枪还是连发枪发射子弹 (copy_position, pos4, pos3), (position_move_y, pos4, 150), (try_begin), (eq, ":var_30", 0), (eq, ":var_35", ":var_20"), (agent_get_slot, ":var_40", ":var_0", 608), (is_between, ":var_40", 1, 31), (store_sub, ":var_41", ":var_40", 1), (agent_set_slot, ":var_0", 608, ":var_41"), (add_missile, ":var_0", 4, 60000, "itm_zh29_rifle", 0, "itm_2_mmp_magazines", 0), (assign, ":var_42", 1), (else_try), (eq, ":var_30", 1), (try_begin), (store_add, ":var_300", ":var_20", 30), (neg|gt, ":var_35", ":var_21"), (ge, ":var_35", ":var_300"), (store_mod, ":var_43", ":var_35", 40), (eq, ":var_43", 0), (assign, ":var_301", 1), (else_try), (assign, ":var_301", 0), (try_end), (this_or_next|eq, ":var_35", ":var_20"), (eq, ":var_301", 1), (agent_get_slot, ":var_40", ":var_0", 608), (is_between, ":var_40", 1, 31), (store_sub, ":var_41", ":var_40", 1), (agent_set_slot, ":var_0", 608, ":var_41"), (add_missile, ":var_0", 4, 60000, "itm_zh29_rifle", 0, "itm_2_mmp_magazines", 0), (assign, ":var_42", 1), (else_try), (assign, ":var_42", 0), (try_end), (try_begin), (eq, ":var_42", 1), (play_sound_at_position, "snd_zh29_shot", pos3), (copy_position, pos4, pos3), (position_move_y, pos4, 150), (particle_system_burst, "psys_bullet_shell", pos4, 1), (particle_system_burst, "psys_flying_bullet", pos4, 1), (try_end), (try_end), (try_begin), (eq, ":var_35", ":var_21"), (prop_instance_deform_in_cycle_loop, ":var_17", ":var_18", ":var_19", ":var_26"), (try_end), (try_begin), (key_clicked, key_right_mouse_button), #下面这段是按鼠标右键换弹 (try_begin), (neg|gt, ":var_35", ":var_23"), (ge, ":var_35", ":var_22"), (else_try), (prop_instance_deform_in_range, ":var_17", ":var_22", ":var_23", ":var_28"), (try_end), (else_try), (eq, ":var_35", ":var_23"), (agent_set_slot, ":var_0", 608, 30), #slot608就是弹药数量,暂时所有枪通用,换弹动画完整播放完弹药补充满到30,如果要区分,可以在刷prop初始化再记录一个prop slot数据分开计算。 (prop_instance_deform_in_cycle_loop, ":var_17", ":var_18", ":var_19", ":var_26"), (try_end), (try_begin), (this_or_next|key_clicked, key_mouse_scroll_up), #换枪,换枪时会暂时会到战团身体,然后1s不到再切换回来cs状态。 (key_clicked, key_mouse_scroll_down), (agent_slot_eq, ":var_0", 606, 0), (agent_set_slot, ":var_0", 606, 1), (agent_set_slot, ":var_0", 604, 0), (try_end), (agent_get_slot, ":var_44", ":var_0", 606), (try_begin), (is_between, ":var_44", 1, 20), (else_try), (is_between, ":var_44", 20, 30), (try_for_range, ":var_8", 0, 4), (agent_get_item_slot, ":var_9", ":var_0", ":var_8"), (neg|eq, ":var_9", -1), (neg|eq, ":var_9", "itm_longer_falchion"), (agent_unequip_item, ":var_0", ":var_9"), (try_end), (agent_equip_item, ":var_0", "itm_10_bullets_pack"), (agent_equip_item, ":var_0", "itm_rusty_mosin_nagant"), (agent_equip_item, ":var_0", "itm_longer_falchion"), (agent_set_wielded_item, ":var_0", "itm_longer_falchion"), #换枪时强制使用一个近战武器,避免远程战团武器干扰cs射击模式 (try_begin), (neg|gt, ":var_35", ":var_25"), (ge, ":var_35", ":var_24"), (else_try), (prop_instance_deform_in_range, ":var_17", ":var_24", ":var_25", ":var_29"), (try_end), (else_try), (ge, ":var_44", 30), (agent_set_slot, ":var_0", 606, 0), (try_end), (try_begin), (eq, ":var_35", ":var_25"), (prop_instance_deform_in_cycle_loop, ":var_17", ":var_18", ":var_19", ":var_26"), (try_end), (try_end), (try_end),
四、加载界面
还是MT文件里加入类似如下代码,强制场景中开启一个界面
(0.000000, 0.000000, 0.000000,
[
],
[
(try_begin),
(neg|is_presentation_active, "prsnt_battle"),
(neg|is_presentation_active, "prsnt_cs"),
(start_presentation, "prsnt_cs"),
(try_end),
]),
四、界面重置准星和弹药计数
presentation py文件创建名称为prsnt_cs的新界面
(ti_on_presentation_load, 条件中加入
(set_fixed_point_multiplier, 1000),
(assign, reg22, 30),
(assign, reg23, 30),
(create_text_overlay, "$csnum", "str_csnum", 6160), #cs弹药计数,str_csnum类似“ammo_{reg23}_/_{reg22}”的内容写法
(position_set_x, pos1, 750),
(position_set_y, pos1, 200),
(overlay_set_position, "$csnum", pos1),
(position_set_x, pos1, 1250),
(position_set_y, pos1, 1250),
(overlay_set_size, "$csnum", pos1),
(overlay_set_display, "$csnum", 0),
(create_mesh_overlay, "$cscross", "mesh_cscross"), #创建新的准星贴图
(position_set_x, pos1, 500),
(position_set_y, pos1, 380),
(overlay_set_position, "$cscross", pos1),
(overlay_set_display, "$cscross", 0),
(presentation_set_duration, 999999),
(ti_on_presentation_run, [的条件里加入
(set_fixed_point_multiplier, 1000),
(try_begin),
(game_key_clicked, gk_view_orders),
(presentation_set_duration, 0),
(start_presentation, "prsnt_battle"),
(try_end),
(try_begin),
(get_player_agent_no, ":var_0"),
(agent_get_position, pos1, ":var_0"),
(agent_get_horse, ":var_1", ":var_0"),
(neg|is_camera_in_first_person),
(agent_slot_eq, ":var_0", 604, 1),
(eq, ":var_1", -1), #参考MT里面是否使用cs枪模动画模式的条件去判断使用使用新的准星贴图和弹药计数
(try_begin),
(try_begin),
(agent_get_slot, ":var_2", ":var_0", 608),
(assign, reg22, 30),
(assign, reg23, ":var_2"),
(try_end),
(overlay_set_text, "$csnum", "str_csnum"),
(position_set_x, pos1, 900),
(position_set_y, pos1, 200),
(overlay_set_position, "$csnum", pos1),
(position_set_x, pos1, 1250),
(position_set_y, pos1, 1250),
(overlay_set_size, "$csnum", pos1),
(try_end),
(try_begin),
(overlay_set_display, "$cscross", 1),
(overlay_set_display, "$csnum", 1),
(try_end),
(else_try),
(overlay_set_display, "$cscross", 0),
(overlay_set_display, "$csnum", 0),
(try_end),
|