A downloadable project

Download NowName your own price

Fixed it so that it runs when you press start and won't stop until you command it to clear.
version 1.0.2
Fixed the overlapping of the same ID on other maps.
version 1.0.3
Added conditional command opening based on switch ID and variable and positioning.


  SetPlayerIcon iconIndex  Set the Balloon for the player character.


Set the number as follows



Added the ability to make balloons disappear.

A. Installing the Revised Plugin

  1. Backup Your Project:

    • Always create a backup of your RPG Maker MZ project before making changes to plugins to prevent data loss.
  2. Replace the Existing Plugin File:

    • Navigate to your project's js/plugins directory.
    • Locate the existing PLK_Balloon_NPC.js file.
    • Replace it with the revised plugin code provided above.
    • Ensure that the file is saved correctly without any syntax errors.
  3. Open RPG Maker MZ and Access Plugin Manager:

    • Launch RPG Maker MZ.
    • Open your project.
    • Navigate to Tools > Plugin Manager.
  4. Remove the Old Plugin Entry (If Present):

    • If PLK_Balloon_NPC is already listed, select it and click Delete to remove the old version.
  5. Import the Revised Plugin:

    • In the Plugin Manager, click the Import button.
    • Select the updated PLK_Balloon_NPC.js file from your js/plugins directory.
    • The plugin should now appear in the list with the latest version (1.0.3).
  6. Enable the Plugin:

    • Ensure that the Status checkbox next to PLK_Balloon_NPC is checked, indicating that the plugin is enabled.
  7. Restart RPG Maker MZ (If Necessary):

    • Sometimes, restarting RPG Maker MZ ensures that the plugin loads correctly, especially after updates.

B. Using Plugin Commands with Conditions and Numerical Positioning

1. Setting a Balloon for an NPC with Conditions and Numerical Positioning

Objective: Display a balloon above NPC ID 3 when switch 10 is ON and game variable 5 equals 7, lasting for 120 frames (2 seconds), with an xOffset of 10 and a yOffset of -20.

Steps:

  1. Open the Event Editor for NPC ID 3:

    • Navigate to the map containing NPC ID 3.
    • Double-click on the NPC to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command (the red button).
    • Select Plugin Command from the Plugin tab.
  3. Configure the SetNPCIcon Command:

    • Command: Set NPC Balloon
    • NPC ID: 3
    • Balloon Icon Index: 2 (Assuming this corresponds to your desired balloon graphic)
    • Display Conditions:
      • Switch ID: 10 (This switch must be ON)
      • Variable ID: 5 (This variable must equal 7)
      • Variable Value: 7
    • Duration (Frames): 120 (2 seconds)
    • X Offset: 10 (Moves the balloon 10 pixels to the right)
    • Y Offset: -20 (Moves the balloon 20 pixels upward)

    (Note: Replace the image URL with an actual screenshot if available.)

  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that NPC ID 3 displays the balloon above them only when switch 10 is ON and game variable 5 equals 7.
    • The balloon should appear 10 pixels to the right and 20 pixels above the NPC and disappear after 2 seconds.

2. Clearing a Balloon from an NPC

Objective: Remove any balloons from NPC ID 3.

Steps:

  1. Open the Event Editor for NPC ID 3:

    • Navigate to the map containing NPC ID 3.
    • Double-click on the NPC to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command.
    • Select Plugin Command from the Plugin tab.
  3. Configure the ClearNPCBalloon Command:

    • Command: Clear NPC Balloon
    • NPC ID: 3
  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that NPC ID 3 no longer displays any balloons.

3. Setting a Balloon for the Player with Conditions and Numerical Positioning

Objective: Display a balloon to the right of the player when game variable 8 equals 10, lasting for 180 frames (3 seconds), with an xOffset of 15 and a yOffset of -10.

Steps:

  1. Open the Desired Event (e.g., Map Start):

    • Navigate to the event where you want to set the player's balloon (e.g., at the map's starting point).
    • Double-click to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command.
    • Select Plugin Command from the Plugin tab.
  3. Configure the SetPlayerIcon Command:

    • Command: Set Player Balloon
    • Balloon Icon Index: 3 (Assuming this corresponds to your desired balloon graphic)
    • Display Conditions:
      • Switch ID: 0 (Ignored)
      • Variable ID: 8 (This variable must equal 10)
      • Variable Value: 10
    • Duration (Frames): 180 (3 seconds)
    • X Offset: 15 (Moves the balloon 15 pixels to the right)
    • Y Offset: -10 (Moves the balloon 10 pixels upward)


  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that the player displays the balloon to the right only when variable 8 equals 10.
    • The balloon should appear 15 pixels to the right and 10 pixels above the player and disappear after 3 seconds.

