• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

In Battle: HP subtracts all damage at once, speed of exp bar + show damage amount

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
There are three things I would like to do but don't know where to make edits.

Where do I make it so that the HP bar subtracts all the damage done at once when damage is done?

Where can I make the Exp increase faster?

Is it possible to show on the Pokemon in battle the amount of damage that was done?

Thank you,
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
1,2-In PokeBattle_ActualScene change
Code:
    if @animatingHP
      if @currenthp<@endhp
        @currenthp+=1
      elsif @currenthp>@endhp
        @currenthp-=1
      end
      refresh
      @animatingHP=false if @currenthp==@endhp
    end
    if @animatingEXP
      if !@showexp
        @currentexp=@endexp
      elsif @currentexp<@endexp
        @currentexp+=1
      elsif @currentexp>@endexp
        @currentexp-=1
      end
      refresh
      if @currentexp==@endexp
        if @currentexp==PokeBattle_Scene::EXPGAUGESIZE
to
Code:
  hpspeed=4 # hp speed here, put 1000 for instantaneous
  if @animatingHP
   if @currenthp<@endhp
    if(@endhp-@currenthp<hpspeed)
     @currenthp=@endhp
    else
     @currenthp+=hpspeed
    end
   elsif @currenthp>@endhp
    if(@currenthp-@endhp<hpspeed)
     @currenthp=@endhp
    else
     @currenthp-=hpspeed
    end
   end
   refresh
   @animatingHP=false if @currenthp==@endhp
  end
  if @animatingEXP
   expspeed # exp speed here
   if !@showexp
    @currentexp=@endexp
   elsif @currentexp<@endexp
    @currentexp+=expspeed
   elsif @currentexp>@endexp
    @currentexp-=expspeed
   end
   refresh
   if @currentexp>=@endexp
    if @currentexp>=PokeBattle_Scene::EXPGAUGESIZE

3-Yes, use @currenthp minus @endhp.
 

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
Thank you very much. I got the code to work and hp bar subtracts instantly and the exp bar is nice and fast. I am just having trouble with the last one, where do I put "@currenthp minus @endhp"?

Thank you,
 
199
Posts
14
Years
  • Seen Jul 6, 2022
I have tested it.
After defeating a wild Pokemon this message appears:

---------------------------
TEST GAME
---------------------------
Exception: NameError
Message: undefined local variable or method `expspeed' for #<PokemonDataBox:0x4da7ad8>
PokeBattle_ActualScene:790:in `update'
SpriteWindow:1375:in `pbUpdateSpriteHash'
SpriteWindow:1371:in `each'
SpriteWindow:1371:in `pbUpdateSpriteHash'
SpriteWindow:1600:in `pbFadeOutAndHide'
SpriteWindow:1598:in `each'
SpriteWindow:1598:in `pbFadeOutAndHide'
SpriteWindow:1597:in `pbDeactivateWindows'
SpriteWindow:1524:in `pbActivateWindow'
SpriteWindow:1524:in `pbDeactivateWindows'

Thanks FL. Also me this script will be useful. :)
 
Last edited:

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
I have tested it.
After defeating a wild Pokemon this message appears:

---------------------------
TEST GAME
---------------------------
Exception: NameError
Message: undefined local variable or method `expspeed' for #<PokemonDataBox:0x4da7ad8>
PokeBattle_ActualScene:790:in `update'
SpriteWindow:1375:in `pbUpdateSpriteHash'
SpriteWindow:1371:in `each'
SpriteWindow:1371:in `pbUpdateSpriteHash'
SpriteWindow:1600:in `pbFadeOutAndHide'
SpriteWindow:1598:in `each'
SpriteWindow:1598:in `pbFadeOutAndHide'
SpriteWindow:1597:in `pbDeactivateWindows'
SpriteWindow:1524:in `pbActivateWindow'
SpriteWindow:1524:in `pbDeactivateWindows'

Thanks FL. Also me this script will be useful. :)
I got that too at first, you need to put a value here
"expspeed # exp speed here"

like this

expspeed=10 #exp speed here.

It should work now.

I am still unable to figure out where to put this @currenthp minus @endhp?
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
I got that too at first, you need to put a value here
"expspeed # exp speed here"

like this

expspeed=10 #exp speed here.

It should work now.

I am still unable to figure out where to put this @currenthp minus @endhp?
I can't believe that I forget the number in expspeed XD! I recommend to use 4.

I found a easier way to display the damage, in PokeBattle_Move, after line 'def pbEffectMessages(opponent)' add:
Code:
    if(opponent.damagestate.calcdamage>0) #test
      @battle.pbDisplayBrief(_INTL("{1} damage!",opponent.damagestate.calcdamage))
    end
 

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
I found a easier way to display the damage, in PokeBattle_Move, after line 'def pbEffectMessages(opponent)' add:
Code:
    if(opponent.damagestate.calcdamage>0) #test
      @battle.pbDisplayBrief(_INTL("{1} damage!",opponent.damagestate.calcdamage))
    end
Thank you. It is working but is there a way to move the damage amount to show on top of the Pokemon's sprite instead of in the message section?

