Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[RMXP] Eventing Help ...

Alright, after fiddling and thinking about it for so long my head is all jumbled up but I'll try to explain it as best as I can.
First off, this event is working with Near's Advanced Time System. So, I don't know if it's possible.
I'm not that experienced but I think I've tried everything I can think of.

Ok, so my main objective is to get certain npcs to be able to talk to during the day but disappear during the night.
Sounds simple right?
So I start out with a conditional branch with the condition: call script
The script: $ats.hours_is >= 9 and $ats.hours_is <= 19
So when it's between 9 am and 7 pm is when I want this npc to appear and be able to initiate conversation.
The problem is that I have to have the trigger set on Action Button instead of Parellel Process so you don't see the text pop up where ever you are. But then that means the conditional branch will only check the time if you talk to the person, right? So the npc will not disappear unless you talk to them.

So then I tried getting a little more complicated and adding a few more conditional branches within the conditional branches which just led to tons of confusion. So I tried:

---
Conditional branch: Script: $ats.hours_is >= 9 and $ats.hours_is <= 19
Conditional branch: Self Switch A == Off
Conditional branch: Self Switch B == Off
@> Self Switch A == ON

Else

@> Self Switch B == ON

Branch End

Else

Branch End

Else

Branch End
---

And made it a parallel process. So if I made it right I wanted it to check if it was between 9 and 7, if it is check to see if self switch a is off, then b. I previously tried just looping the event but since it was a parallel process it was too laggy to even start the game.
So on event page 2, Self Switch A is ON, I made that into an action button and made a text event.
On event page 3, Self Switch B is ON, I made a Change Graphic to None which was a parallel process.

But since I was silly enough to forget that then the first page wouldn't loop, I ran across the same problem on page 2 which I originally thought I could just turn self switch A and B off but that still required the Action Button or it wouldn't execute.

So as you can see I just started to confuse myself and thought I'd ask for help.
Any ideas or suggestions are appreciated.
 
Why not put these commands in two events?

Ex.

Event 1, Parallel Processing
Code:
@>Conditional Branch: Script: $ats.hours_is >= 9 and $ats.hours_is <= 19
   @>Control Switches: [NPC Appear] = On
 : Else
   @>Control Switches: [NPC Appear] = Off
@>Wait: 1 frame

Event 2, NPC, Trigger: Switch [NPC Appear], Action Button
Code:
@>Show Text: hi im appear'd!

It makes things a lot simpler, and on the plus side you can make multiple events appear and disappear at set times.
Good luck with it.
 
So, that would work if I was only using that exact time frame for everything, right?
I'm using several npcs and would like to make a similar event for each but not all disappear at the same time to, hopefully, add the effect of realism.

So, would I have to make a different switch for each time frame?
i.e.

@>Conditional Branch: Script: $ats.hours_is >= 9 and $ats.hours_is <= 19
  @>Control Switches: [NPC Appear 9a-7p] = On
: Else
  @>Control Switches: [NPC Appear 9a-7p] = Off
@>Wait: 1 frame
---
@>Conditional Branch: Script: $ats.hours_is >= 10 and $ats.hours_is <= 19
  @>Control Switches: [NPC Appear 10a-7p] = On
: Else
  @>Control Switches: [NPC Appear 10a-7p] = Off
@>Wait: 1 frame
---
etc ..
 
Yeah, you'd need a different switch for every NPC.

The only problem I really see there is, though, if the player is on the map when the time comes, the NPC will just (dis)appear out of nowhere, which might be a little unrealistic.
 
Ah, that's true, haha.
Well maybe instead I'll just set them on a path or something.
I appreciate the help! This doesn't sound too difficult to do so I'll give it a shot.
Thanks!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top