4. Clearing a Balloon from the Player

Objective: Remove any balloons from the player character.

Steps:

  1. Open the Desired Event:

    • Navigate to the event where you want to clear the player's balloon.
    • Double-click to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command.
    • Select Plugin Command from the Plugin tab.
  3. Configure the ClearPlayerBalloon Command:

    • Command: Clear Player Balloon
    • Note: No additional parameters are required.
  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that the player character no longer displays any balloons.

5. Troubleshooting the Conditions Parameter

If the conditions parameter or the balloon positioning using xOffset and yOffset is not working as expected, follow these troubleshooting steps:

A. Verify the Plugin File

  1. Check for Syntax Errors:

    • Ensure that the plugin file (PLK_Balloon_NPC.js) is free from syntax errors.
    • Even a minor typo can prevent the plugin from functioning correctly.
  2. Ensure Proper Struct Definition:

    • The @struct~Conditions must be correctly defined within the plugin comments.
    • Each parameter within the struct should have the correct annotations (@param, @text, @desc, @type, @default).

B. Re-import the Plugin

  1. Remove the Existing Plugin Entry:

    • In RPG Maker MZ's Plugin Manager, select PLK_Balloon_NPC and click Delete.
  2. Re-import the Revised Plugin:

    • Click the Import button.
    • Select the updated PLK_Balloon_NPC.js file.
  3. Enable the Plugin:

    • Ensure the Status checkbox is checked.
  4. Restart RPG Maker MZ (If Necessary):

    • Sometimes, restarting RPG Maker MZ helps in recognizing new struct definitions.

C. Use the Plugin Command Interface Correctly

  1. Access Plugin Commands via Event Editor:

    • Open the Event Editor for the desired NPC or player.
  2. Select the Correct Plugin Command:

    • Choose Set NPC Balloon or Set Player Balloon from the Plugin Commands list.
  3. Fill in the Parameters Using Provided Fields:

    • NPC ID / Balloon Icon Index: Enter the numeric ID or index as required.
    • Display Conditions:
      • Switch ID: Use the dropdown to select the appropriate game switch.
      • Variable ID: Use the dropdown to select the appropriate game variable.
      • Variable Value: Enter the required value for the variable.
    • Duration (Frames): Enter the number of frames (60 frames = 1 second). Use 0 for indefinite display.
    • X Offset: Enter the desired horizontal offset.
    • Y Offset: Enter the desired vertical offset.

    (Note: Replace the image URL with an actual screenshot if available.)

  4. Avoid Manual JSON Input:

    • Do Not manually enter JSON strings in the conditions parameter.
    • Use the provided fields to ensure proper formatting and data entry.

D. Check for Plugin Conflicts

  1. Disable Other Plugins Temporarily:

    • In the Plugin Manager, disable other plugins to check if there's a conflict.
    • Enable them one by one to identify if a specific plugin is causing the issue.
  2. Review Plugin Load Order:

    • Some plugins need to be loaded before or after others.
    • Adjust the load order if necessary to resolve conflicts.

E. Inspect Developer Console for Errors

  1. Open Developer Tools:

    • During playtesting, press F8 to open the developer console.
  2. Look for Error Messages:

    • Any errors related to the plugin will be displayed here.
    • Common errors include JSON parsing issues or undefined variables.
  3. Address the Errors:

    • Based on the error messages, make necessary adjustments to the plugin code or Plugin Commands.

F. Ensure Correct Switch and Variable IDs

  1. Verify Switch and Variable IDs:

    • Open Database > System > Switches and Variables.
    • Ensure that the IDs used in the Plugin Commands correspond to existing switches and variables.
  2. Set Correct Values:

    • For variable conditions, ensure that the game variables hold the correct values during testing.

6. Example Plugin Command Usage

Example: Setting a Conditional, Timed Balloon Above an NPC with Numerical Positioning

Objective: NPC ID 7 should display balloon index 4 above them only when switch 12 is ON and game variable 6 equals 3, lasting for 150 frames (2.5 seconds), with an xOffset of 5 and a yOffset of -15.

Steps:

  1. Open the Event Editor for NPC ID 7:

    • Navigate to the map containing NPC ID 7.
    • Double-click on the NPC to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command.
    • Select Plugin Command from the Plugin tab.
  3. Configure the SetNPCIcon Command:

    • Command: Set NPC Balloon
    • NPC ID: 7
    • Balloon Icon Index: 4 (Assuming this corresponds to your desired balloon graphic)
    • Display Conditions:
      • Switch ID: 12 (This switch must be ON)
      • Variable ID: 6 (This variable must equal 3)
      • Variable Value: 3
    • Duration (Frames): 150 (2.5 seconds)
    • X Offset: 5 (Moves the balloon 5 pixels to the right)
    • Y Offset: -15 (Moves the balloon 15 pixels upward)

    (Note: Replace the image URL with an actual screenshot if available.)

  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that NPC ID 7 displays the balloon above them only when switch 12 is ON and game variable 6 equals 3.
    • The balloon should appear 5 pixels to the right and 15 pixels above the NPC and disappear after 2.5 seconds.

