How to make Harvest Moon like NPC moving from one place to another?

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
I would like a smooth transition of an NPC appearing or seeming to go from one place to another. I thought I had it down but then when certain switches are on or off it messes up the other areas.


This is the order I would like

1.Npc starts off in house
2. Npc leaves house when timer = x specific number of hours
3. Outside the door, after the NPC is seen leaving the house inside, the NPC is then seen walking outside headed toward town
4. When you enter town you see the NPC entering town as well when x = specific number of hours
5. When Switch NIGHT is turn on and timer = x specific number of hours, NPC heads home and this process repeats.

There are flaws because if a switch is used when you are in the house with the NPC, the switch won't be noticed ON or OFF in town. So I need things fixed like the NPC seamlessly going into town or out of town REGARDLESS of where the player is.


I have been turning switches ON and OFF but keep finding holes such as when you beat the NPC even trying to return home or go to town, when you enter or exit the previous area you see the NPC walking past you even though he was just in town.

I'm not sure if this makes any sense. Could anyone please help? Is this even possible? Thanks!
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
I guess you can solve half the problem by answering the question: "can the player see the npc at one place, from another?"
can the player see the NPC IN the house, from not-the-house place?

since one person can't be in two places at the same time, I'd say you need a multiple conditional, with an index, AKA, a pointer. (and, a daylight system, but I assume you have that already)
you set the condition for spawning the NPC to be equal to an index number (0 or 1, to X).
at <your daylight system's interval of hour> you increase that number, and reset it after it's maximum.

think about vintage TV channel knobs: you turn it to point to either channel.
here, upon each hour change, you point to a different location.
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
Index number? Can you please clarify? I have worked with variables and branches but I am not sure what you mean by setting an index number. I have set a condition where IF timer = X number of hours then this switch ON, this switch OFF, move event. BUT. If the player is not in the area when IF timer = X the event does not work.

I have two switches for Day and Night. Called Day and Night respectively.

Edit: In an example, NPC can't really teleport from one area to another. So I flip a switch inside to hide the NPC inside after an event shows it walking to the front door and then hiding the image to make it appear the NPC exited)

And outside a switch has been turned on for an event that was hidden/blank in front of the door that is now moving toward town. And repeat.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
4. When you enter town you see the NPC entering town as well when x = specific number of hours
how does "hours" relate to the Day and Night switches?

if you have an hours counter, you don't need a binary control (Day/Night, open/closed, etc).
just tie your NPC control to the *hours*, not to the *switches*: check for the hour in question, set a variable to the ID number of location (the index), and have the event NPC check for that variable == X for activation.
THAT, at each update of the hour..... you add 1 to the hour, and update the location index: if hour > X, location = 0; if hour > Y, location = 1; etc.

what you call "day" or "night", is just the collection of hours between sunrise and sundown, and sundown and sunrise..... there's no binary state there, it's a series of individual hours.
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
I said hours as in for relatively speaking. If that makes sense. ^^; Probably shouldn't have phrased it like that.

Well, right now I am testing it as 280 seconds in a day. At 180 seconds the switch NIGHT is turned on. Would this solve my problem of IF the player isn't in the area; but when timer = 100 seconds then a switch is turned on to show the NPC now is in the area when the player enters the area? (After I successfully test this as 280 I like to increase the seconds to something much higher)

Would it be too much to give me a visual please?

Edit to answer your question: "how does "hours" relate to the Day and Night switches?"

Right now I have events set up on parrarel process that check if timer = x number of seconds, say 160, and if SWITCH NIGHT ON then turn on these switches, turn off these switches to make the NPC event move or hide. If that makes any sense...
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
nuevo-1.jpg

if "variable that specifies spawn location" equals "my location", spawn me.... otherwise, remove me.

in the clock event, add a ping to the variable +1, and use *that* variable to control the events.
 

dulsi

Veteran
Veteran
Joined
Dec 4, 2018
Messages
88
Reaction score
71
First Language
English
Primarily Uses
N/A
With some work I've managed to do it with one character. I can block the characters movement and if I block her long enough it becomes day and she goes back to her spot. It is not easy. Hopefully someone knows a better way. I'll try to post my implementation tomorrow. While the character is walking to their spot, you can't talk to them which I don't like.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
... While the character is walking to their spot, you can't talk to them which I don't like.
You can talk to them while they are moving.

The Picture with the Eventcode looks a little bit wrong somehow.

