RePeat

Veteran
Veteran
Joined
Jul 24, 2021
Messages
32
Reaction score
11
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
14
Reaction score
8
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,531
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
44,094
Reaction score
15,509
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
14
Reaction score
8
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
32
Reaction score
11
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 Posts

Latest Profile Posts

Surprising nobody, it turns out "next Friday" for the next Jump into Javascript has become "possibly Sunday if you're lucky" XD
Folks, if anyone sends you a message inviting you to add their API to your game, please report them. We don't want people spamming our members asking them to add stuff to their games for their own (or others') benefit. We've updated the forum rules to confirm this.
I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)

Forum statistics

Threads
117,013
Messages
1,103,814
Members
152,911
Latest member
WakeNBake
Top