骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买CDKEY 衣谷三国
查看: 1667|回复: 3

[功能与代码] 召唤和解散马匹

[复制链接]

22

主题

123

回帖

59

积分

扈从

Rank: 2Rank: 2

UID
3084588
第纳尔
68
精华
0
互助
3
荣誉
0
贡献
0
魅力
1
注册时间
2019-6-29
鲜花(8) 鸡蛋(0)
发表于 2025-6-13 19:37:23 | 显示全部楼层 |阅读模式
本帖最后由 咸鱼圣代 于 2025-6-13 19:37 编辑

每次玩家进城会骑马,然后随便进个酒馆或者城堡出来就不在了。
感觉就不上不下的,很烦。

我觉得应该有点更现代的机制来处理这个问题,所以我写了这个小功能。
我的初衷是在城镇、城堡或者村庄里面用这个东西,但是想加在战场上应该也随便吧?反正自己随便调调。

默认按一次N键来使用功能
按一次是召唤,下一次就是解散


#("town_center"
#(set_jump_mission, "mt_town_center"),
#("castle_inspect"
#(set_jump_mission, "mt_castle_visit"),
#("village_center"
#(set_jump_mission, "mt_village_center"),

spawn_horse                              = 1973  # (spawn_horse, <item_kind_id>, <item_modifier>),
                                                 # Spawns a new horse (with any modifier) in the specified position and saves the reference to the new agent in reg0.

agent_fade_out                           = 1749  # (agent_fade_out, <agent_id>),
                                                 # Fades out the agent from the scene (same effect as fleeing enemies when they get to the edge of map). They will be counted as alive for battle missions. Dead agents can't be faded out of the game, they have to be alive.

slot_agent_player_summoned_horse = 667

    (0.000000, 0.000000, ti_once,
    [
    ],
    [
        (get_player_agent_no, ":player_agent_no"),
        (agent_set_slot, ":player_agent_no", slot_agent_player_summoned_horse, -1),
    ]),


    (0.000000, 0.500000, 1.000000,
    [
        (key_clicked, key_n),
        (get_player_agent_no, ":player_agent_no"),
        (agent_slot_eq, ":player_agent_no", slot_agent_player_summoned_horse, -1),
    ],
    [
        (get_player_agent_no, ":player_agent_no"),
        (agent_get_horse, ":player_mount", ":player_agent_no"),
        (eq, ":player_mount", -1),
        (troop_get_inventory_slot, ":player_horse", "trp_player", 8),
        (gt, ":player_horse", 0),
        (agent_get_look_position, pos1, ":player_agent_no"),
        (position_move_y, pos1, -400, 0),
        (set_spawn_position, pos1),
        (spawn_horse, ":player_horse"),
        (agent_play_sound, reg0, "snd_neigh"),
        (agent_set_slot, ":player_agent_no", slot_agent_player_summoned_horse, reg0),
    ]),

    (0.000000, 1.000000, 1.000000,
    [
        (key_clicked, key_n),
        (get_player_agent_no, ":player_agent_no"),
        (neg|agent_slot_eq, ":player_agent_no", slot_agent_player_summoned_horse, -1),
    ],
    [
        (get_player_agent_no, ":player_agent_no"),
        (agent_get_horse, ":player_mount", ":player_agent_no"),
        (eq, ":player_mount", -1),
        (try_for_agents, ":player_summoned_horse"),
            (agent_slot_eq, ":player_agent_no", slot_agent_player_summoned_horse, ":player_summoned_horse"),
            (agent_play_sound, ":player_summoned_horse", "snd_horse_snort"),
            (agent_fade_out, ":player_summoned_horse"),
        (try_end),
        (agent_set_slot, ":player_agent_no", slot_agent_player_summoned_horse, -1),
    ]),

TXT:

0.000000 0.000000 100000000.000000  0  2 1700 1 1224979098644774912 505 3 1224979098644774912 667 -1
0.000000 0.500000 1.000000  3 71 1 49 1700 1 1224979098644774912 545 3 1224979098644774912 667 -1  11 1700 1 1224979098644774912 1714 2 1224979098644774913 1224979098644774912 31 2 1224979098644774913 -1 1541 3 1224979098644774914 360287970189639680 8 32 2 1224979098644774914 0 1709 2 1 1224979098644774912 721 3 1 -400 0 1970 1 1 1973 1 1224979098644774914 1750 2 72057594037927936 1152921504606847090 505 3 1224979098644774912 667 72057594037927936
0.000000 1.000000 1.000000  3 71 1 49 1700 1 1224979098644774912 2147484193 3 1224979098644774912 667 -1  9 1700 1 1224979098644774912 1714 2 1224979098644774913 1224979098644774912 31 2 1224979098644774913 -1 12 1 1224979098644774914 545 3 1224979098644774912 667 1224979098644774914 1750 2 1224979098644774914 1152921504606847127 1749 1 1224979098644774914 3 0 505 3 1224979098644774912 667 -1

我不知道这份txt能不能顺利其他模组用,反正我没有添加任何元素其是仅存于我现在正在玩的这个模组里面的,不行的话就拿codeeditor自给自足吧。



鲜花鸡蛋

1274404428  在2025-8-20 18:10  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下
快乐风猫  在2025-6-13 23:42  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下

30

主题

267

回帖

274

积分

见习骑士

Rank: 3

UID
3225805
第纳尔
1399
精华
0
互助
37
荣誉
0
贡献
0
魅力
259
注册时间
2021-3-14
鲜花(53) 鸡蛋(0)
发表于 2025-6-13 23:42:43 | 显示全部楼层
只用于玩家自己召唤和召回马匹,不涉及士兵和npc的话,可以不用增加slot槽,用一个全局变量就好了

22

主题

123

回帖

59

积分

扈从

Rank: 2Rank: 2

UID
3084588
第纳尔
68
精华
0
互助
3
荣誉
0
贡献
0
魅力
1
注册时间
2019-6-29
鲜花(8) 鸡蛋(0)
 楼主| 发表于 2025-6-14 21:28:50 | 显示全部楼层
快乐风猫 发表于 2025-6-13 23:42
只用于玩家自己召唤和召回马匹,不涉及士兵和npc的话,可以不用增加slot槽,用一个全局变量就好了 ...

嗯,谢谢。
这个我还没试过,一直以来感觉槽值好像是特别可靠,就偏爱它一点。主改txt的我也是很后面才知道添加全局变量原来不怎么复杂,现在对它的理解依旧不深,基本只是拿来当个开关。

30

主题

267

回帖

274

积分

见习骑士

Rank: 3

UID
3225805
第纳尔
1399
精华
0
互助
37
荣誉
0
贡献
0
魅力
259
注册时间
2021-3-14
鲜花(53) 鸡蛋(0)
发表于 2025-6-14 22:30:03 | 显示全部楼层
咸鱼圣代 发表于 2025-6-14 21:28
嗯,谢谢。
这个我还没试过,一直以来感觉槽值好像是特别可靠,就偏爱它一点。主改txt的我也是很后面才知 ...

涉及多个目标同时处理的再用slot槽,一次只处理一个目标就用全局变量就好了
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2025-9-4 11:25 , Processed in 0.101499 second(s), 20 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表