Is it possible to "hide" comments in common events so they aren't parsed?

cuby

Perpetual Toil
Veteran
Joined
Jun 20, 2015
Messages
113
Reaction score
19
First Language
English
Primarily Uses
RMMV
I'm using a Yanfly plugin (Common Event Menu) that parses comments within common events for information -- but this isn't really a plugin-related help request, it's more of a common event help request, best as I can tell :LZSsmile:

I'm attempting to use a conditional branch within the common events to pass different information (just text colors) to the plugin, depending on switches. It wasn't working, and then I had an "oh duh" moment where I realized that comments are comments, and no matter if they're inside a conditional branch, they are getting parsed.

Is there any possible way to actually tuck a comment neatly away in a common event -- that would allow me to choose which comment gets parsed, with similar functionality as a conditional branch? Or is this as hopeless as it sounds?

Thanks!! :LZSsmile::LZSjoy::LZSsmile:
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,244
Reaction score
7,628
First Language
Indonesian
Primarily Uses
RMVXA
but this isn't really a plugin-related help request
But It is.

Because comments by default are not parsed at all. They are sitting there do nothing. They are tools (like note box in the database) for plugin developers to do stuff.

To change this behavior, the plugin needs to be either edited (or patched).
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,079
Reaction score
5,742
First Language
English
Primarily Uses
RMVXA
I agree with @TheoAllen; there is no way provided to "tuck" or "hide" Comments in default RPG Maker behavior because the default behavior already ignores them! If you have a plugin that considers Comments in some way, the solution will either be communicating with that plugin in a specific way through your comments/event structure, or changing the plugin's code to do what you need it to do. Therefore, I am moving this to Plugin Support.

To give people the best opportunity to help you, I recommend linking to the Plugin that you are using which take Comments into account (perhaps the Text Color plugin or maybe the Common Event Menu plugin), explaining the syntax it allows in Comments, and showing screenshots of your Common Event itself.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,270
Reaction score
674
First Language
English
Primarily Uses
RMMV
I'm using a Yanfly plugin (Common Event Menu) that parses comments within common events for information --

I'm attempting to use a conditional branch within the common events to pass different information (just text colors) to the plugin, depending on switches. It wasn't working, and then I had an "oh duh" moment where I realized that comments are comments, and no matter if they're inside a conditional branch, they are getting parsed.
I don't really understand how you could have this problem. Yanfly's Common Event Menu only does anything with comments that have the specific headers defined within angled brackets. If you don't have that format in a given comment box, it shouldn't be possible for it to have any effect on your game.
Is there any possible way to actually tuck a comment neatly away in a common event
As above, I'm not really sure that you're having the problem you think you're having...but that being said, you could make a Script box (third page of events, bottom right) and make a JavaScript comment:
// This comments out the line
 

cuby

Perpetual Toil
Veteran
Joined
Jun 20, 2015
Messages
113
Reaction score
19
First Language
English
Primarily Uses
RMMV
@TheoAllen @Wavelength @ATT_Turan thank you for the explanations, please let me put it out there in greater detail!

YEP_CommonEventMenu allows you to call a scene that lists common events --their default use case from the plugin's webpage is a teleport menu:

2021-06-06 02_30_01-Common Event Menu (YEP) - Yanfly.moe Wiki.png

Common events don't have notetags so this plugin uses comments. The one I'm trying to mess with is the one that determines the name of the common event as it appears:

2021-06-06 02_33_43-Help.png

This works perfectly -- a massive part of my game leans on this plugin -- it even includes full support for text colors and codes. However!! This means that there's no evident way to change the color of a menu, at least not using a conditional branch.

Here's what I tried, unsuccessfully:



2021-06-06 02_39_33-Database.png

The goal was to have the color of the menu be different according to a switch. But as I found out, it ain't how the plugin parses comments. It's blind to conditional branches and just reads the comments as they appear in the common event, top to bottom. In this case, every menu name was color 24, whether or not the switch is on.

