界面系统
The Screen system simulates different dialogs and pause menus in the game.
For example, when pausing to access the inventory, or when selling items by talking
to a shop keeper.
Most of the time, the simulator can switch between screens automatically depending on the actions, so the effect of this system should be transparent to those who are used to previous versions of the simulator.
Understanding this system could be useful, if you want to explicitly control when you open a screen, which can be helpful when optimizing and verifying IST setups.
The simulator UI has a little icon next to the “Visible Inventory” title to indicate which screen you are currently on.
游戏状态
While not technically a screen, the Game itself can also have 2 different states:
Running and, well, not Running (closed).
The initial state of the simulation is similar to a new game. When executing most commands, the game will keep running, unless:
- You manually closed the game with the
close-gamecommand. - The game crashes.
When you encounter a game crash, note that it’s also possible it’s a bug in the simulator. Please report it on GitHub if the simulator crashes on a step that you don’t think is supposed to crash in game.
You can also view the detail of the crash in the Crash Viewer Extension.
Whenever the game is closed in the middle of a simulation (either closed manually or crashed), it will not automatically restart. You have to use either of the commands below:
new-gameto start a new gamereloadorreload SAVE_NAMEto start the game and reload a saveSAVE_NAMEis the name of the save, see Save Files
界面类型
While in game, there are 4 screens that are simulated:
Overworld:- The default state when you start a game.
- Player is able to move
- You can get/drop items
- … all the other things you can do in the overworld
Inventory:- When you pause the game with the
+button - Player can interact with items in the inventory
- When you pause the game with the
Shop Selling:- When talking to a shop owner to sell items
- Player can select items in the inventory to sell
Shop Buying:- When talking to Beedle or some other NPC to buy items
- Player can select from a list of items to buy
The Screen system works like a state machine; when an action needs a certain
screen, it will try to transition to that screen state if possible, and display
an error if it couldn’t. The transition looks something like this:
Overworld
/---------|---------\
/ | \
/ | \
Inventory Shop Buying --- Shop Selling
For example, if you are in the inventory menu and need to talk to a shop owner to sell something
(i.e. to execute the sell command):
- The simulator first checks if you are already in the
Shop Sellingscreen - Since you are in the inventory screen, the simulator must return to
Overworldby closing the inventory menu - Then, it simulates talking to a shop owner by transitioning to the
Shopscreen - Finally, it sells the item
- After all of that, it will stay in the
Shopscreen until it has to transition again
That all happens in a single sell command!
手动切换界面
The following actions count as manually switching the screen. If the screen has been manually switched, the simulator will prevent certain automatic screen switches.
Inventory:pauseto open the inventory- No automatic screen switches can happen until returned to overworld
unpauseto close the inventory and return to overworld
Shop(buying and selling):talk-to NPCto start buying or selling (NPCcan be any-or_connected word)- Screen can be automatically switched between
BuyingandSelling, but not toOverworld - When returned to overworld, screen can be automatically switched again to all types
- Screen can be automatically switched between
untalkorclose-dialogto return to overworld
Note that annotations for screen switching like :pause-during get do
not count as manually switching screens, and the simulator
will still automatically switch screens afterward.