RMMV Running a common event from within an autonomous moveroute

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
For example, I want to run common event #135 from within a non-repeating autonomous moveroute. I've tried everything I could find on the MV/MZ Script Call List, but nothing seems to work so far (probably my brain's fault).

Thanks!
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
774
Reaction score
737
First Language
german
Primarily Uses
RMMZ
There's a JS function that could do the trick. In the Move Route, call JS script and insert $gameTemp.reserveCommonEvent(135)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,313
Reaction score
10,176
First Language
German
Primarily Uses
RMMV
unfortunately that function only tells the engine "execute the common event next time you have everything ready, which is usually too late if you consider reserving it in a move route.

@HankB
can you give us a few details on what exactly you want, preferably with screenshots?
because not only what you want does not exist, your description is also incorrect: all autonomous move routes automatically loop, it is always repeating.
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
@Aerosys


I already tried that from previous searches, and it's not doing the trick. To be exact, I have event #1 with this in the autonomous moveroute:

$gameTemp.reserveCommonEvent(39)

Common event 39 is exactly this:

Wait: 60 frames
Show Animation: This Event: Hit Physical (wait)
Wait: 60 frames
Show Animation: This Event: Hit Physical (wait)
Wait: 60 frames
Show Animation: This Event: Hit Physical (wait)

Nothing happens. I'm not sure, but I think "reserveCommonEvent" is a highly specialized command that only works in specific situations (thus the term "reserve" instead of something more general, like "runCommenEvent".


@Andar

all autonomous move routes automatically loop

I didn't think that was true, since you can check/uncheck the "Repeat Movement" box within the Autonomous movement UI.

unfortunately that function only tells the engine "execute the common event next time you have everything ready, which is usually too late if you consider reserving it in a move route.

OK, so I'll just have to figure out another way to do it, probably with a bunch of complicated switches. Yay.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,313
Reaction score
10,176
First Language
German
Primarily Uses
RMMV
OK, so I'll just have to figure out another way to do it, probably with a bunch of complicated switches. Yay.
that is why I asked yyou to describe what you want to happen, so we can help looking for alternatives on how to do what you want.

at the moment we can't help there, because you only wrote how you want to do "something", without giving a full description of what that "something" is.
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
unfortunately that function only tells the engine "execute the common event next time you have everything ready, which is usually too late if you consider reserving it in a move route.

This is exactly what I needed to know. Thank you, Andar.

that is why I asked you to describe what you want to happen, so we can help looking for alternatives on how to do what you want.

at the moment we can't help there, because you only wrote how you want to do "something", without giving a full description of what that "something" is.

This is one of those situations where the amount of time it would take to explain what I'm trying to do would be greater than the amount of time it would take for me to just figure it out on my own. In fact, I think I already figured out an elegant solution while typing that last sentence.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,420
Reaction score
5,109
First Language
English
Primarily Uses
RMMZ
This is exactly what I needed to know. Thank you, Andar.



This is one of those situations where the amount of time it would take to explain what I'm trying to do would be greater than the amount of time it would take for me to just figure it out on my own. In fact, I think I already figured out an elegant solution while typing that last sentence.
Why didn't you just have the waits and animations be part of the event with the move route?
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
Why didn't you just have the waits and animations be part of the event with the move route?
Because the moveroute was happening at the same time as the parallel event. Trust me, it's complicated. Everyone always wants to know "why this?, why that?, what exactly are you trying to accomplish?, why don't you just do X, Y, or Z"?

I'm making a game, and games get really complex, and sometimes I just need an answer to a question without having to explain every detail about why I'm asking the question.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,110
Reaction score
3,168
First Language
EN
Primarily Uses
RMMZ
I'd consider making the common event Parallel and use the Switch ON move command to start it from within the move route. You can turn off the switch again at the end of the common event so that it only runs once.
Reserve common event "triggers" the event, but (like Andar mentioned) it can only actually start when the main interpreter is not busy running another event. Parallel events are the only type that are not handled by the main interpreter, which lets them run in the background.

By contrast, the Common Event command sets up a temporary "child" interpreter to run the requested event. Each update cycle, an interpreter will update its most deeply-nested child, if present, instead of itself. So it's equivalent to basically copy+pasting that event's commands into the current event.