There is a horrrrrrible workaround waiting for me if I can't figure this out -- I could double the number of common event entries in my menu, and hide/show each according to the switch. But that's an undesirable option for me to say the least, since I have a huge number of these entries :\ But a workaround is a workaround!

EDIT: Oy vey I found an easier workaround -- had no idea that the names of the common events themselves -- which the plugin defaults to, supports the text color escape codes. Consider me astonished by that, honestly. If anyone has any quick insights into a more flexible way to use comments the way this plugin requires, I'd gladly accept it, but otherwise this definitely works for my purposes and could be considered closed!
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,244
Reaction score
7,628
First Language
Indonesian
Primarily Uses
RMVXA
The reason why conditional would not work is that they need to be checked during the run time to make sense.

p2 is a switch. So what is going to happen if you are going to turn the p2 switch off right before the conditional branch? Should it always go to the else branch? Comment parsing does not execute event commands.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,270
Reaction score
674
First Language
English
Primarily Uses
RMMV
The reason why conditional would not work is that they need to be checked during the run time to make sense.
This explanation doesn't really make sense to me. There are plenty of plugins, including the Main Menu Manager also by Yanfly, that modify menus during runtime. I have menu elements in my game that are displayed or hidden depending on conditions set during runtime. There are plugins to display text in menus that changes during runtime.

Perhaps this plugin doesn't work that way (and when I searched for it, I found one older post with no replies from a user trying to make conditionals work with this plugin), but saying it couldn't work because of runtime doesn't make sense to me.
p2 is a switch. So what is going to happen if you are going to turn the p2 switch off right before the conditional branch? Should it always go to the else branch?
...yes? Isn't that what the else branch means?
Comment parsing does not execute event commands.
I don't get what this line even has to do with the topic. There are no event commands embedded in his comments.

I'm not trying to insult you, I know you know your stuff, and maybe it's a translation issue...but if you were trying to explain something, it didn't work.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,244
Reaction score
7,628
First Language
Indonesian
Primarily Uses
RMVXA
This explanation doesn't really make sense to me. There are plenty of plugins, including the Main Menu Manager also by Yanfly, that modify menus during runtime. I have menu elements in my game that are displayed or hidden depending on conditions set during runtime. There are plugins to display text in menus that changes during runtime.
This explanation also does not really make sense to me because I have no idea about the context as I don't know what is the plugin and how does it work.

Perhaps this plugin doesn't work that way (and when I searched for it, I found one older post with no replies from a user trying to make conditionals work with this plugin), but saying it couldn't work because of runtime doesn't make sense to me.
As I said, comment parsing does not execute event command.
Comment parsing usually loops through the list of event commands, filter it if it is a comment or not. Ignoring entirely everything else. Including conditional and else branch. Comments are treated as note boxes because there is a note box on the event page and a common event.

...yes? Isn't that what the else branch means?
If the switch event command is executed, are we going to execute every other event command?
If we have a command to move the player in a direction and the switch is turned off when player reaches a certain coordinate, are we going to execute the move command, check the switch, then decide "oh now we decide the menu text".

I don't get what this line even has to do with the topic. There are no event commands embedded in his comments.
Conditional branch IS event command.
I'm making a case what if there are more event commands.

But here is the sample case. For the better understanding.
Screenshot_258.jpg
From your perspective, how does it suppose to work?

I'm not trying to insult you, I know you know your stuff, and maybe it's a translation issue...but if you were trying to explain something, it didn't work.
No insult is taken as long as we're staying on topic and avoid a personal insult.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,270
Reaction score
674
First Language
English
Primarily Uses
RMMV
This explanation also does not really make sense to me because I have no idea about the context as I don't know what is the plugin and how does it work.
Pretty much every plugin I've used that can add an option to the main menu has a variable, accessible via plugin command or script, that toggles whether it displays. So every time you hit Escape with any of those extensions installed, the engine must scan the state of those variables, read what the text is to be displayed...I don't see how that's functionally different from what's going on here.
If the switch event command is executed, are we going to execute every other event command?
If we have a command to move the player in a direction and the switch is turned off when player reaches a certain coordinate, are we going to execute the move command, check the switch, then decide "oh now we decide the menu text".
Do you understand that in this Common Event Menu plugin, this event we're looking at is not being executed? The comment box with the <Menu> tag is setting the label when looked at from an external menu.

