搜查示例

搜查示例 #


如何在剧本中使用游戏的地图进行搜查,例子by雪覆山茶

主剧本 #

  1. 创建背景图片目录 #

    剧本通过map指令开启地图探索,玩家点击地点后,会返回一个flag值,可以根据flag值判断玩家点击的房间走入分支

  2. 剧本代码 #

    @Gosub System/System_Subroutine.BeginAdv
    
    
    @update "F1" Category:"Map" Version:1
    @update "F2" Category:"Map" Version:2
    @update "B1" Category:"Map" Version:1
    ;chosenAreaFlag中的数字应为2的你的房间总数次方减一
    @if "chosenAreaFlag == 4194303"
        @set "chosenAreaFlag = 0"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true End/End
    
    @map RecreationRoom,Library,Infirmary,SolitaryConfinement,Lake,NoahStudio,Courtyard,BasementHallway,Lounge,EntranceHall,MessHall,Showers,ChamberSalamander,ChamberUndine,ChamberGnome,FrontGuesthouse,Warehouse,Courtroom,CourtroomHallway,PrisonEntrance,Wall,FlowerFields flag:"chosenAreaFlag" Back:false Global:false
    ;setflag中数字的顺序应与@map中房间的顺序相同
    @if "chosenAreaId==\"RecreationRoom\""
        @setFlag 0 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true RecreationRoom/RecreationRoom
    
    @if "chosenAreaId==\"Library\""
        @setFlag 1 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Library/Library
    
    @if "chosenAreaId==\"Infirmary\""
        @setFlag 2 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Infirmary/Infirmary
    
    @if "chosenAreaId==\"SolitaryConfinement\""
        @setFlag 3 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true SolitaryConfinement/SolitaryConfinement
    
    @if "chosenAreaId==\"Lake\""
        @setFlag 4 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Lake/Lake
    
    @if "chosenAreaId==\"NoahStudio\""
        @setFlag 5 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true NoahStudio/NoahStudio
    
    @if "chosenAreaId==\"Courtyard\""
        @setFlag 6 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Courtyard/Courtyard
    
    @if "chosenAreaId==\"BasementHallway\""
        @setFlag 7 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true BasementHallway/BasementHallway
    
    @if "chosenAreaId==\"Lounge\""
        @setFlag 8 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Lounge/Lounge
    
    @if "chosenAreaId==\"EntranceHall\""
        @setFlag 9 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true EntranceHall/EntranceHall
    
    @if "chosenAreaId==\"MessHall\""
        @setFlag 10 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true MessHall/MessHall
    
    @if "chosenAreaId==\"Showers\""
        @setFlag 11 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Showers/Showers
    
    @if "chosenAreaId==\"ChamberSalamander\""
        @setFlag 12 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true ChamberSalamander/ChamberSalamander
    
    @if "chosenAreaId==\"ChamberUndine\""
        @setFlag 13 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true ChamberUndine/ChamberUndine
    
    @if "chosenAreaId==\"ChamberGnome\""
        @setFlag 14 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true ChamberGnome/ChamberGnome
    
    @if "chosenAreaId==\"FrontGuesthouse\""
        @setFlag 15 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true FrontGuesthouse/FrontGuesthouse
    
    @if "chosenAreaId==\"Warehouse\""
        @setFlag 16 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Warehouse/Warehouse
    
    @if "chosenAreaId==\"Courtroom\""
        @setFlag 17 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Courtroom/Courtroom
    
    @if "chosenAreaId==\"CourtroomHallway\""
        @setFlag 18 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true CourtroomHallway/CourtroomHallway
    
    @if "chosenAreaId==\"PrisonEntrance\""
        @setFlag 19 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true PrisonEntrance/PrisonEntrance
    
    @if "chosenAreaId==\"Wall\""
        @setFlag 20 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true Wall/Wall
    
    @if "chosenAreaId==\"FlowerFields\""
        @setFlag 21 var:"chosenAreaFlag"
        @Gosub System/System_Subroutine.EndAdv
        @goto soft:true FlowerFields/FlowerFields
    
    @StopForChoice Clear:false
    

例子下载 #

搜查示例