• 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 to create a new status effect (Bleeding)

59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
Hi, i want to create a new status effect, Bleeding. I thought it would be cool because is a status that makes sense for a lot of attacks of many types to be able to get. And would be cool for lots of new attacks like "Thorn whip" a physical grass move that has Bleeding as a possible effect.
The idea is that the status will work VERY similar to burn, you lost hp at the end of every turn but the difference is that it cuts down the defense stats. Also, this status can not affect ghost types (i don't think they can bleed right?)
I looked at the script of the burn status but i suck at scripting really. If someone is interested and likes the idea i would love to see how to put it in the game with its own status graphics and all.
 
Last edited:
20
Posts
11
Years
  • Seen Sep 11, 2022
This is actually something I've just started playing around with. I'm stuck on my current status effect so I'll give you a hand with yours. What you want is really straight forward so it shouldn't be any trouble.

First thing you wanna do is go into PBStatuses. This tells the game there is a condition. Just add the bleed stuff thats in red(don't miss the comma after the second frozen):
Spoiler:


Next, we go to PokeBattle_BattlerEffects. Here we want to find: Generalised status displays. This is just general stuff the game will say. Add what's in red.
Spoiler:


Next, you wanna go to bottom and paste this. This going to tell the game who can get bleed.
Spoiler:


Next we are going drop the defense of wounded pokemon. Go to PokeBattle_Move and right under this:
Spoiler:


Put this:
Spoiler:


Our next step is in PokeBattle_Battle. We are telling Shedskin, Hydration, and Healer that they can heal this condition. If you don't want it to do that then don't add the things in red.
Spoiler:


Just a little further down is this piece of code
Spoiler:


Right underneath put this:
Spoiler:


Final bit of code here. This goes at the bottom of PokeBattle_MoveEffects. Make sure to change the XXX to an unused function code.
Spoiler:


Now just add this to the bottom of your Moves.pbs. Change YYY to an unused Id. And change XXX to whatever the you changed the XXX from above to.
Spoiler:


And for the cherry on top. The graphics. Put statuses into the folder Graphics/Pictures. Put icon_statues into Graphics/Pictures/Battle

That should be everything. Let me know if something didn't work. (It's 100% likely as I am still a newb)
 

Attachments

  • statuses.PNG
    statuses.PNG
    766 bytes · Views: 28
  • icon_statuses.png
    icon_statuses.png
    590 bytes · Views: 208
59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
😀 You made my day. I can't test it yet but i will let you know how it turned out later.
But just for the effort and your help thank you very much😭
 
59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
This is actually something I've just started playing around with. I'm stuck on my current status effect so I'll give you a hand with yours. What you want is really straight forward so it shouldn't be any trouble.

First thing you wanna do is go into PBStatuses. This tells the game there is a condition. Just add the bleed stuff thats in red(don't miss the comma after the second frozen):
Spoiler:


Next, we go to PokeBattle_BattlerEffects. Here we want to find: Generalised status displays. This is just general stuff the game will say. Add what's in red.
Spoiler:


Next, you wanna go to bottom and paste this. This going to tell the game who can get bleed.
Spoiler:


Next we are going drop the defense of wounded pokemon. Go to PokeBattle_Move and right under this:
Spoiler:


Put this:
Spoiler:


Our next step is in PokeBattle_Battle. We are telling Shedskin, Hydration, and Healer that they can heal this condition. If you don't want it to do that then don't add the things in red.
Spoiler:


Just a little further down is this piece of code
Spoiler:


Right underneath put this:
Spoiler:


Final bit of code here. This goes at the bottom of PokeBattle_MoveEffects. Make sure to change the XXX to an unused function code.
Spoiler:


Now just add this to the bottom of your Moves.pbs. Change YYY to an unused Id. And change XXX to whatever the you changed the XXX from above to.
Spoiler:


And for the cherry on top. The graphics. Put statuses into the folder Graphics/Pictures. Put icon_statues into Graphics/Pictures/Battle

That should be everything. Let me know if something didn't work. (It's 100% likely as I am still a newb)


Tested already. There are some problems.
1) If i edit PokeBattle_Battle y get a syntax error at the last line the las "end" line. If i simply erase that line i get a Name error at line 3438 "undefined local variable or method "priority" for pokemon_battle:Class. I left the Pokebattle_Battle by default to see if i can se the effect at least in the game. And it does, at least the BLD graphic appears.
2) BLD appears when you get hit by ANY attack. Not the status ones
3) The Bleed does not lower the pokemon HP every turn, neither defense.
4) Bleed affects GHOST types.
So basically the BLD graphic appears every time you do a damage-dealing attack, but has no real effect and affects ghost too.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
Tested already. There are some problems.
1) If i edit PokeBattle_Battle y get a syntax error at the last line the las "end" line. If i simply erase that line i get a Name error at line 3438 "undefined local variable or method "priority" for pokemon_battle:Class. I left the Pokebattle_Battle by default to see if i can se the effect at least in the game. And it does, at least the BLD graphic appears.
3) The Bleed does not lower the pokemon HP every turn, neither defense.

