Resolving Custom move-routes?

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Hey people.

So I have a problem with custom move-routes.

The thing I planned for my game was to have Npcs to do certain actions, instead of just randomly walking around. I think that it would bring a little more life to the cities that way.

So I have this fisherman in my first town, and I have him set to walk down to the lake and trigger another events A-switch with a script call. Everything works fine and the event that should resemble a fishing line and a lure appears. The fisherman fish for a while and then walks back to a fireplace where he starts a fire. He then walks up to a store to buy some spices, and then walks back to the campfire to eat the fish. At another point of time I want him to appear at another place, maybe fishing with his son etc, etc. I wanted to do this to make some of the Npcs to have some kind of schedule, maybe spawn at the pub at one point and then appear at some other location.

But this is proving to be a lot harder than I thought.

Since the move-route always resets after leaving and re-entering the map, it messes up the event. If the fisherman in question gets to the pond and activares the event with the lure, and the player at this point leaves the map. Then if they return the fisherman will be placed at his original postion while the lure will still be visible.

I then fixed this by using Shaz's remember event position script, and even though it fixes the position, the event will still mess up because of the move-route. Even if I put a save position after a complete move-route, it will save the position anywhere in the move-route anyway. This means that the move-route restarts, while the position is changed resulting in the event walking the wrong move-route instead of the one needed.

I might have to scrap this idea, but I'm not sure how people makes custom-routes to work properly?
 
Last edited by a moderator:

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Any decent pathfinding script + Shaz's script to remember event positions. It works great for me at least, instead of following a "move route" the npc will simply find the best path to whatever his/her current event rendition is telling him/her to go towards. 

Edit: This is the pathfinding script I use: http://forums.rpgmakerweb.com/index.php?/topic/3064-pathfinding/, out of the ones I've tried it appears to work the most effectively.

The only problem being I guess that it will still reset your event to the beginning rendition (which can be pseudo-fixed by having each activity he does on a different self-switch controlled page so that upon reentering he'll still be doing generally the same thing he was last time.) 
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Any decent pathfinding script + Shaz's script to remember event positions. It works great for me at least, instead of following a "move route" the npc will simply find the best path to whatever his/her current event rendition is telling him/her to go towards. 

Edit: This is the pathfinding script I use: http://forums.rpgmakerweb.com/index.php?/topic/3064-pathfinding/, out of the ones I've tried it appears to work the most effectively.

The only problem being I guess that it will still reset your event to the beginning rendition (which can be pseudo-fixed by having each activity he does on a different self-switch controlled page so that upon reentering he'll still be doing generally the same thing he was last time.) 
Yeah, about the self-switches for each action, this was something that I tried as well. So even if the move-route resets he will still be fishing at the lake etc. But since it did reset the entire path input, and still kept its current position, it didn't work.

I'll see if I can get this running though, and see if it solves it!

Thanks a lot!

Edit: This works absolutely amazing, once again thanks :)
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
@Alexander How do you save the positions for the events without using a parallel process that runs all the time?, since I'm using the remember event position. I understand that the move-route script call is mainly for if you push an object in any direction and then want to save It's new position. I'm pretty unsure how I would be able to save the position in a move-route where it triggers all the time.

I tried puting the script: save_pos at the top of the move-route, but if I leave the map and come back it will reset.

The only way I have got it to work is to use a parallel event that will trigger the script calls repeatedly (I even tried using the erase event to prevent them running all the time, but then it doesn't work). Having several script calls running all the time might be a bit heavy though? Especially for lower PCs? I havn't experienced anything on the processing yet though, but still.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
I do it on my transfer events usually. So right before the call to transfer the player to a new map if say event # 7 was your fisherman I'd put the script call:

$game_map.events[7].save_pos() 

at the top of every transfer event so that the position of the npc is saved wherever it is whenever you actually leave the area to be used when you come back.

Edit: Using save_pos at the top of the move route wouldn't work because it only runs at the beginning of the move route or a repeat of the cycle (which would be in the same place.) so it would save only in the default position anyway.
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Ah I didn't think about using them in the transfer events. that will surely work :)

Yeah that's what I thought, and I'm pretty sure the move-route script was mainly inteneded for when you move an object in a direction and after that move having it being saved.

Well with the transfers I'll get rid of the constantly running parallel process at least.
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top