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

[Essentials Tutorial] New Field Effects

44
Posts
6
Years
    • Seen Jul 13, 2021
    Depending on how you want to do it, most of the tutorial here will work for v18 too.
    I'm currently also porting part of it, and trying to make it as plug and play as possible.
    But its hard to add most of the battle changes in in a plug and play fashion
     
    20
    Posts
    3
    Years
    • Seen Jan 30, 2024
    Mm something like reborn, where the tile field define the effect. I see the tutorials, but the v18 change a lot of the script section and are parts that i cant find.
     
    20
    Posts
    3
    Years
    • Seen Jan 30, 2024
    It's more like the syntaxis, it's changed in v18.

    For example, i try to adapt why said in step 1:

    def pbAnimation(move,user,targets,hitNum=0)
    @scene.pbAnimation(move,user,targets,hitNum) if @showAnims
    def pbChangeBGSprite
    case $fieldeffectsbg
    when 0 # Interior Field
    @scene.sprites["battlebg"].setBitmap("Graphics/Battlebacks/battlebgIndoorA.png")
    @scene.sprites["playerbase"].setBitmap("Graphics/Battlebacks/playerbaseIndoorA.png")
    @scene.sprites["enemybase"].setBitmap("Graphics/Battlebacks/enemybaseIndoorA.png")
    when 1 # Scorched Ground
    @scene.sprites["battlebg"].setBitmap("Graphics/Battlebacks/corrosive_bg.png")
    @scene.sprites["enemybase"].setBitmap("Graphics/Battlebacks/corrosive_base1.png.png")
    @scene.sprites["playerbase"].setBitmap("Graphics/Battlebacks/corrosive_base0.png")
    #To add more just make more when's like [when 2]
    end
    end




    In step 2 it's said to add this code for extra effect:

    if !attacker.isAirborne? && isConst?(type,PBTypes,:GRASS)
    damagemult=(damagemult*0.5).round
    @battle.pbDisplay(_INTL("The ground burned the attack!",opponent.pbThis))
    end


    but !attacker.isAirborne? it's not found in any of the script list.
    So, i delete it and left it the isConst?(type,PBTypes,:GRASS):

    case $fieldeffectsbg
    when 1 # Scorched
    if isConst?(type,PBTypes,:FIRE)
    damagemult=(damagemult*1.5).round
    @battle.pbDisplay(_INTL("The ground boosted the fire power of the attack!",opponent.pbThis))
    end
    if isConst?(type,PBTypes,:GRASS)
    damagemult=(damagemult*0.5).round
    @battle.pbDisplay(_INTL("The ground burned the attack!",opponent.pbThis))
    end
    end


    But return Syntaxis error in:

    maps=[5]#the maps that use the field

    if $game_map && maps.include?($game_map.map_id)
    if @environment==PBEnvironment::Grass || @environment==PBEnvironment::TallGrass || @environment==PBEnvironment::None
    $fieldeffectsbg=1 #Scorched
    pbDisplayPaused(_INTL("The ground is super-heated!")
    end
    end


    My point is there are codes that i can't find because the syntaxis change in this version. i found the effect of electric terrain, but when i try to add it to an automatic field start the errors.
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    Try using this code.(closing brackets is important)
    Code:
    pbDisplayPaused(_INTL("The ground is super-heated!")[COLOR="Red"])[/COLOR]
    And look for this function instead.
    Code:
    def airborne?
    Some of these functions names have been changed while their functionality stayed the same.
     
    20
    Posts
    3
    Years
    • Seen Jan 30, 2024
    Try using this code.(closing brackets is important)
    Code:
    pbDisplayPaused(_INTL("The ground is super-heated!")[COLOR="Red"])[/COLOR]
    And look for this function instead.
    Code:
    def airborne?
    Some of these functions names have been changed while their functionality stayed the same.

    I found airborne, the problem now it's whit attacker

    I try to change it with:

    if @target.airborne? && isConst?(type,PBTypes,:GRASS)
    if pkmn.airborne? && isConst?(type,PBTypes,:GRASS)
    if user.airborne? && isConst?(type,PBTypes,:GRASS)

    But didn't work.

    This is how i have my script section:

    https://ibb.co/Y0QV8Kn
    https://ibb.co/wcvwwLP
    https://ibb.co/4j5KMgm
     
    Last edited:
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    I'd heaviliy advise you to read an introduction to the ruby language else you'll stumble into these small mistakes all the time. There is one pinned at the top of the scripts section.https://www.pokecommunity.com/showthread.php?t=410026
    Regarding your problem there are a few points:
    1.You creating a lonely case outside a class or even a method, in your second picture wouldn't do anything, even if it didn't raise a syntax error. The move will only do what's inside its class(PokeBattle_Move_155) and parent class(PokeBattle_Move). Secondly, you have different predefined methods you're able to use inside PokeBattle_Move classes f.ex.:
    Spoiler:

    Be sure to ask if you notice any more inconveniences.
     
    20
    Posts
    3
    Years
    • Seen Jan 30, 2024
    I'd heaviliy advise you to read an introduction to the ruby language else you'll stumble into these small mistakes all the time. There is one pinned at the top of the scripts section.https://www.pokecommunity.com/showthread.php?t=410026
    Regarding your problem there are a few points:
    1.You creating a lonely case outside a class or even a method, in your second picture wouldn't do anything, even if it didn't raise a syntax error. The move will only do what's inside its class(PokeBattle_Move_155) and parent class(PokeBattle_Move). Secondly, you have different predefined methods you're able to use inside PokeBattle_Move classes f.ex.:
    Spoiler:

    Be sure to ask if you notice any more inconveniences.

    It's getting better, or at least didn't crash.
    What i did is create a new terrain to prove (AKA corrosion field) in Move_Usage_Calculations, add a poison bonus and the grass damage reduce:

    Spoiler:


    I tried to change the background with @scene.sprites["battlebg"].setBitmap in def pbCommonAnimation(name,attacker,opponent,hitnum=0) but the code it's not the same and i can't addap it, so i remove it.

    Also i add the code to locate the map in Battle_StartAndEnd i add the Step 1 code under the "end" on the weather code (as said in the Step 1):
    Spoiler:


    At the start of the battle, the message show "the field is filled..." but when an attack of poison or grass happen, it did't show the message of the bonus.

    Also, thanxs for the ruby tutorial, i read it, it's just difficult to aplly whitout crash anything.
     
    Last edited:
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    In "Move_Usage_Calculations" you ask the code if "@battle.field.terrain" is "PBBattleTerrains::Poison" but I think you forgot to set that terrain at the beginning of the battle. Instead you just showed a message.
    Maybe add this above your message:
    Code:
    @field.terrain=PBBattleTerrains::Poison
    And also check if the terrain is even defined in PBTerrain.
     
    20
    Posts
    3
    Years
    • Seen Jan 30, 2024
    Still don't work. I add it to PBBattleTerrains
    Spoiler:
     

    HeroesFightingFear

    "The Champion of Alon"
    99
    Posts
    4
    Years
  • remove the opponent.pbthis, that will no longer work when assigning messages to terrain/field boosts and what not.
    in addition to that, the files and battle backgrounds have changed.
    example:
    indoor1_base0, indoor1_base1, indoor1_bg, indoor1_message

    to be able to change the battlefield with terrains, you would need to make graphics with all four of these file name bases

    terrain example:
    aura_terrain_base0, aura_terrain_base1, aura_terrain_bg, aura_terrain_message
     
    Last edited:
    Back
    Top