Smart Pathfinding

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
After some testing, your method save me so much work!!!


Thanks a lot for this suggestion.


But I facing a problem.


First time I call the event withing TabA of my event ,within the default moveroute, it's work great.


But when I call it from the TabB, the same way, I got "Unexpected error"...


Any idea why? I know you will need more information for help me, so just ask me what info you need =:0)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
That can't be the whole error message.  Please provide the whole message, as well as the information from the console log.


It sounds like you've got multiple event pages splitting up processing for a single cutscene - that never ends well.
 
Last edited by a moderator:

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
Curently I didt hav multiple event pag anymore on this even for a single cut scene. And yes it's the whole errror.


I will try to do my best for show you log but when doind it, I discover what the problem comming from. I forgot a "," and that was creating the problem.


But anyway thanks for your reply, you provide great support of your pluggin. -;0)
 

AntiGM

Villager
Member
Joined
Dec 23, 2015
Messages
9
Reaction score
0
First Language
Russian
Is it possible to make so that the event lasted only after the completion of the movement?
If possible, tell me how it's done.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
Is it possible to make so that the event lasted only after the completion of the movement?
If possible, tell me how it's done.
Not sure to understand. In fact I need the script code to put in conditional branch that told if the event was executing a moveroute.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
This is a pathfinding plugin. If you want something else to happen to the event, you have to do it yourself. Look at some of the add-ons that have been posted - one of them I think lets you do a test to see if the event has reached the destination.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
This is a pathfinding plugin. If you want something else to happen to the event, you have to do it yourself. Look at some of the add-ons that have been posted - one of them I think lets you do a test to see if the event has reached the destination.
sorry, i posted my last post on the wrong tread..
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
@XGuarden I was replying to the post above yours.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
You can add a loop that keeps checking to see if the event's x and y coordinates are where you want them to be - once they are, cancel the pathfinding and use a Set Move Route to make them face the direction you want. Make sure your loop includes a Wait command so it can come up for air and let other things do their stuff.
How exactly to cancel the pathfinding? I use it for player and after it reaches destination (x, y from variables), player always goes back to the same place when I try to go somewhere else.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I think what you are asking is not what you are trying to do.

You quoted my instructions to cancel pathfinding - you use a move route which cancels the pathfinding move route.

I think what you want to do is make the event stay there at the end of the pathfinding, and to still be there when you leave the map and come back. In that case, you need a plugin that will save the event's current location and move it to that location each time the map is loaded, because by default events will always go to the place you put them in the editor.

If that's what you want, add the following plugin, and after the event finishes the pathfinding, add SavePos in a new move route script call.

https://forums.rpgmakerweb.com/index.php?threads/save-event-position.50261/

In addition, if the event keeps going back to the original position and then does the pathfinding again, you stop that happening by adding a new event page with a condition, and then enable that condition when you don't want it to pathfind anymore.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
I want a player to choose the destination when he is in an airship before the moving begins. I can do it by changing player graphics to an arrow and when player hits enter, parallel event saves x,y coordinates, fades out, teleports player to previous destination, gets on vehicle, fades in and then your script moves player to the saved destination. After moving ends I want a player to let choose another destination to go. But it always returns back whenever player realeases moving keys. It kind of works if player hits enter before returning. That's why I need to somehow stop your script that it will let to go to in other places when player reaches destination.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
It will cancel automatically when the player reaches the destination. If it isn't, then you've possibly got it in a parallel process event, or some kind of event that keeps repeating / getting called.
 

piksalh

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
well yes, it's in parallel event, because I want to activate it only when player presses enter. how to stop it in the parallel event?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
if it's only meant to activate when the player presses enter, but it's always activating, then there's something wrong with the design of your parallel event. You can post it (in a new thread) if you need help sorting it out.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
484
Reaction score
288
First Language
Portuguese(BR)
Primarily Uses
RMMV
Edit:
Great plugin shaz! Event pathfinding is a lot better now.
(Also, working perfectly with all my plugins in 1.5.2)
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
@elpeleq42 I got an email with your original post. I guess you've figured out that you don't use the plugin command in a move route, but you need to use the correct script call instead. Let me know if you're still getting those error messages.
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
395
Reaction score
145
First Language
English
Primarily Uses
RMMV
My characters are smarter... but not by much.
 

MXMichaU

Villager
Member
Joined
Jan 14, 2018
Messages
7
Reaction score
0
First Language
Polish
Primarily Uses
RMMV
What should i type in plugin command to make event smartly approach the player ?
And where i can find event ID ?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Use the plugin command SmartPath eventID1 eventID2 to make event 1 find a path to event 2

... eventID1 and eventID2 can be a number for a specific event (no leading zeros), 0 for the event issuing the plugin call, -1 for the player, or $gameVariables.value(id) to get the event number from the specified variable (replace id with the variable id, no leading zeros).
EventID is the number shown when you have the event open in the editor. Don't use leading zeros. The player does not have an event id. Use -1.
 

MXMichaU

Villager
Member
Joined
Jan 14, 2018
Messages
7
Reaction score
0
First Language
Polish
Primarily Uses
RMMV
When i type "SmartPath eventID22 eventID-1" in plugin command (Event that should find player ID is 022) there is an reference error - "EventID22 is not defined". I don't know what should i do, can you help ? (I am sorry that i am foolish, but i really dont understand ;p)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top