• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Tutorial Field Effects v2

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
BIGFriv submitted a new resource:

How to add Field Effects to your game - A tutorial of how to create Field Effects, like Pokémon Reborn has.

Have you ever wanted to have Field Effects in your game?
It's personaly, one of my favorite mechanics of any fangame, so I'll teach you too how to do it too.

What are Field Effects?
If you have played Gen 6 or Gen 7, then you probably know about Terrains (Electric Terrain, Psychic Terrain ...)
Field Effects, are in a way, the exact same thing, but they are present from the very start of the battle, and are map based.
Because of this, it can be used to make fights more interesting...

Read more about this resource...
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
Oh my God! One day i tried to copy like Terrains works in Reborn but i dont got it :/ Thank you!

But, well, i just want to add to change the backgrounds when pokemon use Terrains moves (Electric, Grassy, Psychic, Misty) or abilities (Surges by Alolan Guardian)
I have to do all? Im confuse, sorry.

The last part i stoped was:
Code:
Expand Collapse Copy
    if isConst?(type,PBTypes,:ELECTRIC)
      for i in 0...4
        if @battle.battlers[i].effects[PBEffects::MudSport] && !@battle.battlers[i].fainted?
          damagemult=(damagemult*0.33).round
          break
        end
      end
      if @battle.field.effects[PBEffects::MudSportField]>0
        damagemult=(damagemult*0.33).round
      end
    end
    #Field Effects Same-Type Boost
    case $fieldeffectsbg
    when 0 # Electric Terrain
      if @battle.field.effects[PBEffects::ElectricTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:ELECTRIC)
        damagemult=(damagemult*1.5).round
      end
    when 1 # Misty Terrain
      if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
         !opponent.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:DRAGON)
        damagemult=(damagemult*0.5).round
      end
    when 2 # Grassy Terrain
      if @battle.field.effects[PBEffects::GrassyTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:GRASS)
        damagemult=(damagemult*1.5).round
      end
    when 3 # Psychic Terrain
      if @battle.field.effects[PBEffects::PsychicTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:PSYCHIC)
        damagemult=(damagemult*1.5).round
      end
    end
In PokeBattle_Move (Step 2)
Thank you!!! <3
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
Oh my God! One day i tried to copy like Terrains works in Reborn but i dont got it :/ Thank you!

But, well, i just want to add to change the backgrounds when pokemon use Terrains moves (Electric, Grassy, Psychic, Misty) or abilities (Surges by Alolan Guardian)
I have to do all? Im confuse, sorry.

The last part i stoped was:
Code:
Expand Collapse Copy
    if isConst?(type,PBTypes,:ELECTRIC)
      for i in 0...4
        if @battle.battlers[i].effects[PBEffects::MudSport] && !@battle.battlers[i].fainted?
          damagemult=(damagemult*0.33).round
          break
        end
      end
      if @battle.field.effects[PBEffects::MudSportField]>0
        damagemult=(damagemult*0.33).round
      end
    end
    #Field Effects Same-Type Boost
    case $fieldeffectsbg
    when 0 # Electric Terrain
      if @battle.field.effects[PBEffects::ElectricTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:ELECTRIC)
        damagemult=(damagemult*1.5).round
      end
    when 1 # Misty Terrain
      if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
         !opponent.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:DRAGON)
        damagemult=(damagemult*0.5).round
      end
    when 2 # Grassy Terrain
      if @battle.field.effects[PBEffects::GrassyTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:GRASS)
        damagemult=(damagemult*1.5).round
      end
    when 3 # Psychic Terrain
      if @battle.field.effects[PBEffects::PsychicTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:PSYCHIC)
        damagemult=(damagemult*1.5).round
      end
    end
In PokeBattle_Move (Step 2)
Thank you!!! <3

Glad you like it.
Hmm for what you want to do you kinda of just need step 1 I believe.
It's kinda late right now. But ill try to do what you need later.
In my own game I transformed Electric Terrain into an Electric field anf that took a while (its something I was going to talk about in the next tutorial update).
But Ill try to see how to do what you want tomorrow!
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
Glad you like it.
Hmm for what you want to do you kinda of just need step 1 I believe.
It's kinda late right now. But ill try to do what you need later.
In my own game I transformed Electric Terrain into an Electric field anf that took a while (its something I was going to talk about in the next tutorial update).
But Ill try to see how to do what you want tomorrow!

Im tryin to put inside terrain codes in MoveEffects...

Anyway, i will be waiting for your instruction!
 

Kartik

Disappointment
Member
Joined
Aug 15, 2018
Posts
116
@WolfPP
Add this code while you write about ability or move
@battle.pbChangeBGSprite

Use ctrl+shift+f to find in drought or a similar ability and paste the code changing it a bit and adding the above code

Here I have created an ability SNOWCALL to imitate the field effect created by BIGFriv in the tutorial


Btw is it just me or even if you don't have the field active the effects take place
 
Last edited:

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
@WolfPP
Add this code while you write about ability or move
@battle.pbChangeBGSprite

Use ctrl+shift+f to find in drought or a similar ability and paste the code changing it a bit and adding the above code