Thanks,
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
Thank you. It is working but is there a way to move the damage amount to show on top of the Pokemon's sprite instead of in the message section?

Thanks,
Make the damage pop up from pokémon sprite in parallel that battle run? You need to edit several parts to do this right and start the animation and stop it in right time.
 

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
Make the damage pop up from pokémon sprite in parallel that battle run? You need to edit several parts to do this right and start the animation and stop it in right time.
Yes. So I guess its a lot of work then, could you maybe direct me to some kind of tutorial where I may be able to figure out how to do it? I tried searching for a tutorial on how to write scripts but have had no luck so far. I am looking for something like the websites that show you had to do CSS or html. All I have been able to figure out so far is basic editing like moving things and changing some text.

Thanks,
 

IceGod64

In the Lost & Found bin!
624
Posts
15
Years
1,2-In PokeBattle_ActualScene change
Code:
    if @animatingHP
      if @currenthp<@endhp
        @currenthp+=1
      elsif @currenthp>@endhp
        @currenthp-=1
      end
      refresh
      @animatingHP=false if @currenthp==@endhp
    end
    if @animatingEXP
      if !@showexp
        @currentexp=@endexp
      elsif @currentexp<@endexp
        @currentexp+=1
      elsif @currentexp>@endexp
        @currentexp-=1
      end
      refresh
      if @currentexp==@endexp
        if @currentexp==PokeBattle_Scene::EXPGAUGESIZE
to
Code:
  hpspeed=4 # hp speed here, put 1000 for instantaneous
  if @animatingHP
   if @currenthp<@endhp
    if(@endhp-@currenthp<hpspeed)
     @currenthp=@endhp
    else
     @currenthp+=hpspeed
    end
   elsif @currenthp>@endhp
    if(@currenthp-@endhp<hpspeed)
     @currenthp=@endhp
    else
     @currenthp-=hpspeed
    end
   end
   refresh
   @animatingHP=false if @currenthp==@endhp
  end
  if @animatingEXP
   expspeed # exp speed here
   if !@showexp
    @currentexp=@endexp
   elsif @currentexp<@endexp
    @currentexp+=expspeed
   elsif @currentexp>@endexp
    @currentexp-=expspeed
   end
   refresh
   if @currentexp>=@endexp
    if @currentexp>=PokeBattle_Scene::EXPGAUGESIZE
3-Yes, use @currenthp minus @endhp.

Um.... What?

Would'nt it be more efficient to just change
Code:
if @animatingHP
      if @currenthp<@endhp
        @currenthp+=1
      elsif @currenthp>@endhp
        @currenthp-=1
      end
      refresh
      @animatingHP=false if @currenthp==@endhp
    end

to

Code:
if @animatingHP
      @currenthp = @endhp
      @animatingHP=false
    end
 

FL

Pokémon Island Creator
2,434
Posts
13
Years
  • Seen today
Yes. So I guess its a lot of work then, could you maybe direct me to some kind of tutorial where I may be able to figure out how to do it? I tried searching for a tutorial on how to write scripts but have had no luck so far. I am looking for something like the websites that show you had to do CSS or html. All I have been able to figure out so far is basic editing like moving things and changing some text.

Thanks,
You probably need to create a variable to put the damage number and put a update method in 'def pbGraphicsUpdate', something like:
Code:
if @damagenumber!=0
  do animation
  @damagenumber=0 if animation ended
end

I made a guide that show how simple scenes works in essentials http://www.pokecommunity.com/showthread.php?t=286554. I can't link here to others forums, so I can't post links to RGSS tutorials. Try to find on google. Note that to you make this damage pop up effect you needs a certain experience with programming.

Um.... What?

Would'nt it be more efficient to just change
Code:
if @animatingHP
      if @currenthp<@endhp
        @currenthp+=1
      elsif @currenthp>@endhp
        @currenthp-=1
      end
      refresh
      @animatingHP=false if @currenthp==@endhp
    end

to

Code:
if @animatingHP
      @currenthp = @endhp
      @animatingHP=false
    end
For question 1: Yes! I only pasted a code that I made to my game a long time ago to HP bar speeds up.
 

thedudemister

Pokemon: New Order
84
Posts
15
Years
  • Seen Jan 14, 2013
You probably need to create a variable to put the damage number and put a update method in 'def pbGraphicsUpdate', something like:
Code:
if @damagenumber!=0
  do animation
  @damagenumber=0 if animation ended
end
I made a guide that show how simple scenes works in essentials http://www.pokecommunity.com/showthread.php?t=286554. I can't link here to others forums, so I can't post links to RGSS tutorials. Try to find on google. Note that to you make this damage pop up effect you needs a certain experience with programming.

For question 1: Yes! I only pasted a code that I made to my game a long time ago to HP bar speeds up.
Well maybe in the future I will do it. As of now I have no idea where I would start or what to do. I did a Google search for the tutorial found some right away. I wasn't sure what the coding was called so that why I could not find any before.

I am curious would it be more simple to have the damage show on the HP bar? For example: The bar would shake and show the damage that was done.

Thanks,
 
Back
Top