• 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.

[Scripting Question] Setting Form during Evolution

11
Posts
7
Years
    • Seen Feb 5, 2017
    I've been attempting at this, but its pretty tough.

    Anyway, about Rockruff, it evolves depending on the version and the time of day, but since I'm not doing versions, its just time of day. What happens when I do this in Essentials is that whenever it is nighttime, Rockruff does evolve into Lycanroc, it is the Midday form, not the midnight form, but after evolution, it goes to Midnight Form. Which leads to my main question:

    Is there any way to set Lycanroc's form permanently during Rockruff's evolution?
     
    Last edited by a moderator:
    220
    Posts
    13
    Years
    • Seen Nov 29, 2021
    My first thought would be to just have it evolve into two different pokemon, but then you've got to try and disguise that.
     
    11
    Posts
    7
    Years
    • Seen Feb 5, 2017
    My first thought would be to just have it evolve into two different pokemon, but then you've got to try and disguise that.

    Yeah, that was also my first thought when I tried that, however, I also want to keep its National Pokedex Number. So that could retain a problem even if that did work..
     
    1,405
    Posts
    11
    Years
  • In Pokemon_MultipleForms, make it so game checks if it's day or night and assigns a form for Lycanroc on creation depending on what it gets.

    Code:
    MultipleForms.register(:LYCANROC,{
    "getFormOnCreation"=>proc{|pokemon|
       if PBDayNight.isNight? # I am not sure if this is the correct one
         next 1 # Midnight
       else
         next 0 # Midday
       end
    },
     
    Last edited:
    824
    Posts
    8
    Years
  • The actual trick is to make two forms for Rockruff, and force those based on the time of day. The two forms can be identical, so the player doesn't know it's a thing. When Rockruff evolves into Lycanroc, it will stay in whichever form it's in at the time it evolves, and that's how you pull the evolution off.

    Code:
    MultipleForms.register(:ROCKRUFF,{
    "getForm"=>proc{|pokemon|
       if PBDayNight.isNight? # I am not sure if this is the correct one
         next 1 # will evolve into Midnight
       else
         next 0 # will evolve into Midday
       end
    }
    })

    Then add the differences between forms for Lycanroc normally.
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    In PField_Time locate this code:
    Code:
    # Returns true if it's the evening.
      def self.isEvening?(time=nil)
        time = pbGetTimeNow if !time
        return (time.hour>=[COLOR="Red"]18[/COLOR] && time.hour<20)
      end
    Alter the above code in red and add this code immediately before:
    Code:
    # Returns true if it's dusk.
      def self.isDusk?(time=nil)
        time = pbGetTimeNow if !time
        return (time.hour==17)
      end
    Alter Rot8er_ConeX's code to something like this:
    Code:
    MultipleForms.register(:ROCKRUFF,{
    "getForm"=>proc{|pokemon|
       if PBDayNight.isNight? [COLOR="Red"]|| PBDayNight.isEvening?[/COLOR] # I am not sure if this is the correct one
         next 1 # will evolve into Midnight
       [COLOR="Red"]elsif PBDayNight.isDusk?
         if pokemon.hasAbility?(:OWNTEMPO)
           next 2 # will evolve into Dusk
         else
           next 0
         end[/COLOR]
       else
         next 0 # will evolve into Midday
       end
    }
    })
    Officially only a Rockruff with the Own Tempo ability can evolve to the Dusk Form Lycanroc between 5pm and 6pm. If you want all Rockruff to evolve to Dusk Form Lycanroc at that time, change the Own Tempo if statement (from if to end) to next 2.
     
    Last edited:
    2
    Posts
    5
    Years
    • Seen Jun 26, 2022
    And how can I do that the starter (Rockruff) can't evolve into the midday or midnight form and evolve to dusk form in a moment of the history, with an event?
     
    188
    Posts
    9
    Years
    • Seen Jan 21, 2024
    For a starter Rockruff to always evolve into Dusk Lycanroc you can give it a new form that won't change depending on time. Lycanroc's form 3 will be a Dusk Form. The code for that is simply:
    Code:
    MultipleForms.register(:ROCKRUFF,{
    "getForm"=>proc{|pokemon|
       [COLOR="Red"]next 3 if pokemon.form==3[/COLOR]
       if PBDayNight.isNight? || PBDayNight.isEvening?
         next 1 # will evolve into Midnight
       elsif PBDayNight.isDusk?
         next 2 # will evolve into Dusk
       else
         next 0 # will evolve into Midday
       end
    }
    })
    Make sure the starter's form is set to 3 when you program the event that gives it to you.
     
    Back
    Top