Clearing the Balloon from NPC ID 7

Steps:

  1. Open the Event Editor for NPC ID 7:

    • Navigate to the map containing NPC ID 7.
    • Double-click on the NPC to open the Event Editor.
  2. Add a Plugin Command:

    • Click on New Event Command.
    • Select Plugin Command from the Plugin tab.
  3. Configure the ClearNPCBalloon Command:

    • Command: Clear NPC Balloon
    • NPC ID: 7
  4. Save and Test:

    • Save the event.
    • Playtest the game.
    • Ensure that any balloons previously set for NPC ID 7 are now removed.

7. Final Recommendations

  1. Ensure Proper Struct Definition:

    • The Conditions struct must be correctly defined within the plugin's metadata.
    • Ensure that there are no syntax errors or typos in the struct definition.
  2. Use the Plugin Command Interface Correctly:

    • Always use the provided fields in the Plugin Command interface to set conditions and position offsets.
    • Avoid manual JSON input to prevent formatting issues.
  3. Regularly Test Plugin Commands:

    • After setting up Plugin Commands, playtest frequently to ensure balloons appear and disappear as intended.
  4. Backup Your Project:

    • Before making significant changes or updates to plugins, always back up your project to prevent data loss.
  5. Customize Balloon Graphics:

    • You can create custom balloon graphics to enhance visual appeal.
    • Ensure that the balloon index corresponds to the correct graphic in your resources.
  6. Seek Further Assistance if Needed:

    • If issues persist after following these steps, consider reaching out to RPG Maker communities or forums for additional support.


Terms of use

No duplication or distribution is permitted.

Can be used in commercial games

I ask you to specify "Palatkorn"

in your game credits only



Updated 18 days ago
StatusReleased
CategoryOther
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorPalatkorn
TagsRPG Maker MZ

Download

Download NowName your own price

Click download now to get access to the following files:

PLK_Balloon_NPC.js 6.1 kB

Comments

Log in with itch.io to leave a comment.

I think i've found a bug/issue with your script.
So i've tied a quest marker to show above my event #78's head for a quest. It's all working fine. Swaps colors etc when its supposed too, ends when i tell it to and all that.
I created a new map.. as i was adding stuff.. i got to event #78 on THAT new map and when i test run the game on map 1 the quest marker is there over the npcs head.. but if i go onto map 2 (a completely different map) the event that's #78 also shows the quest marker on it too.
I tested a few things, created same map entirely as i had copy/pasted the same map but that wasnt the issue, tried turning all my plugins off also that i'm using and kept just the balloon script on and it still happens on both maps. Here's a vid of whats happening.. 

So for now i've had to hide event #78 on my second map at a corner out of the way until maybe a fix can happen.

Thanks for the problem, I am fixing it.

(1 edit)

I fixed it to version 1.0.3, please try again.

Added conditional command opening based on switch ID and variable and positioning.

(1 edit)

Ah.. thanks for this.. the patch was so quick.
I'll test it out shortly and report back.
Thanks!

EDIT: Your patch sorted the issue out, thanks! :)

(1 edit)

First, thanks for this great script.
How do I make a bubble appear above the NPC's head without having to talk to him? 
I'm trying to show a yellow exclamation above it's head to show it has a quest to pick up, then once I accept the quest it displays a grey exclamation, then when I can hand in the quest (when all tasks are done or items collected) it displays a red exclamation.
I tried having event page 1 run as parallel with the code to display the yellow exclamation but it don't work. Though if I put the code just so I talk to him it works, so it seems this wont work on events that's set to parallel.
Unless i'm missing something, i'm very new to MZ so maybe i'm not understanding something. Any fix for this?

(2 edits)

First open EV00x, then create and set trigger to automate in content, set all balloon display, in event command select control switch to A = On, then go back to original EV00x, create 2 new bars without setting anything in them, select switch self = A and done, the management will be done automatically.

ah thanks for this!

Any option for alternative with displaying icon above character? 

You can give me your ideas and I will fix them.

I would be soo happy if you could make option to display icon over player's head, so we can use it for "carry item" mechanics. 

I have added that option for you, feel free to reload.

Are you sure it's updated? I see only option for setting baloon like before in plugin commands.

Yes I tested it, I think you need to remove the old one first.