• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Time reactive event

40
Posts
8
Years
    • She/Her
    • Seen Apr 11, 2024
    I'm not sure if this is something that is around already but I searched and couldn't find anything.

    I'm attempting to create an event that only happens between specific hours.
    So for example, if the time is between 00:00 and 02:59, the event does what I ask.

    Any event like a mart showing a specific item list at the time
    or a lapras styled thing from gold and silver.
    A pokemon being found at that time, battled and if caught, stops, if not, comes back until it has been caught.
    A door being unlocked at the time. (Obviously exitable at any time though to avoid being stuck)
    Even a person giving an item/pokemon or chatting a different line to the player.

    I simply don't understand how to code that. I'm assuming it's a conditional branch but otherwise I'm clueless.
     
    43
    Posts
    8
    Years
  • Well, there's a lot of way to change, like using conditional branch. if you want that event unlock at the time, from that time to day ( or night) or backward, use:
    time.hour >="h" && time.min<"min"
    with "h" is hour and "min" is minutes, example:
    Time reactive event

    That mean if the time before 20 minutes and after 6 am, the event display 'come in' , and 'go away' if otherwise.
    Of course you can change what's event doing in that time by yourself. You also can change Time.hour and Time.min to what you like.
     
    40
    Posts
    8
    Years
    • She/Her
    • Seen Apr 11, 2024
    Well, there's a lot of way to change, like using conditional branch. if you want that event unlock at the time, from that time to day ( or night) or backward, use:

    with "h" is hour and "min" is minutes, example:
    https://www.upsieutoc.com/images/2015/11/08/Untitled8a035.png
    That mean if the time before 20 minutes and after 6 am, the event display 'come in' , and 'go away' if otherwise.
    Of course you can change what's event doing in that time by yourself. You also can change Time.hour and Time.min to what you like.

    I tried your method. It just came up with an error instead.
    Code:
    Exception: RuntimeError
    Message: Script error within event 2, map 82 (Draekon Valley):
    Exception: NameError
    Message: (eval):1:in `pbExecuteScript'undefined local variable or method `time' for #<Interpreter:0x559a6a8>
    ***Full script:
    time.hour>=8 && time.min<30
    Interpreter:243:in `pbExecuteScript'
    Interpreter:794:in `eval'
    Interpreter:243:in `pbExecuteScript'
    Interpreter:794:in `command_111'
    Interpreter:320:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `update'
    Scene_Map:101:in `loop'
    
    Interpreter:276:in `pbExecuteScript'
    Interpreter:794:in `command_111'
    Interpreter:320:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Unfortunately, you shouldn't believe everything someone gives you without research in to it yourself... ItachiVolcanion is some what right, but the execution is wrong... What he's done here is search through the scripts and found time.hour or time.min or time.month and thought that's all there is to it... It's not... time here, means diddly squat, you must set time to something.

    You can however, use Time.now.hour<=5 for example.
     
    Back
    Top