Need some help with Autonomous Movement and Common Events

The_Ez

Villager
Member
Joined
Mar 25, 2012
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Hey all, I'm trying to make some semi-advanced pathing routes for my game. Time, NPC type, etc, will all affect where they go and what they do, but I also want them to remain interact-able and not have hundreds of event specific common events.

I've settled on using $gameTemp.reserveCommonEvent(n); called from a custom autonomous move route, which leaves the event itself free for all the normal stuff. The problem though is that when I call the common event in this way any event command in the common event that contains "this event" (set move route, set event location, etc) all fail to work.

Couple of quick pics since the above was a bit hard to follow.

Fails.jpg

Common event fails to move event 6 (and yes, event 6 is the event containing the autonomous move route).

Works.jpg

And yet this one works perfectly because it specifically calls event 6 rather than "this event".

Is there an additional piece of code I need to use in the custom movement script call to set some hidden "this event" variable? Or am I just doing something wrong?

I also realised when I was uploading these that I'm using qmove, so I made a new game 100% plugin free but still had the same issue.

Any help would be greatly appreciated.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
$gameTemp.reserveCommonEvent detaches the common event from the map event. Plus only one can be reserved at a time, so if you have lots of events on a single map doing this, many of them will be skipped and only a few will actually run. For a common event to work from a map event, you need to use the Call Common Event event command.

Back to the drawing board.
 

The_Ez

Villager
Member
Joined
Mar 25, 2012
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Damn. Thanks for the quick reply though.

Edit - Did that really just censor damn? lol
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Yes it did. Even with profanity content enabled it censors lots of swears, even the basic ones.
 

The_Ez

Villager
Member
Joined
Mar 25, 2012
Messages
8
Reaction score
0
First Language
English
Primarily Uses
$gameTemp.reserveCommonEvent detaches the common event from the map event. Plus only one can be reserved at a time, so if you have lots of events on a single map doing this, many of them will be skipped and only a few will actually run. For a common event to work from a map event, you need to use the Call Common Event event command.

Back to the drawing board.
Sorry to hit you up with another question so soon, but does that common event run limit apply to all common event calls or just the reserve script?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,357
Reaction score
7,671
First Language
German
Primarily Uses
RMMV
@The_Ez
There is another fact that you should keep in mind when working in this area.

Every map event has only a single move route attached to it, and both the set move route command and the autonomous move section overwrite that moveroute when doing something. Multiple commands to program that move route always result in the latest program to be effective and overwriting the command list there.

The autonomous movement does this whenever it loops to the next iteration, so your structure would have required waits for however long the move route in the set move route command of the common event would have been, or the autonomous movement would reset that move route on its next loop.

"Set move route" event command and the autonomous movement section can be mixed if you keep that in mind, but the timing can get complex and I usually advice against mixing those areay unless you know exactly what you're doing. Of course sometimes there is no other way, and this post is more FYI to keep this in mind.

EDIT:
about your common event question above:
it applies to all common event, but please check Tsukihime's blog - she has a plugin for a common event queue that removes that limit, if that plugin is compatible to the rest of your plugins.

EDIT2:
or more precisely explained, everything that calls multiple common events in one go (like the feature on the skills) will result in only one CE processed, that is why you can only attach one CE to a skill or item.
But a call common event will wait until the called common event returns, so if you sequence several call commands they will not overwrite each other.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top