• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

A hard thing to do maybe?

  • 23
    Posts
    17
    Years
    • Seen May 8, 2008
    I'm trying to do something here but it's not working really well I wonder if someone could give me a hand (I'll take feet too).

    I want to make it so that a pokémon will be itself during day, evolve during night and go back to himself during day. For ex: Pichu during day , Pikachu during night, back at pichu during day and so on...

    This sounds easy enough but I wanted it to be possible to change the charset of the following Pokemon (like in Pkm Yellow) and change the moves. For ex: Pichu has Thundershock and growl, then night comes, turns to Pikachu, Pikachu has Thundershock, Slam, Double Team and Quick Attack.

    Help? thnks
     
    OK. Here is the code. I will tell you of ways to edit it after.

    Code:
    #--------------------------------------#
    # Pokémon Day and Night System #
    # Lorem Ipsum ---------------------#
    # 16.2.08 ---------------------------#
    class PokeDayNight
    attr_accessor :set
    
    def initialize(set)
    @set = set
    if set = "1"
    if Time.now.hour => 7 && Time.now.hour =< 19
    [color="red"]$pokemon == "Pichu"
    print $pokemon[/color]
    else
    [color="red"]$pokemon == "Pikachu"
    print $pokemon[/color]
    end
    [color="red"]end[/color="red"]
    end
    end
    Extremely basic. Now, to edit it, you should edit the parts in red only.

    Set "1" is the Pichu -> Pikachu set. If you want more sets, simply add another instead of the red "end", with this syntax:
    Code:
    elsif set == "2"
    if Time.now.hour => 7 && Time.now.hour =< 19
    [color="red"]Pokemon Data here etc.[/color]
    else
    [color="red"]Pokemon Data here etc.[/color]
    end
    You can do that as many times as you like with the sets, but after you have finished, you MUST put an "end" command after the last "elsif" block. Remember to change the set number after elsif set ==.

    Also, the data which calls a Pokémon needs to be edited. You simply use the Pokémon system your scripts have given you. If you were using a text based thing, like I am developing, that would be all you needed.

    To call the event, all you need to do is write this in a call script command on the field.
    Code:
    PokeDayNight.new(SETNUMBERHERE)
    SETNUMBERHERE is the number that you referred to in the script, so for the Pikachu/Pichu one, it would be PokeDayNight.new(1).

    If you find any errors with the script, don't hesitate to tell me.
     
    Syntax Error Line 4...
    I wonder if I did something wrong.
     
    If you copy and pasted the code, there shouldn't have been any problems. Try this though:
    Code:
    =begin
    Pokémon Switching System
    Lorem Ipsum
    16.2.08
    =end
    class PokeDayNight
    attr_accessor :set
    
    def initialize(set)
    @set = set
    if set = "1"
    if Time.now.hour => 7 && Time.now.hour =< 19
    $pokemon == "Pichu"
    print $pokemon
    else
    $pokemon == "Pikachu"
    print $pokemon
    end
    end
    end
    end
     
    I really can't make this work. I've changed it around and moved it around and all I get are errors. Sysntax error in the Time line (from x hours to x hours) and after I have fixed that and deleted an end there was an argument error (?)
     
    Ah. I see the problem. It's probably in the call script. You wouldn't put PokeDayNight.new(set), you'd put the set number in between the brackets.

    Also, if you delete the time things, it won't work properly.

    *tests in Tourmaline*

    EDIT: Problem solved. This is the new code.

    Code:
    =begin
    Pokémon Switching System
    Lorem Ipsum
    16.2.08
    =end
    class PokeDayNight
    attr_accessor :set
    
    def initialize(set)
    @set = set
    if set = "1"
    if Time.now.hour >= 7 && Time.now.hour =< 19
    $pokemon == "Pichu"
    print $pokemon
    else
    $pokemon == "Pikachu"
    print $pokemon
    end
    end
    end
    end

    It appears that I got the operators the wrong way round.
     
    Last edited:
    if Time.now.hour >= 7 && Time.now.hour =< 19

    It keeps giving me a syntax error in this line.
    I just created a new class copied that and pasted it there. Why isn't it working?
    The call event? I never got to the main menu...
    Also I didn't delete the time things I replaced them with one that didn't give me a syntax error
    Huh...What did you change about that code?

    EDIT: Ok, so I changed that line with a working one. No error in the title screens this time but when I got to the Call Script (and I had a Pichu) there was a message stating "nil". What now?
     
    Last edited:
    It's because the script isn't designed for Essentials (You are using that, right?)
    To use it in Essentials, instead of
    Code:
    $pokemon=="Pikachu"
    print $pokemon
    you need to use
    Code:
    for i in 0..5
    if $Trainer.party[i].species==PBSpecies::PIKACHU
    $Trainer.party[i].species=PBSpecies::PICHU
    end
    end
    and instead of
    Code:
    $pokemon=="Pichu"
    print $pokemon
    use
    Code:
    for i in 0..5
    if $Trainer.party[i].species==PBSpecies::PICHU
    $Trainer.party[i].species=PBSpecies::PIKACHU
    end
    end

    EDIT: And instead of
    Code:
    if set="1"
    use
    Code:
    case @set
    when 1
     
    Sorry I forgot to say it was for Essentials.
    Now I punched in this code and everything when smoothly til I used the call script.
    There was a Runtime error. Maybe you could try to show me exactly how it's done and the exact code Wichu?
    Also, very important question: Where do you put a call script like this? I'm supposed to be walking and if day turns to night then the Pokemon should change. Should I put it in Parallel Process in every map?
     
    Back
    Top