Here I have created an ability SNOWCALL to imitate the field effect created by BIGFriv in the tutorial


Btw is it just me or even if you don't have the field active the effects take place

Sorry but i see nothing in your Screenshot.
 

chikorita

Novice
Member
Joined
Apr 2, 2017
Posts
33
^You can just click on the black part where the image was supposed to be.
 

chikorita

Novice
Member
Joined
Apr 2, 2017
Posts
33
ewLoXJL.png
 

Amethyst

Rookie
Member
Joined
Mar 24, 2017
Posts
8
hey, thanks for doing this! there's a lot of moving parts to field effects depending on what other custom effects one wants to add and such, so i've never made a proper tutorial, but this is a really nice start.

could you add "Blind Guardian" to the credits list though please? he was the one who first made a way to change the background on the fly, and played a big role in getting this system off the ground.
cheers!
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
hey, thanks for doing this! there's a lot of moving parts to field effects depending on what other custom effects one wants to add and such, so i've never made a proper tutorial, but this is a really nice start.

could you add "Blind Guardian" to the credits list though please? he was the one who first made a way to change the background on the fly, and played a big role in getting this system off the ground.
cheers!

Omg, yeah. I can add him to the list of Credits!

Thank you!
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
Oh my God! One day i tried to copy like Terrains works in Reborn but i dont got it :/ Thank you!

But, well, i just want to add to change the backgrounds when pokemon use Terrains moves (Electric, Grassy, Psychic, Misty) or abilities (Surges by Alolan Guardian)
I have to do all? Im confuse, sorry.

The last part i stoped was:
Code:
Expand Collapse Copy
    if isConst?(type,PBTypes,:ELECTRIC)
      for i in 0...4
        if @battle.battlers[i].effects[PBEffects::MudSport] && !@battle.battlers[i].fainted?
          damagemult=(damagemult*0.33).round
          break
        end
      end
      if @battle.field.effects[PBEffects::MudSportField]>0
        damagemult=(damagemult*0.33).round
      end
    end
    #Field Effects Same-Type Boost
    case $fieldeffectsbg
    when 0 # Electric Terrain
      if @battle.field.effects[PBEffects::ElectricTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:ELECTRIC)
        damagemult=(damagemult*1.5).round
      end
    when 1 # Misty Terrain
      if @battle.field.effects[PBEffects::MistyTerrain]>0 &&
         !opponent.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:DRAGON)
        damagemult=(damagemult*0.5).round
      end
    when 2 # Grassy Terrain
      if @battle.field.effects[PBEffects::GrassyTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:GRASS)
        damagemult=(damagemult*1.5).round
      end
    when 3 # Psychic Terrain
      if @battle.field.effects[PBEffects::PsychicTerrain]>0 &&
         !attacker.isAirborne?(attacker.hasMoldBreaker) && isConst?(type,PBTypes,:PSYCHIC)
        damagemult=(damagemult*1.5).round
      end
    end
In PokeBattle_Move (Step 2)
Thank you!!! <3

I know this is like a whole year later, but I added those to the script if you're still interested.
Check the last section.
 

WolfPP

Discord wolfppontes
Member
Joined
Aug 24, 2018
Posts
136
I know this is like a whole year later, but I added those to the script if you're still interested.
Check the last section.

I made them already time ago but thanks for the quoted anyway! :)
 

Luxinaj

Rookie
Member
Joined
Oct 14, 2020
Posts
1
I'm trying to addap it to v18, but there are sintaxis and codes i can't find or can't figure which is the new code.

For example, i can't find the part of the code containing def pbBackDrop.

There is a method to addap it or know if there is an adaptation already?
 

Mashirosakura

With my wishes frozen in time and long forgotten
Discord Mod
I'm trying to addap it to v18, but there are sintaxis and codes i can't find or can't figure which is the new code.

For example, i can't find the part of the code containing def pbBackDrop.

There is a method to addap it or know if there is an adaptation already?
I've been talking with Friv recently and he's been adapting it for v18. Said he should be able to make it plug and play soon too.
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
I'm trying to addap it to v18, but there are sintaxis and codes i can't find or can't figure which is the new code.

For example, i can't find the part of the code containing def pbBackDrop.

There is a method to addap it or know if there is an adaptation already?
Like Mashi said above, I am currently working on updating it to v18, and also making it as plug and play as possible.
So far most things are working fairly well!
But dont expect it anytime super soon.
My job is taking too much of my time nowadays
 

SamuelJ

Rookie
Member
Joined
Oct 22, 2020
Posts
4
Hi BIGFriv! I am new to Relic and also to scripting, so my knowledge is minimum. I was looking forward this script for my game and I really thank you and everyone who did collab to create it.
I, of course, am running V18.1 and installed it today. Without editing, I pasted the script and ran the game, just to check for an error before I started to edit it. I entered a wild battle battle and after the BGM for the battle played, and the animation ran, I got an error, straightforward.

The scripts were installed in the order you suggested: First graphics then battle, both above main.

If you know anything or I skipped something important I will be very grateful!
 

Attachments

  • TerrainError.png
    TerrainError.png
    102.3 KB · Views: 536
Back
Top