One Question, do you need the NPCs to Move to the next Map with walking there, or is Fading the Screen Out and In when Daytime changes enough? I mean maybe you allready got a fade when you change from Midday to Evening?
 
Last edited:

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
I'm going to try this event out later. And then update this.

Just wanted to comment to dulsi that I have been able to talk to them while moving, but they keep moving at the same time. ^^; Are you using a switch that changes pages to where there is nothing to talk too? Does that make sense?
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
While Brainstorming about a conditional Tree. I get one Question, what if the NPC moves 5 out of his 20 steps to the next map. If the player now leaves the map and comes back 1 second later, would it be ok that the remaining 15 steps of that Event got skipped? Edit: I mean do you want to keep track of every single of the NPCs steps?
Code:
◆If:Current Hour ≠ Prior Hour
  ◆Control Variables:#0002 Prior Hour = Current Hour
  ◆If:Current Hour = 1
    ◆Comment:NPC in Bed
    ◆
  :End
  ◆If:Current Hour = 2
    ◆Comment:IF you leave Map here and reenter 1 sec later, this will be skipped.
    ◆Comment:NPC gets out of the Bed and starts Moving from Map1 to Map2
    ◆
  :End
  ◆If:Current Hour = 3
    ◆Comment:IF you leave Map here and reenter 1 sec later, this will be skipped.
    ◆Comment:NPC enters Map2 and Moves to Position.
    ◆
  :End
  ◆If:Current Hour = 4
    ◆Comment:NPC is on his Market Shop for the next hours.
    ◆
  :End
  ◆If:Current Hour = 9
    ◆Comment:IF you leave Map here and reenter 1 sec later, this will be skipped.
    ◆Comment:NPC goes from Market Stand of Map2 back to Map1
    ◆
  :End
  ◆If:Current Hour = 10
    ◆Comment:IF you leave Map here and reenter 1 sec later, this will be skipped.
    ◆Comment:NPC enters Map1 and is traveling to Position.
    ◆
  :End
  ◆If:Current Hour = 11
    ◆Comment:NPC is back in the Bed again.
    ◆
  :End
  ◆
:End
But maybe this is the wrong approach to a solution. I dont know, this turns out to become realy branchy =).
 
Last edited:

dulsi

Veteran
Veteran
Joined
Dec 4, 2018
Messages
88
Reaction score
71
First Language
English
Primarily Uses
N/A
I know you can talk to them while moving in Harvest Moon I just didn't see a way to make that work. Luckily I slept on it and figured out a better way.

My method is not easy. I'm having some trouble uploading it so I'll try to explain it for now. The basic premise is that you need to simulate where people are. In my implementation the common event which is incrementing time is also "moving" people who aren't on the current map. My simple test has the person moving a couple square forward. So I just keep the distance the person is from the door. If you come back to the screen it places the event based on simulated distance information. If you are having them move a long distance and not just straight, it might be a little tricky to create the simulation and figure out where they should be restored. (Right now my simulation is also much faster than how a person actually moves.)
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,253
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
@Bex
4 -> on market
9 -> moving

what's the action for 5, 6, 7 and 8?
if you're evaluating for "equal", you must give an option for EQUAL to 5, EQUAL to 6, .....
5 is not 4, and it's not 9 (and not anything either).... the program doesn't consider it being greater than 4 and lesser to 9, because you don't specify it.
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
View attachment 107827

if "variable that specifies spawn location" equals "my location", spawn me.... otherwise, remove me.

in the clock event, add a ping to the variable +1, and use *that* variable to control the events.
I notice your window looks a lot different than mine. Are we using the same program?

I set up the event but nothing happens as the var Daynight timer goes on to counting. I don't understand the event you are trying to show me.
I switched the NPC sprite to page 2 but then he doesn't "disappear" throughout the day. How do you suggest turning the self switch A off during a certain time? Thanks for all the help btw.

@Bex

I appreciate you trying to help. However, if the player is not on the same map as the NPC when hour = x, then that event is skipped entirely from what I've seen. And honestly, if it doesn't show the NPC walking from his house to town and he magically disappears from his house and is in town without seeing him walk to town, I'm fine with that at this point. Just trying to get this to work. I'm not even sure what I am asking is possible anymore.

One Question, do you need the NPCs to Move to the next Map with walking there, or is Fading the Screen Out and In when Daytime changes enough? I mean maybe you allready got a fade when you change from Midday to Evening?
I make them appear to move to the next map by turning on and off switches at the moment. There is no fading out, var timedaynight just keeps ticking. When it is day, or when var timedaynight = 0 then the map is bright and switch DAY is on. When it hits 180 Night switch is on. I would like to see movement though, yes. I have no midday. Though I am wondering if I should now...

