RePeat

Veteran
Veteran
Joined
Jul 24, 2021
Messages
31
Reaction score
10
First Language
German
Primarily Uses
RMMV
What I want is a timer going down after dialogue where one of the characters leaves at the end and when the timer reaches 0, said character re-appears.

It's all in the same event, so:
-we got the dialogue
-NPC leaving (he walks out of bounds and becomes transparent)
-Control timer, start, 6 seconds
-If timer <= 0 min 0 seconds:
-Text: "test"

In testing I see the timer reaching 0 but the test text doesn't appear. Weirdly, when I set the if-thing to >= the text appears immediately. The opposite <= doesn't work at all, it seems. I tried it with 0 and with 1.
 
Joined
Jul 8, 2021
Messages
13
Reaction score
6
First Language
English
Primarily Uses
RMMZ
I'm running into issues with timers myself, so I'm relieved that MV has that problem and it's not just an MZ issue. It's not any more intuitive in Visual Novel Maker, either.

One notable thing I want to do is set timers on battle-oriented maps so that when a certain amount of time passes, a switch turns on that introduces enemy reinforcements.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
525
Reaction score
1,528
First Language
Indonesia
Primarily Uses
RMMV
It's all in the same event, so:
-we got the dialogue
-NPC leaving (he walks out of bounds and becomes transparent)
-Control timer, start, 6 seconds
-If timer <= 0 min 0 seconds:
-Text: "test"

And that's where the problem is.
It's all in the same event.
Do you realize that normal events (action and touch) only run ONCE per trigger?
What happens there is:
- You set a timer for 5 seconds.
- The condition checks if the timer is 0 seconds.
- The condition reply: "Oh, the timer is 5 seconds since you just set it right above me!"
- Condition skipped since it's not equal or under 0 seconds (of course!).
- The event ends.

You want to make it dynamic, so you need to run the conditional check in a constant loop of a parallel process event.

Here's one solution:
- ONLY set up your timer on the trigger event.
- Activate a switch related to "other NPC leaving" that you are talking about at the end of it.
- Make a second page.
1629689084826.png

- On the second page, you put the conditional check of the timer.
- Use the switch as the page condition.
- Set the trigger to parallel process.
- Turn OFF the switch at the end of condition.
- You might want to turn off the timer as well.
1629689235925.png

- This will turn your trigger event into parallel process temporary as long as the timer is running.
- While in this state, you won't be able to interact with your trigger event.
- Make that other "NPC leaving" event to have the same switch as its condition.
1629689984734.png

- You don't have to turn the event transparent since it's already have the switch condition. It mean it's only visible when the switch is active.
- Finally, since you want the event to reappear in the start position, you also might want to do that on the trigger event just before activating the switch.

I hope you understand what you are doing.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,769
Reaction score
15,321
First Language
English
Primarily Uses
RMMV
What is the player doing while the NPC is gone? Are they waiting, or do you want them to be able to walk around?

If they are waiting and you don't want them to move around, don't use a timer at all. Just use the Wait command - Wait 360 frames will give you a 6 second pause.
 
Joined
Jul 8, 2021
Messages
13
Reaction score
6
First Language
English
Primarily Uses
RMMZ
And that's where the problem is.
It's all in the same event.
Do you realize that normal events (action and touch) only run ONCE per trigger?
What happens there is:
- You set a timer for 5 seconds.
- The condition checks if the timer is 0 seconds.
- The condition reply: "Oh, the timer is 5 seconds since you just set it right above me!"
- Condition skipped since it's not equal or under 0 seconds (of course!).
- The event ends.

You want to make it dynamic, so you need to run the conditional check in a constant loop of a parallel process event.

Here's one solution:
Your solution worked! Thank you!

I play tested my combat system several times with this and it's a blast to play.

To explain it my combat system in more detail, at certain points in the game there are battles players must participate in. The game warns players before entering one, so they can equip their units appropriately for the battle.

On the battle map, players are presented with an objective. In the case of my test, the objective is to escape to one of two exits on the far side of the map (a map appears that shows where these are.) Players have to traverse the map to reach the end. Meanwhile, enemy units will pursue them. There are also items scattered around the map for players to find.

This is where the timer comes in. I don't want all the enemies charging players at once. I want enemies to appear in waves. I created a switch for each wave of enemies and use the timer to time when they will appear.

There is a fair bit of strategy to these maps. Players can choose to fight enemy units or flee them. In this map, it is possible to escape without fighting any enemies, but players are rewarded one item for each enemy defeated (and also miss out on valuable experience by not fighting enemies.)
 

RePeat

Veteran
Veteran
Joined
Jul 24, 2021
Messages
31
Reaction score
10
First Language
German
Primarily Uses
RMMV
And that's where the problem is.
It's all in the same event.
Do you realize that normal events (action and touch) only run ONCE per trigger?
What happens there is:
- You set a timer for 5 seconds.
- The condition checks if the timer is 0 seconds.
- The condition reply: "Oh, the timer is 5 seconds since you just set it right above me!"
- Condition skipped since it's not equal or under 0 seconds (of course!).
- The event ends.

You want to make it dynamic, so you need to run the conditional check in a constant loop of a parallel process event.
Ah, makes sense. Well I did not have that in mind...
I hope you understand what you are doing.
Same.

What is the player doing while the NPC is gone? Are they waiting, or do you want them to be able to walk around?

If they are waiting and you don't want them to move around, don't use a timer at all. Just use the Wait command - Wait 360 frames will give you a 6 second pause.
I guess that would be one way to do it and I'll keep that in mind, but no, I would want the player to be able to move. I got myself a headache here and all I wanted to do was a practical joke. There's a misc quest in my game where you get dragged into helping out in a kitchen and after you're done you tell the boss, who then tells you there's more to do and goes off. At this point you're supposed to leave but I wanted a timer so that the boss actually comes back and gives you even more stuff to do, resulting in a Game Over lol
 

Latest Threads

Latest Profile Posts

I found an absolutely brilliant lifehack on the internet today.

Screenshot_760.jpg
It does sometimes get a little embarrassing that I often come here to ask for help with something and seldom have anything to actually show for it. If there is one thing though I can commend myself for, it's for sticking with an idea I've been tinkering with for this long now and gradually making headways. Even though I've been reserved about my progress, I can say I'm farther now than where I initially started.
I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!

Forum statistics

Threads
116,134
Messages
1,096,064
Members
151,555
Latest member
Fotdur
Top