Also, by default RMMV only stores the most recently-reserved common event. This may be relevant if you're trying to reserve multiple events at once, e.g. multiple Common Event effects on a skill/item.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,420
Reaction score
5,109
First Language
English
Primarily Uses
RMMZ
Because the moveroute was happening at the same time as the parallel event. Trust me, it's complicated. Everyone always wants to know "why this?, why that?, what exactly are you trying to accomplish?, why don't you just do X, Y, or Z"?

I'm making a game, and games get really complex, and sometimes I just need an answer to a question without having to explain every detail about why I'm asking the question.
I'm trying to help you, so kindly leave your passive-aggressive responses at the door. Sometimes knowing why you want to do something helps us either point you to a more efficient method of doing the same thing, or gives us extra context that makes it easier to figure out how to do what you're asking for.

Are you aware that having two move routes in an event with the first one *not* having the "wait" box checked will cause both of them to run simultaneously?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,313
Reaction score
10,176
First Language
German
Primarily Uses
RMMV
I'm making a game, and games get really complex, and sometimes I just need an answer to a question without having to explain every detail about why I'm asking the question.
Yes, we know that - this is a forum for game developers after all, and everyone around here has made or is making their own game.

But there is something that you are missing:
Everything around the engine is designed to make game mechanics as simple as possible to develop, and in 90% of all case where a user had problems with a complicated solution, the reason for that complexity was because the user needlessly created that complexity and a different approach simplified matters enormously.

We do NOT want you to explain a complex mechanic that you are implementing - that is exactly the wrong way to handle things as I already said above when I said we do not want you to explain how to do something.
What we want is a description of the effect how it should be seen by the player, and not how you want to implement that.

Then we tell you the principles we can think of how to implement that something, and you can check if one of those principles makes things much easier than the complex structure you currently have.
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
@Trihan You're right, that was a little passive-aggressive on my part, and I apologize. You were genuinely trying to help, and I got annoyed and was kind of a D-head. Truly sorry, and a little embarrassed.


I'd consider making the common event Parallel and use the Switch ON move command to start it from within the move route. You can turn off the switch again at the end of the common event so that it only runs once.

That's funny, that's (almost) exactly what I did.

But there is something that you are missing:
Everything around the engine is designed to make game mechanics as simple as possible to develop, and in 90% of all case where a user had problems with a complicated solution, the reason for that complexity was because the user needlessly created that complexity and a different approach simplified matters enormously.

Very well stated, and I understand what you're saying and totally agree. I was making it more complicated than it needed to be. I generally try to wait until I'm really stuck on something before posting a question, but for some reason just posting a question on the forums seems to help me figure out the solution on my own.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,420
Reaction score
5,109
First Language
English
Primarily Uses
RMMZ
@Trihan You're right, that was a little passive-aggressive on my part, and I apologize. You were genuinely trying to help, and I got annoyed and was kind of a D-head. Truly sorry, and a little embarrassed.




That's funny, that's (almost) exactly what I did.



Very well stated, and I understand what you're saying and totally agree. I was making it more complicated than it needed to be. I generally try to wait until I'm really stuck on something before posting a question, but for some reason just posting a question on the forums seems to help me figure out the solution on my own.
I appreciate the apology and acknowledgement, thank you.

Did caethyril's suggestion work for you, or are you still trying to sort this?
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
Did caethyril's suggestion work for you, or are you still trying to sort this?
I just noticed that I skipped that question, my bad. I had already figured out a solution that was almost identical to caethyril's suggestion. To answer your question, the problem seems to be completely sorted, but you know how these things are. I'll probably be back asking another question in the next few days
 

Latest Threads

Latest Posts

Latest Profile Posts

Just gonna leave this here lol. 7th cycle endless mode :D 700% enemy dmg or something.
I think I'm going to play the Saitama Theme BGM next time I delve into the JS library of RPG Maker MV... :kaoswt2:
I'm already excited for next spring, the new confirmed release date for RPG Maker Unite!
Come and join me in 10 minutes for Throwback Thursday where I'll be playing Beneath a Steel Sky! https://twitch.tv/trihanstreams

Forum statistics

Threads
126,978
Messages
1,182,826
Members
166,833
Latest member
gasti99
Top