Well these two are definitely related since the HP loss code comes from a change you're supposed to make in PokeBattle_Battle (the defense drop isn't visible, but you can see that it's applied in PokeBattle_Move). I imagine some or all of the other errors are also the result of misplaced code.
 
Last edited:
59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
Well these two are definitely related since the HP loss code comes from a change you're supposed to make in PokeBattle_Battle (the defense drop isn't visible, but you can see that it's applied in PokeBattle_Move). I imagine some or all of the other errors are also the result of misplaced code.

I've followed all the steps given. Im using essentials 17.2.
The defense drop not working it's easy to check, i do the same attack before and after the status appear and the damage is the same. So it's not working either
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
I've followed all the steps given. Im using essentials 17.2.
The defense drop not working it's easy to check, i do the same attack before and after the status appear and the damage is the same. So it's not working either

Oh, I found it (and your #2 too):
Code:
if opponent.status=PBStatuses::BLEED
defmult=(defmult/2).round
end

This code always sets the status to bleed, it should say:
Code:
if opponent.status==PBStatuses::BLEED
defmult=(defmult/2).round
end

… which means the error you were seeing is actually the opposite of what you thought—the defense was always cut in half!
 
Last edited:
59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
Oh, I found it (and your #2 too):
Code:
if opponent.status=PBStatuses::BLEED
defmult=(defmult/2).round
end

This code always sets the status to bleed, it should say:
Code:
if opponent.status==PBStatuses::BLEED
defmult=(defmult/2).round
end

… which means the error you were seeing is actually the opposite of what you thought—the defense was always cut in half!

Great, with this change the status works and i was able to edit PokeBattle_Battle.
The status appears only when it should, and GHOST type is not affected 😁.
The only thing not working (and that gives me the syntax error) is the hp loss every turn. Edit: BUT IT'S SOLVED

I edit because i've solved it 😀. The code for the hp loss has an "end" not needed.
This is the corrected code.
Spoiler:


All seems to be working well now, i must thank you very much both Szmygielski and mgriffin for your help.
Szmygielski your code was almost perfect, just a "=" and "end" that escaped you, but a great work indeed.
 
Last edited:
1,403
Posts
10
Years
  • Seen Apr 18, 2024
The only thing not working is the hp loss every turn. What could that be?
the HP loss code comes from a change you're supposed to make in PokeBattle_Battle
I guess you're gonna have to think about the syntax of the changes you're trying to make in there and check that you're actually adding the right number of ends, work out what the error about priority is coming from, etc.
 
Last edited:
20
Posts
11
Years
  • Seen Sep 11, 2022
Glad you guys fixed it! Sorry I posted poopy code. I'll be sure to test more thoroughly next time. It should be noted that you two are super excellent!
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
Glad you guys fixed it! Sorry I posted poopy code. I'll be sure to test more thoroughly next time. It should be noted that you two are super excellent!

The effort that went into your code was amazing, and the code itself was pretty damn good too! It's an inspiration to us all :)
 
Last edited:
59
Posts
6
Years
  • Age 31
  • Seen Jul 26, 2023
Glad you guys fixed it! Sorry I posted poopy code. I'll be sure to test more thoroughly next time. It should be noted that you two are super excellent!

As mgriffin said, your code was almost perfect and a great job. You helped me so quickly it's normal that a word or 2 of code can slip, it would have taken me a lot of time to "Frankenstein that code up" as i have almost no experience. Thank you.
 
Last edited:

Lewnala

Banned
3
Posts
4
Years
You'll still need to change PScreen_Party to display the graphics properly or it will say Pokemon are fainted when actually just bleeding, around line 368 is where it draws the status, change this
# Draw status
status = -1
status = 6 if @pokemon.pokerusStage==1
status = @pokemon.status-1 if @pokemon.status>0
status = 5 if @pokemon.hp<=0
to this
# Draw status
status = -1
status = 7 if @pokemon.pokerusStage==1
status = @pokemon.status-1 if @pokemon.status>0
status = 6 if @pokemon.hp<=0
 
Last edited:
Back
Top