第一步:在include\constants\script_menu.h中添加新的多选择框的ID定义
#define MULTI_LILYCOVE_HEAL_WARP 115
数字按顺序写,至于名字就随便了,按照你实际情况来写
第二步:在script_menu.h中添加多选择列表
首先在include\strings.h文件添加
extern const u8 gText_ChunYu[];
extern const u8 gText_Chenxi[];
extern const u8 gText_Wuye[];
extern const u8 gText_Luoxia[];
extern const u8 gText_HealParty[];
然后在src\strings.c文件给上面定义的文本赋值
const u8 gText_ChunYu[] = _("春雨镇");
const u8 gText_Chenxi[] = _("晨曦镇");
const u8 gText_Wuye[] = _("午夜镇");
const u8 gText_Luoxia[] = _("落霞镇");
const u8 gText_HealParty[] = _("恢复队伍");
在src\data\script_menu.h文件搜索这个表格:static const struct MultichoiceListStruct sMultichoiceLists[]
然后在末尾添加
[MULTI_LILYCOVE_HEAL_WARP] = MULTICHOICE(MultichoiceList_LilycoveHealWarp),
添加多项选择框的实际内容,在src\data\script_menu.h这个文件任意处添加:
static const struct MenuAction MultichoiceList_LilycoveHealWarp[] =
{
{gText_HealParty},
{gText_ChunYu},
{gText_Chenxi},
{gText_Wuye},
{gText_Luoxia},
{gText_Exit},
};
第三步:撰写脚本
示例:
LilycoveCity_HealPlayerParty_Scripts::
msgbox Rest_MSG MSGBOX_DEFAULT
closemessage
LilycoveCity_HealPlayerParty_Loop:
multichoice 20, 2, MULTI_LILYCOVE_HEAL_WARP, TRUE
compare VAR_RESULT, 0
goto_if_eq LilycoveCity_HealPlayerParty_Heal
compare VAR_RESULT, 1
goto_if_eq LilycoveCity_HealPlayerParty_WarpPetalburg
compare VAR_RESULT, 2
goto_if_eq LilycoveCity_HealPlayerParty_WarpSlateport
compare VAR_RESULT, 3
goto_if_eq LilycoveCity_HealPlayerParty_WarpRustboro
compare VAR_RESULT, 4
goto_if_eq LilycoveCity_HealPlayerParty_Exit
goto LilycoveCity_HealPlayerParty_Loop
LilycoveCity_HealPlayerParty_Heal:
fadescreen FADE_TO_BLACK
playfanfare MUS_HEAL
waitfanfare
special HealPlayerParty
setrespawn HEAL_LOCATION_LILYCOVE_CITY
fadescreen FADE_FROM_BLACK
goto LilycoveCity_HealPlayerParty_Loop
LilycoveCity_HealPlayerParty_WarpPetalburg:
fadescreen FADE_TO_BLACK
warp MAP_SLATEPORT_CITY, 28, 45
waitstate
fadescreen FADE_FROM_BLACK
end
LilycoveCity_HealPlayerParty_WarpSlateport:
fadescreen FADE_TO_BLACK
warp MAP_LITTLEROOT_TOWN, 29, 32
waitstate
fadescreen FADE_FROM_BLACK
end
LilycoveCity_HealPlayerParty_WarpRustboro:
fadescreen FADE_TO_BLACK
warp MAP_LAVARIDGE_TOWN, 4, 18
waitstate
fadescreen FADE_FROM_BLACK
end
LilycoveCity_HealPlayerParty_Exit:
end
Rest_MSG:
.string "有点累了,休息一下吧。$"
脚本应该没啥需要特别解释的地方了,整体逻辑很简单。
如对本教程有其他问题,可以在评论区留言。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
![[GBA教程]pokeemerald新增自定义多项选择框-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/1F90AAF66BB1765251BED3AB10ACDD15.png)

![[GBA教程]pokeemerald新增NPC头像显示,并支持镜像翻转-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/QQ20260114-144714.png)
![[GBA]宝可梦 彼岸花绽放之夜 v1.0正式版-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/1.png)
![[GBA教程]pokeemerald三层地图块详解-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/QQ20260115-154539.png)
![[GBA教程]pokeemerald动态地图块实操记录-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/QQ20260123-171516.png)

![[NDS中文]宝可梦白2加强v1.0.1测试版-宝可梦营地](https://pokedream.cn/wp-content/uploads/2025/12/pokew2.png)

![[NDS]心金魂银自用debug内置修改器-宝可梦营地](https://pokedream.cn/wp-content/uploads/2026/01/game_patched__13041.png)
![[GBA教程]pokeemerald实现动态地图色板功能-宝可梦营地](https://pokedream.cn/wp-content/uploads/2025/12/LittlerootTown.png)
![[记录]GBA反编译上踩过的一些坑-宝可梦营地](https://pokedream.cn/wp-content/uploads/2025/12/water.jpg)
暂无评论内容