MZ A question about parallel/autorun events

It is possible to select which event's contents will be executed in Javascript?

Screenshot 2022-06-13 113146.jpg

What I mean is for me to select which line above will be executed just by using Javascript. Thanks!
Is there a reason normal conditionals, loops, labels, etc. don't let you plan the event to play as you want? It sounds like the plugin you want is...um...the editor lol no offense, but you'll have to be more specific for me to offer better advice than that.
Is there a reason normal conditionals, loops, labels, etc. don't let you plan the event to play as you want? It sounds like the plugin you want is...um...the editor lol no offense, but you'll have to be more specific for me to offer better advice than that.
I want to do this in-game and in Javascript so that I can have better control. And speaking of label, is there a way to jump into a label using javascript?
You can jump to a certain label using interpreter.command119([label]). You would replace interpreter with the object that represents the interpreter that is handling that specific event, and you would replace label with a string that contains the name of the label. So for example:
JavaScript:
$gameMap._interpreter.command119(['Butt Label']);

You also can jump to a specific command in the event, if you really want to. I'd recommend looking at
Game_Interpreter.prototype.command119 in rmmz_objects.js for an example of how to do it.

But honestly, there is likely no good reason for you to be doing this. Or rather, it's very doubtful that you're going to run into a situation where this is somehow the optimal way to go about accomplishing whatever it is that you're wanting to do. Firstly, each parallel event has its own interpreter, so unless you're executing the script from within the same event, finding the correct interpreter will be more hassle than it's worth. But more importantly, like BenSD said, there are already adequate (and safer/easier) ways to control the flow of execution, so it simply doesn't make any sense to try to do what you're asking.
You can jump to a certain label using interpreter.command119([label]). You would replace interpreter with the object that represents the interpreter that is handling that specific event, and you would replace label with a string that contains the name of the label. So for example:
JavaScript:
$gameMap._interpreter.command119(['Butt Label']);

You also can jump to a specific command in the event, if you really want to. I'd recommend looking at
Game_Interpreter.prototype.command119 in rmmz_objects.js for an example of how to do it.

But honestly, there is likely no good reason for you to be doing this. Or rather, it's very doubtful that you're going to run into a situation where this is somehow the optimal way to go about accomplishing whatever it is that you're wanting to do. Firstly, each parallel event has its own interpreter, so unless you're executing the script from within the same event, finding the correct interpreter will be more hassle than it's worth. But more importantly, like BenSD said, there are already adequate (and safer/easier) ways to control the flow of execution, so it simply doesn't make any sense to try to do what you're asking.
I'll try this. Thanks for this.
You can jump to a certain label using interpreter.command119([label]). You would replace interpreter with the object that represents the interpreter that is handling that specific event, and you would replace label with a string that contains the name of the label. So for example:
JavaScript:
$gameMap._interpreter.command119(['Butt Label']);

You also can jump to a specific command in the event, if you really want to. I'd recommend looking at
Game_Interpreter.prototype.command119 in rmmz_objects.js for an example of how to do it.

But honestly, there is likely no good reason for you to be doing this. Or rather, it's very doubtful that you're going to run into a situation where this is somehow the optimal way to go about accomplishing whatever it is that you're wanting to do. Firstly, each parallel event has its own interpreter, so unless you're executing the script from within the same event, finding the correct interpreter will be more hassle than it's worth. But more importantly, like BenSD said, there are already adequate (and safer/easier) ways to control the flow of execution, so it simply doesn't make any sense to try to do what you're asking.
This is working. You guys are right. The label did the work for me.

What I use is $gameMap.event(event_id)._interpreter.command119(['label_name']);

Thanks!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/a-question-about-parallel-autorun-events.148494/