The Verbs or Actions are the actions used by the player to interact with the items in your game. Usually use, pick up, talk, etc. When an action is selected on an item, the event with the same name is called, which triggers a cutscene, action, dialogue, etc. This is the main way in which the game progresses. There are 2 types of such menus, the on-screen Verb Menu and the Action Menu:
The Verb Menu is an on-screen menu with a list of verbs, or actions that the player can do. You can also texture them to create icons. The list is always on screen, and it works as a button group; only one action can be selected at a time. The selected action is applied to any item that the user clicks on afterwards.
The verb menu can be found in the file ui/verb_menu.scn. The required structure for this scene is:
verb_menu
with the script ui/verb_menu.gd attached to itactions
with one or more nodes as children of type Button or TextureButton. The name of each button node determines the name of the action that the button represents.With TextureButton's, the graphical aspect of the button can easily be changed just by changing the Texture properties:
The Action Menu is a small UI that pops-up or spawns when the user clicks on an item on screen, where they can select an action to perform on the item after selecting it. The menu is usually smaller and uses icons instead of words, and usually consists of fewer options (2-3). The action menu scene can be found in ui/action_menu.tscn, with a similar structure to the Verb Menu:
action_menu
with the script globals/action_menu.gd attached to itKeep in mind that the menu is placed using the 0,0 position of the scene. If you want to customize the menu's graphical aspect just go to ui/action_menu.tscn, add some TextureButton's as children of the actions node. You can organize the buttons the way you want to.
The custom action menu used on the old_man of or mini game could look like this.
Obviously these 2 menu styles can't be used at the same time in the same game, so you'll need to select one.
By default, the Verb Menu is enabled, since it's provided as one of the example placeholder scenes. Note that since both menus are somewhere inside the game scene, you can have 2 versions of this scene, one for each menu style, and use each version in different main scenes.
When using the action menu, be aware that the items which should trigger it must have the Use Action Menu property checked to On. This property is enabled by default on the item script.
To use verbs and action, you have to attach an Esc file script to an item with the Event path property. This file has to contain instruction for each verb applicable to the item. The notation is simple:
:nameofverb
followed on next lines by description of what should happen if this verb is used.
like this:
:talk
say old_man "Hello young panda, today is time for your first offering to the almighty panda god!"
Il y a une erreur de communication avec le serveur Booktype. Nous ne savons pas actuellement où est le problème.
Vous devriez rafraîchir la page.