@dulsi

If you do find a method please do share! So far I have just been using switches. My simulations are running fast too btw. Are you using the script to move them to an exact point? That helps.
 

Attachments

Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
@Bex
...
4 -> on market
9 -> moving

what's the action for 5, 6, 7 and 8? ...
This is no functional code example, its just the begining of the bare minimum to get/plan a start.
If we plan further we would get:
Code:
If:Current Hour = 4 and If Switch "NPC moving to marketplace ON"
Turn Switch "NPC on Marketplace On"
Turn Switch "NPC moving to marketplace OFF"
The switch would be the condition for the NPC_1 at his Marketstand, with his textbox.
The Switch stays on until Hour 9, so i dont have to worry about the hours 5,6,7 and 8.
But its still Bainstorming, so not sure if Switches are optimal for this or if there is another good or maybe easier way.
Edit:
However, if the player is not on the same map as the NPC when hour = x, then that event is skipped entirely from what I've seen.
You have the whole Hour from 2 to 3, so you could enter the map, 1 minute before 3 and you could still trigger the event walking to next map. (But for that there is some conditional branch logic needed, which isnt straight forward for a casual like me)

Edit2: Forget all i said, i have the feeling you can set all up with the Time Variable and Eventpage Conditions and some extra switches. I have a tendency to overcomplicate things at the first attempt.
 
Last edited:

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
Anyone else have a better idea?

I was starting to wonder if I should just stick with switches and maybe turn them on and off with the "Common Event".
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
Bump

I'm playing with switches. I would like to show movement of leaving the house and upon rentering the house, a switch turned on to hide the NPC so it won't show the animation again of leaving the house. Help would be appreciated.
 

mobiusclimber

Veteran
Veteran
Joined
May 3, 2018
Messages
265
Reaction score
150
First Language
english
Primarily Uses
RMMV
You have seperate maps for the town and the inside of the house, right? How about an invisible event in town that will only show at the right time, of the person leaving their doorway and walking around? If player goes into house, the event in the house can be turned off or on depending on what time it is. Or am I misunderstanding something here?
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
You have seperate maps for the town and the inside of the house, right? How about an invisible event in town that will only show at the right time, of the person leaving their doorway and walking around? If player goes into house, the event in the house can be turned off or on depending on what time it is. Or am I misunderstanding something here?
I'm doing just that. But I am running into problems. I do not know how to event it properly. I think I have the right idea just not the right order of switches, conditions, etc

I guess I'd need a visual.

I was trying to do this

HOUSE (npc starts here and walks around randomly) When timer greater than or equal to x, switch on the NPC turns on and Npc is moved out the door. HIDE NPC.

OUTSIDE Npc is walking towards another map. If you enter the house while NPC is seen walking outside the event inside will not repeat. (The event being NPC walks out the door, the first event) And when you walk back out, the NPC is removed hidden because you already saw the NPC heading to town. So now the NPC is now invisible.

TOWN When you enter town you will see the NPC walking to a specific spot, where the moving event will be turned off and an event on the specific spot will turn on, as if the NPC stopped walking and is now randomly moving around in that spot. (It's a trick on the eyes.)

But I have not succeeded in this at all. I waste many hours just trying to get this to work.


My main problem I think is if the player is playing the game and leaves the house or enters town etc They see the NPC event repeating because the NPC switches are not turned off/on until the NPC is finished moving.

Does anyone here understand me? :kaoswt:
 

mobiusclimber

Veteran
Veteran
Joined
May 3, 2018
Messages
265
Reaction score
150
First Language
english
Primarily Uses
RMMV
Have a switch for when the player enters or leaves the house, and let that control where the NPC is at and what they're doing. That way, when the player leaves the house, the NPC will be somewhere else doing something else and it won't just restart the "timer switch" that determines if the NPC leaves their house or not.
 

Sakurra

Is probably eating a brownie
Veteran
Joined
Sep 1, 2015
Messages
564
Reaction score
743
First Language
English
Primarily Uses
RMMV
Have a switch for when the player enters or leaves the house, and let that control where the NPC is at and what they're doing. That way, when the player leaves the house, the NPC will be somewhere else doing something else and it won't just restart the "timer switch" that determines if the NPC leaves their house or not.
Can you show me a visual please? ^^;
 

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

Latest Threads

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,190
Members
137,772
Latest member
Kirakirna
Top