itch.io is community of indie game creators and players

Devlogs

Dynamic Move List in GB Studio Tutorial

Dynamic Move List in GB studio
A downloadable asset pack

Dynamic Move List Using the Display Menu Event in GB Studio

This guide explains how to create a menu-based move list system similar to RPGs like Pokémon, using only event scripting in GB Studio. Each menu slot displays a move name and executes different scripts based on player selection.

Overview

Each move slot contains:

  • An ID variable determining which move it represents

  • 5 letter variables to spell out the move’s name (e.g., Punch → P, u, n, c, h)

  • Dynamic display using %c syntax in a choice menu

When selected, the system looks up the move ID and executes the appropriate effect.


Step 1: Setting Up Variables

  1. Create 4 ID variables for move slots:

    • Name them menu_slot_x_id (where x is 1, 2, 3, or 4)

    • These IDs will represent different moves (e.g., 1 = Punch, 2 = Kick)

  2. Create letter variables for each move slot:

    • Name them move_slot_x_letter_y (x = slot ID, y = letter position 1-5)

    • Example: move_slot_1_letter_1 to move_slot_1_letter_5 for the first move


Step 2: Mapping Move Names to ASCII Codes

Create a script called “Change Letters in a Menu Slot”:

  1. Add a switch statement checking the move_slot_id parameter

  2. For each case (move ID), add five “Set Variable to Value” events:

    • Set each letter_y parameter to the ASCII code for the corresponding letter

    • Use online ASCII converters to find the correct codes

Example for “Punch”:


Case 1:

  Set letter_1 to 80 (P)

  Set letter_2 to 117 (u)

  Set letter_3 to 110 (n)

  Set etter_4 to 99 (c)

  Set letter_5 to 104 (h)

Step 3: Setting All Menu Items

Create a script called “Set All Displayed Menu Items”:

  1. Call “Change Letters in a Menu Slot” four times

  2. For each call:

    • Pass the appropriate move_slot_x_id as the argument

    • Pass the appropriate ‘move_slot_x_letter_y’ for each letter argument


Step 4: Creating Move Effects

Create a script called “Move Effects”:

  1. Add a switch statement checking the move_slot_x_id parameter

  2. For each case (move ID), add the move’s logic:

    • Example for Kick (ID 2):

      
      Case 2:
      
        Show Text: "The player kicks the enemy!"
      
        [Add damage calculation or other effects here]
      
      

Step 5: Pre-Menu Setup


Step 6: Displaying the Menu


Step 7: Handling Menu Selections

Below the Display Menu event:

  1. Add a switch statement checking the menu_choice variable

  2. For each case (1-4):

    • Call the “Move Effects” script

    • Pass the corresponding move_slot_x_id as the argument

    • Example for case 3:

      
      Call Script: Move Effects
      
      Argument: move_slot_3_id
      
      

Final Notes

  • Test your menu to ensure all moves display correctly and trigger the proper effects

  • Consider adding a separate scene to manage move assignments in a full game

  • Document your move IDs and their corresponding effects for future reference

Download Dynamic Move List in GB studio
Leave a comment