Need help on creating a particular event

KingofSlacks

Villager
Member
Joined
Jun 11, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Hi all,
I don't think script is needed for this, but I am currently creating an event where "Merchant" in house walks outside of the house and go to the green colour bush where he cannot be interacted until he reaches to the bush. After a few mins, he will go back to the house where again he cannot be interacted on the way back. I want the Merchant to keep doing that same event every few intervals. But I'm not really sure how to do it

To put it in simpler terms, imagine a merchant opening a shop just outside his house at a certain hour and later closes his shop and go back to his house.
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
there are different ways to handle this, but they all depend on one question:
How do you define your time?

There are several different forms of time systems, some using scripts and others using events and even a few ways to only pretend to have a time set. And way this event needs to be structured depends on how your time system works.
So you need to give us some more info on where you stand in regards to time.
 

KingofSlacks

Villager
Member
Joined
Jun 11, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMVXA
there are different ways to handle this, but they all depend on one question:
How do you define your time?

There are several different forms of time systems, some using scripts and others using events and even a few ways to only pretend to have a time set. And way this event needs to be structured depends on how your time system works.
So you need to give us some more info on where you stand in regards to time.
Hi Andar, thanks for the reply. I'm currently using Vlue Script.
I have insert an event if condition "GameTime.hour? >= 10 and GameTime.hour? <= 14 and GameTime.day_week? == 1"

Where Gametime.hour represents the time of hour and gametime.day_week represents the day of the week

To put it simply merchant will appear in between 10 am and 2pm but not appear any other times and only appears on Monday.

I just can't find the logic or the idea on how to go on about the merchant walking in and out selling items.


Do point out or correct me If I'm wrong, I have created 2 seperate events. Event 1 and the Merchant event.

The merchant was able to walk in and out but wasn't able to loop from there
 

Attachments

Last edited:

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
480
Reaction score
1,467
First Language
Indonesia
Primarily Uses
RMMV
It certainly would be much simpler if it doesn't involve syncing it with time system...
At much you may only create an illusion.

Example of what makes it complex:
What should happen if the player re-enter the map while the NPC is in the middle of moving?
- Reset movement from the start until finish? (awkward)
- Skip the entire movement? (stick to its schedule)
- Remember its last position? (not possible yet)
What should happen if NPC movement is interrupted?
- Phase through? (stick to its schedule)
- Stopped? (the player may ruin its schedule)
Does time are supposed to stop if player in the middle of event?

This is the most optimal solution I can come up with...
Every map shall have an autorun to initialize what event should exist on the prepared schedule. When the event is on schedule, forcefully set its location and turn ON their corresponding switch. The default should be OFF.
This handler is useful for dealing with multiple events which utilizes schedule.
Use fadeout before any transfer event to cover this initialization.
1599471222630.png

The NPC will have 4 state which represented by its page. Two of them is the moving phase which is using parallel process. Since time only move forward, their page priority are set with this manner.

First is when the NPC is moving in. Set the time as the condition when the NPC should've arrived.
1599471392581.png

Second is the NPC actual event. You only need the switch for its condition.
1599471896209.png

Third is when the NPC not available (empty event). Set the time for the condition when the NPC should not be there.
1599471936178.png

The last is when the NPC is moving out. Set both the time and switch as the condition.
1599472137136.png

Things to be noted:
- It will skip the movement when you re-enter the map. So you can only see the event moving if time progress and the player still on the same map.
- It's possible to not use a parallel process. But it will cause issues for MV users.
- It cannot be interrupted when moving but it will stick to its schedule.
- PM me if you need a sample demo.

EDIT:
I just saw your post above. It's better to convert that script into a variable because you are dealing with event pages.
You may keep that parallel check, but use it to convert the time to a variable instead.
Keep it light by adding wait for update (depend on time update).
1599474197998.png
 
Last edited:

KingofSlacks

Villager
Member
Joined
Jun 11, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMVXA
It certainly would be much simpler if it doesn't involve syncing it with time system...
At much you may only create an illusion.

Example of what makes it complex:
What should happen if the player re-enter the map while the NPC is in the middle of moving?
- Reset movement from the start until finish? (awkward)
- Skip the entire movement? (stick to its schedule)
- Remember its last position? (not possible yet)
What should happen if NPC movement is interrupted?
- Phase through? (stick to its schedule)
- Stopped? (the player may ruin its schedule)
Does time are supposed to stop if player in the middle of event?

This is the most optimal solution I can come up with...
Every map shall have an autorun to initialize what event should exist on the prepared schedule. When the event is on schedule, forcefully set its location and turn ON their corresponding switch. The default should be OFF.
This handler is useful for dealing with multiple events which utilizes schedule.
Use fadeout before any transfer event to cover this initialization.
View attachment 159637

The NPC will have 4 state which represented by its page. Two of them is the moving phase which is using parallel process. Since time only move forward, their page priority are set with this manner.

First is when the NPC is moving in. Set the time as the condition when the NPC should've arrived.
View attachment 159638

Second is the NPC actual event. You only need the switch for its condition.
View attachment 159639

Third is when the NPC not available (empty event). Set the time for the condition when the NPC should not be there.
View attachment 159641

The last is when the NPC is moving out. Set both the time and switch as the condition.
View attachment 159645

Things to be noted:
- It will skip the movement when you re-enter the map. So you can only see the event moving if time progress and the player still on the same map.
- It's possible to not use a parallel process. But it will cause issues for MV users.
- It cannot be interrupted when moving but it will stick to its schedule.
- PM me if you need a sample demo.

EDIT:
I just saw your post above. It's better to convert that script into a variable because you are dealing with event pages.
You may keep that parallel check, but use it to convert the time to a variable instead.
Keep it light by adding wait for update (depend on time update).
View attachment 159660

Thank you so much, Kuro DCupu! :D
I have to agree with you on the complex part. Never thoughtof the issues that you stated above.
I'll follow your method and will PM you if I need a sample demo tomorrow.
It's getting late here. Once again, thanks for the help!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
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'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top