Obviously, the way that it works is that Yanfly decided to just parse all of the comments and any duplicate tags simply overwrite earlier versions. But I don't see any innate reason that it couldn't have been written to evaluate conditional branches - she probably just didn't foresee the need.
Conditional branch IS event command.
I understand what you're getting at. But, again, if we're already scanning through the contents of the event to look for comments with appropriate notetags, there's zero reason we can't also decide to evaluate conditionals.
But here is the sample case. For the better understanding.
Again - at the time that the menu text is being displayed, nothing in the event, such as move routes or controlling variables, is being executed. So that part of your example is really irrelevant. My point is that there's no reason the OP's example case couldn't work as he wrote it. It obviously doesn't, but there's no reason the plugin couldn't have. It would just rely on the user to make sane conditionals and if they don't, oh well, that menu item doesn't work as expected.

There are other plugins that give much more complicated responsibilities to users - look at Yanfly's Quest Journal, or any number of Achievement Trackers or the Encyclopedia entry things.
From your perspective, how does it suppose to work?
By evaluating the value of that variable at the time of you opening the menu screen.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,244
Reaction score
7,628
First Language
Indonesian
Primarily Uses
RMVXA
Do you understand that in this Common Event Menu plugin, this event we're looking at is not being executed?
Yes, I completely understand.

I understand what you're getting at. But, again, if we're already scanning through the contents of the event to look for comments with appropriate notetags, there's zero reason we can't also decide to evaluate conditionals.
Well, I'm about to give the reason why it isn't zero.

Again - at the time that the menu text is being displayed, nothing in the event, such as move routes or controlling variables, is being executed.
So you actually get my point.

So that part of your example is really irrelevant.
Actually, it is.

My point is that there's no reason the OP's example case couldn't work as he wrote it. It obviously doesn't, but there's no reason the plugin couldn't have.
Please do not evade my example. Regardless of how weird is my example, this is a sample case you need to solve.

The conditional branch would not make sense unless the move route is executed first. Plus, since this is a common event menu, the conditional branch will be executed, in both when the event is executed and menu tag scan?

but there's no reason the plugin couldn't have.
I literally give you the reason.

It would just rely on the user to make sane conditionals and if they don't, oh well, that menu item doesn't work as expected.
And what counts as sane conditionals? At the programming level, everything is sane. It worked as expected to work.

There are other plugins that give much more complicated responsibilities to users - look at Yanfly's Quest Journal, or any number of Achievement Trackers or the Encyclopedia entry things.
If possible, I would appreciate if you bring those example here rather than asking me "go look up at some others". Chance is I might not get it, or if I think it is relevant to our current topic. I also have a script that gives much more complicated responsibilities to users, go look up my battle system script in VXAce.

By evaluating the value of that variable at the time of you opening the menu screen.
So, are we ignoring control variables?
 

Latest Threads

Latest Posts

Latest Profile Posts

Feeling cute, might make an essay on the presence of Malaise in the gaming industry. idk
Just went to Metrocon here in Tampa Florida. My first anime convention. They had an anime chess battle and some funny impromtu comedy. The comedy was my favorite part. How is everyone?
I'm thinking about opening a "game in development" thread, though i'm not entirely sure yet. It's still really early in development, and most i have to show are assets or really chaotic map WIPs. There is a lot of story +the world itself though, and i struggle with converting all of my notes into readable text, and a thread might help...?
I see a button in a game, I press it. Cannot resist the temptation even if I know it's a trap.

Forum statistics

Threads
113,591
Messages
1,076,069
Members
147,589
Latest member
daldantas
Top