• 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] Help with custom weather and stone evolution

IvyMe

My Twitter: @_IvyMe
11
Posts
6
Years
  • Hi, I'm new in this forum, and it's full of scripts and resources, is really great.

    But I'm going with my problem:
    I put an alolan form for exeggutor, and I made an alternate evolution form in PokemonEvolution script to get it.
    I want when I use Leaf stone in sun, evolve to alolan form. And evolve to normal exeggutor if not sun weather.

    Here is my code
    Code:
      when PBEvolution::ItemSun
        if $game_screen && ($game_screen.weather==7)
            pokemon.form=1
        end
       return poke if level==item
    But i get this error:
    Code:
    Excepción: ArgumentError
    Mensaje: wrong number of arguments(0 for 3)
    Pokemon_Evolution:980:in `weather'
    Pokemon_Evolution:980:in `pbMiniCheckEvolutionItem'
    Pokemon_Evolution:1020:in `pbCheckEvolution'
    Pokemon_Evolution:1019:in `pbCheckEvolutionEx'
    Pokemon_Evolution:1004:in `each'
    Pokemon_Evolution:1004:in `pbCheckEvolutionEx'
    Pokemon_Evolution:1019:in `pbCheckEvolution'
    PItem_Items:662:in `pbUseItem'
    PItem_Items:661:in `each'
    PItem_Items:661:in `pbUseItem'

    I don't know what cause the error, I need help.
     
    Last edited by a moderator:

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Hey,

    I think the conditions in your code are not quite correct. I checked existing methods and I believe the code should look something like this

    Code:
     when PBEvolution::ItemSun
        if level==item && $game_screen.weather==PBFieldWeather::Sun
    	return poke
    	poke.form=1
         elsif level==item
    	return poke
    	end

    This way the script first checks wether it's the correct item and the sun is shining. If so it evolvs the pokemon and sets it's form to 1. If these conditions don't apply it checks if it's the correct item and if so returns the evolution.

    This code should be added to
    def pbMiniCheckEvolutionItem(pokemon,evonib,level,poke,item)
    (around line 950)

    Add it between
    when PBEvolution::ItemFemale
    return poke if level==item && pokemon.isFemale?
    and

    Let me know if it worked or if you still get error messages.
     

    IvyMe

    My Twitter: @_IvyMe
    11
    Posts
    6
    Years
  • Hey,

    I think the conditions in your code are not quite correct. I checked existing methods and I believe the code should look something like this

    Code:
     when PBEvolution::ItemSun
        if level==item && $game_screen.weather==PBFieldWeather::Sun
    	return poke
    	poke.form=1
         elsif level==item
    	return poke
    	end

    This way the script first checks wether it's the correct item and the sun is shining. If so it evolvs the pokemon and sets it's form to 1. If these conditions don't apply it checks if it's the correct item and if so returns the evolution.

    This code should be added to

    (around line 950)

    Add it between

    and


    Let me know if it worked or if you still get error messages.

    Thanks for the code, but I tried it and it shows me the same error.

    Code:
    Excepción: ArgumentError
    Mensaje: wrong number of arguments(0 for 3)
    Pokemon_Evolution:983:in `weather'
    Pokemon_Evolution:983:in `pbMiniCheckEvolutionItem'
    Pokemon_Evolution:1017:in `pbCheckEvolution'
    Pokemon_Evolution:1016:in `pbCheckEvolutionEx'
    Pokemon_Evolution:1001:in `each'
    Pokemon_Evolution:1001:in `pbCheckEvolutionEx'
    Pokemon_Evolution:1016:in `pbCheckEvolution'
    PItem_Items:662:in `pbUseItem'
    PItem_Items:661:in `each'
    PItem_Items:661:in `pbUseItem'

    I don't understand what is causing the error, i have also in Exeggcute PBS:

    Code:
    Evolutions=EXEGGUTOR,ItemSun,LEAFSTONE

    I think that all is correct.
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Hey,

    so I realized that the first code couldn't work out for different reasons.
    I assume you set up the evolution according to the essentials wiki.
    Now we need to change a few things.

    We change this
    Code:
     when PBEvolution::ItemSun
        if level==item && $game_screen.weather==PBFieldWeather::Sun
    	return poke
    	poke.form=1
         elsif level==item
    	return poke
    	end

    to

    Code:
      when PBEvolution::ItemSun
        if level==item 
          return poke


    And then search for
    Code:
      if evonib==PBEvolution::Shedinja
               next poke if $PokemonBag.pbQuantity(getConst(PBItems,:POKEBALL))>0
             elsif evonib==PBEvolution::TradeItem ||
                   evonib==PBEvolution::DayHoldItem ||
                   evonib==PBEvolution::NightHoldItem
               removeItem=true if poke==@newspecies   # Item is now consumed

    and underneath that, but before
    Code:
    end
    you add

    Code:
    elsif evonib==PBEvolution::ItemSun && $game_screen.weather_type==PBFieldWeather::Sun
               pokemon.form=1

    This will change the form after the evolution. So there's still the problem that you see the normal form during the evolution screen. I couldn't figure out how they decide which sprite to take, therefore I couldn't make any changes to it.

    This Wiki Thread helped figure out the form change.
     

    IvyMe

    My Twitter: @_IvyMe
    11
    Posts
    6
    Years
  • Hey,

    so I realized that the first code couldn't work out for different reasons.
    I assume you set up the evolution according to the essentials wiki.
    Now we need to change a few things.

    We change this
    Code:
     when PBEvolution::ItemSun
        if level==item && $game_screen.weather==PBFieldWeather::Sun
    	return poke
    	poke.form=1
         elsif level==item
    	return poke
    	end

    to

    Code:
      when PBEvolution::ItemSun
        if level==item 
          return poke


    And then search for
    Code:
      if evonib==PBEvolution::Shedinja
               next poke if $PokemonBag.pbQuantity(getConst(PBItems,:POKEBALL))>0
             elsif evonib==PBEvolution::TradeItem ||
                   evonib==PBEvolution::DayHoldItem ||
                   evonib==PBEvolution::NightHoldItem
               removeItem=true if poke==@newspecies   # Item is now consumed

    and underneath that, but before
    Code:
    end
    you add

    Code:
    elsif evonib==PBEvolution::ItemSun && $game_screen.weather_type==PBFieldWeather::Sun
               pokemon.form=1

    This will change the form after the evolution. So there's still the problem that you see the normal form during the evolution screen. I couldn't figure out how they decide which sprite to take, therefore I couldn't make any changes to it.

    This Wiki Thread helped figure out the form change.

    Now evolves, but it doesn't change form when the weather is Sun:(
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Here some things to check:
    Did you check the pokemon after evolving?
    Did you set up the graphics accordingly?
    Did you set up the evolution method correct?
    Did you set the wrather to sun?
     

    IvyMe

    My Twitter: @_IvyMe
    11
    Posts
    6
    Years
  • Here some things to check:
    Did you check the pokemon after evolving?
    Did you set up the graphics accordingly?
    Did you set up the evolution method correct?
    Did you set the wrather to sun?
    Yes, graphics are set on form 1 and 0. My code is this:
    Code:
             if evonib==PBEvolution::Shedinja
               next poke if $PokemonBag.pbQuantity(getConst(PBItems,:POKEBALL))>0
             elsif evonib==PBEvolution::TradeItem ||
                   evonib==PBEvolution::DayHoldItem ||
                   evonib==PBEvolution::NightHoldItem
               removeItem=true if poke==@newspecies   # El objeto ahora es consumido
             elsif evonib==PBEvolution::ItemSun && $game_screen.weather_type==PBFieldWeather::Sun
               pokemon.form=1
             end

    This is after pbMiniCheckEvolutionItem, after the last evolution I have in that def
    Code:
    when PBEvolution::ItemSun
        if level==item 
          return poke
        end
      end

    The weather is set to sun (number 7).
    I use Leaf Stone, but it doesnt change form.
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Hey,
    sorry for all the inconvenience. Guess what? As I was trying to figure out why it wouldn't work for you I came up with a much better method, which even shows the correct sprite after evolution.
    The way we did it before was waay to complicated.

    Here's what we gonna do:

    1. remove these lines that we added earlier
    Code:
       elsif evonib==PBEvolution::ItemSun && $game_screen.weather_type==PBFieldWeather::Sun
               pokemon.form=1
    2. find your evolution method and between
    Code:
    when PBEvolution::ItemSun
        if level==item
    and
    Code:
       return poke
        end
      end
    you add
    Code:
     if isConst?(pokemon.species,PBSpecies,:EXEGGCUTE) && $game_screen.weather_type==PBFieldWeather::Sun 
           pokemon.form=1
             end

    3. Now it should look like this
    Code:
      when PBEvolution::ItemSun
        if level==item
          if isConst?(pokemon.species,PBSpecies,:EXEGGCUTE) && $game_screen.weather_type==PBFieldWeather::Sun 
           pokemon.form=1
             end  
          return poke
    	end
      end

    4.That's it! I hope it works for your game as well.
     

    IvyMe

    My Twitter: @_IvyMe
    11
    Posts
    6
    Years
  • Hey,
    sorry for all the inconvenience. Guess what? As I was trying to figure out why it wouldn't work for you I came up with a much better method, which even shows the correct sprite after evolution.
    The way we did it before was waay to complicated.

    Here's what we gonna do:

    1. remove these lines that we added earlier
    Code:
       elsif evonib==PBEvolution::ItemSun && $game_screen.weather_type==PBFieldWeather::Sun
               pokemon.form=1
    2. find your evolution method and between
    Code:
    when PBEvolution::ItemSun
        if level==item
    and
    Code:
       return poke
        end
      end
    you add
    Code:
     if isConst?(pokemon.species,PBSpecies,:EXEGGCUTE) && $game_screen.weather_type==PBFieldWeather::Sun 
           pokemon.form=1
             end

    3. Now it should look like this
    Code:
      when PBEvolution::ItemSun
        if level==item
          if isConst?(pokemon.species,PBSpecies,:EXEGGCUTE) && $game_screen.weather_type==PBFieldWeather::Sun 
           pokemon.form=1
             end  
          return poke
    	end
      end

    4.That's it! I hope it works for your game as well.

    Thanks a lot! It works now!

    I wish to learn how to code in rgss, to solve this issues myself.

    Have a good day! :pink_boogie:
     
    Back
    Top