Advertiser Content

Release Pokémon Essentials, version 14 - 28th September 2014 Page 2

Started by Maruno September 28th, 2014 7:13 AM
  • 9349 views
  • 46 replies

Florio

Pokemon Crimson Skies Owner

Male
Canada
Seen June 12th, 2018
Posted January 6th, 2018
392 posts
11 Years
This bug is caused by changes to def pbGetPlayerCharset which I thought were necessary (I was under the impression that FileTest.image_exist? didn't work when the game was encrypted or something, that there was some reason it needed to use pbResolveBitmap instead). Preliminary testing shows that's not the case, at least here. Turns out pbResolveBitmap is significantly slow.

Replace this def with the following:

def pbGetPlayerCharset(meta,charset,trainer=nil)
  trainer=$Trainer if !trainer
  outfit=trainer ? trainer.outfit : 0
  ret=meta[charset]
  ret=meta[1] if !ret || ret==""
  if FileTest.image_exist?("Graphics/Characters/"+ret+"_"+outfit.to_s)
    ret=ret+"_"+outfit.to_s
  end
  return ret
end
Which section is this script in? I'm not sure where it is, I checked Main and Settings and it wasn't there.

Radical Raptr

#BAMFPokemonNerd

Age 25
Male
everywhere
Seen September 28th, 2019
Posted January 10th, 2016
1,118 posts
8.7 Years
Which section is this script in? I'm not sure where it is, I checked Main and Settings and it wasn't there.
Think about it, did you ctrl+shift+F "pbGetPlayerCharset"?
and then find the def?

Florio

Pokemon Crimson Skies Owner

Male
Canada
Seen June 12th, 2018
Posted January 6th, 2018
392 posts
11 Years
Think about it, did you ctrl+shift+F "pbGetPlayerCharset"?
and then find the def?
Yeah I did in Main and Settings. I was hoping someone could just tell me where it was so I wouldn't have to go through the effort of checking all of them.

EDIT: Nvm, found it myself in PokemonField. I replaced the script, and encrypted the game with the new script. The lag issue is completely fixed.

~JV~

Dev of Pokémon Uranium

Age 25
Rio de Janeiro
Seen January 14th, 2017
Posted July 15th, 2016
710 posts
12.2 Years
Yeah I did in Main and Settings. I was hoping someone could just tell me where it was so I wouldn't have to go through the effort of checking all of them.

EDIT: Nvm, found it myself in PokemonField. I replaced the script, and encrypted the game with the new script. The lag issue is completely fixed.
If you do ctrl+shift+F it will search though all scripts in your game, unlike simply ctrl+F that only searches the script you are editing.

FL

Pokémon Island Creator

Male
Seen 4 Days Ago
Posted 1 Week Ago
1,812 posts
9.2 Years
This bug is caused by changes to def pbGetPlayerCharset which I thought were necessary (I was under the impression that FileTest.image_exist? didn't work when the game was encrypted or something, that there was some reason it needed to use pbResolveBitmap instead). Preliminary testing shows that's not the case, at least here. Turns out pbResolveBitmap is significantly slow.

Replace this def with the following:

def pbGetPlayerCharset(meta,charset,trainer=nil)
  trainer=$Trainer if !trainer
  outfit=trainer ? trainer.outfit : 0
  ret=meta[charset]
  ret=meta[1] if !ret || ret==""
  if FileTest.image_exist?("Graphics/Characters/"+ret+"_"+outfit.to_s)
    ret=ret+"_"+outfit.to_s
  end
  return ret
end
I'd love to know why I thought that pbResolveBitmap was required. I'm sure I heard it somewhere. Can someone with knowledge let me know there's any difference between FileTest.image_exist? and pbResolveBitmap (generally, not just here)?
The new most asked question for v14 era. I suggest you a v14.1 release.

I'm curious why you did this.
For people who haven't RPG Maker XP can look the code of this awesome system. The code is very easy to browse at a code repository like GitHub. Anyway, this took me only five minutes.
Male
Omnipresence
Seen 1 Week Ago
Posted May 7th, 2019
1,220 posts
5.7 Years
This bug is caused by changes to def pbGetPlayerCharset which I thought were necessary (I was under the impression that FileTest.image_exist? didn't work when the game was encrypted or something, that there was some reason it needed to use pbResolveBitmap instead). Preliminary testing shows that's not the case, at least here. Turns out pbResolveBitmap is significantly slow.

Replace this def with the following:

def pbGetPlayerCharset(meta,charset,trainer=nil)
  trainer=$Trainer if !trainer
  outfit=trainer ? trainer.outfit : 0
  ret=meta[charset]
  ret=meta[1] if !ret || ret==""
  if FileTest.image_exist?("Graphics/Characters/"+ret+"_"+outfit.to_s)
    ret=ret+"_"+outfit.to_s
  end
  return ret
end
I'd love to know why I thought that pbResolveBitmap was required. I'm sure I heard it somewhere. Can someone with knowledge let me know there's any difference between FileTest.image_exist? and pbResolveBitmap (generally, not just here)?
I'm not sure why you thought that was required, they both wind up using the same method, RTP.eachPathFor, so they both have equal capabilities as to encrypted files or not. There's no comments around FileTest.image_exists? that indicates that, whereas there are for pbResolveBitmap, so you might have falsely assumed?

As to why it's slower, I think (I may be wrong) that the biggest reason is the order in which it tests the files. You can see image_exists? uses these extensions in order
['.bmp', '.png', '.jpg', '.jpeg', '.gif']
and pbResolveBitmap tests in this order

The filename itself (redundantly, I might add, as the method it's using already does this), gif, gif again(starting here it removes any file extensions used in your call and adds its own to test them), jpg,jpeg,bmp, and finally png.

Pngs are obviously the most commonly used extension in the game, so testing for them last is quite silly and I would think slow up the process by a decent amount.

RTP.getImagePath(filename) will get the exact same results and much faster. Its only disadvantage, that I see, is it won't remove the extension name in it's search. Though that actually makes it easier to type.

Maruno

Lead Dev of Pokémon Essentials

England
Seen 20 Hours Ago
Posted 22 Hours Ago
5,193 posts
11.8 Years
If you don't want to show us a screenshot of this, along with a screenshot of the event command which is saying the text, then that's your business. Just know that it won't be our business either if you're not going to show us these things.
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


IceGod64

In the Lost & Found bin!

Age 31
Male
Castelia City
Seen 1 Week Ago
Posted 1 Week Ago
625 posts
11.1 Years
It's still there for me too, you might want to try again if you haven't already.

Also, great build Maruno, there are some long-needed fixes in the build, and so far in my testing it, everything is great!

Thought the following isn't really a bug, so I'll say my suggestion here: When throwing a Pokéball, the actual ball falling seems to be a little slow.

BadSamaritan

Gone Fishin'

Male
Seen 5 Days Ago
Posted February 24th, 2019
147 posts
10.5 Years
Thought the following isn't really a bug, so I'll say my suggestion here: When throwing a Pokéball, the actual ball falling seems to be a little slow.
Assuming it hasn't been changed since the previous release, I just edited a new one for the game I work on. Here's the code if you want it-

# Shows the player's Poké Ball being thrown to capture a Pokémon.
def pokeballThrow(ball,shakes,targetBattler,scene,battler,burst=-1)
  balltype=@battle.pbGetBallType(ball)
  oldvisible=@sprites["shadow#{targetBattler}"].visible
  @sprites["shadow#{targetBattler}"].visible=false
  ball=sprintf("Graphics/Pictures/ball%02d",balltype)
  ballopen=sprintf("Graphics/Pictures/ball%02d_open",balltype)
  # sprites
  spritePoke=@sprites["pokemon#{targetBattler}"]
  spriteBall=IconSprite.new(0,0,@viewport)
  spriteBall.visible=false
  # pictures
  pictureBall=PictureEx.new(spritePoke.z+1)
  picturePoke=PictureEx.new(spritePoke.z)
  dims=[spritePoke.x,spritePoke.y]
  center=getSpriteCenter(@sprites["pokemon#{targetBattler}"])
  if @battle.doublebattle
    ballendy=PokeBattle_SceneConstants::FOEBATTLERD1_Y-4 if targetBattler==1
    ballendy=PokeBattle_SceneConstants::FOEBATTLERD2_Y-4 if targetBattler==3
  else
    ballendy=PokeBattle_SceneConstants::FOEBATTLER_Y-4
  end
  # starting positions
  pictureBall.moveVisible(1,true)
  pictureBall.moveName(1,ball)
  pictureBall.moveOrigin(1,PictureOrigin::Center)
  pictureBall.moveXY(0,1,10,180)
  picturePoke.moveVisible(1,true)
  picturePoke.moveOrigin(1,PictureOrigin::Center)
  picturePoke.moveXY(0,1,center[0],center[1])
  # directives
  picturePoke.moveSE(1,"Audio/SE/throw")
  pictureBall.moveCurve(30,1,150,70,30+Graphics.width/2,10,center[0],ballendy-((ballendy-center[1])*1/3))
  pictureBall.moveAngle(30,1,-1080)
  pictureBall.moveAngle(0,pictureBall.totalDuration,0)
  delay=pictureBall.totalDuration+4
  picturePoke.moveTone(10,delay,Tone.new(0,-224,-224,0))
  delay=picturePoke.totalDuration
  picturePoke.moveSE(delay,"Audio/SE/recall")
  pictureBall.moveName(delay+4,ballopen)
  loop do
    pictureBall.update
    picturePoke.update
    setPictureIconSprite(spriteBall,pictureBall)
    setPictureSprite(spritePoke,picturePoke)
    pbGraphicsUpdate
    pbInputUpdate
    break if !pictureBall.running? && !picturePoke.running?
  end
  # Burst animation here
  if burst>=0
    scene.pbCommonAnimation("BallBurst#{burst}",battler,nil)
  end
  pictureBall.clearProcesses
  picturePoke.clearProcesses
  delay=0
  picturePoke.moveZoom(15,delay,0)
  picturePoke.moveXY(15,delay,center[0],ballendy-((ballendy-center[1])*1/3))
  picturePoke.moveSE(delay+10,"Audio/SE/jumptoball")
  picturePoke.moveVisible(delay+15,false)
  pictureBall.moveName(picturePoke.totalDuration+2,ball)
  delay=picturePoke.totalDuration+30
  pictureBall.moveXY(10,delay,center[0],ballendy)
  pictureBall.moveSE(pictureBall.totalDuration,"Audio/SE/balldrop")
  pictureBall.moveXY(6,pictureBall.totalDuration+2,center[0],ballendy-((ballendy-center[1])*1/6))
  pictureBall.moveXY(6,pictureBall.totalDuration+2,center[0],ballendy)
  pictureBall.moveSE(pictureBall.totalDuration,"Audio/SE/balldrop")
  pictureBall.moveXY(3,pictureBall.totalDuration+2,center[0],ballendy-((ballendy-center[1])*1/9))
  pictureBall.moveXY(3,pictureBall.totalDuration+2,center[0],ballendy)
  pictureBall.moveSE(pictureBall.totalDuration,"Audio/SE/balldrop")
  picturePoke.moveXY(0,pictureBall.totalDuration,center[0],ballendy)
  delay=pictureBall.totalDuration+18# if shakes==0
  [shakes,3].min.times do
    pictureBall.moveSE(delay,"Audio/SE/ballshake")
    pictureBall.moveXY(9,delay,center[0]-8,ballendy)
    pictureBall.moveAngle(9,delay,30) # positive means counterclockwise
    delay=pictureBall.totalDuration
    pictureBall.moveXY(9,delay,center[0]+8,ballendy)
    pictureBall.moveAngle(9,delay,-30) # negative means clockwise
    delay=pictureBall.totalDuration
    pictureBall.moveXY(9,delay,center[0],ballendy)
    pictureBall.moveAngle(9,delay,0)
    delay=pictureBall.totalDuration+29
  end
  if shakes<4
    picturePoke.moveSE(delay,"Audio/SE/recall")
    pictureBall.moveName(delay,ballopen)
    pictureBall.moveVisible(delay+10,false)
    picturePoke.moveVisible(delay,true)
    picturePoke.moveZoom(15,delay,100)
    picturePoke.moveXY(15,delay,center[0],center[1])
    picturePoke.moveTone(0,delay,Tone.new(248,248,248,248))
    picturePoke.moveTone(24,delay,Tone.new(0,0,0,0))
    delay=picturePoke.totalDuration
  end
  pictureBall.moveXY(0,delay,center[0],ballendy)
  picturePoke.moveOrigin(picturePoke.totalDuration,PictureOrigin::TopLeft)
  picturePoke.moveXY(0,picturePoke.totalDuration,dims[0],dims[1])
  loop do
    pictureBall.update
    picturePoke.update
    setPictureIconSprite(spriteBall,pictureBall)
    setPictureSprite(spritePoke,picturePoke)
    pbGraphicsUpdate
    pbInputUpdate
    break if !pictureBall.running? && !picturePoke.running?
  end
  if shakes<4
    @sprites["shadow#{targetBattler}"].visible=oldvisible
    spriteBall.dispose
  else
    spriteBall.tone=Tone.new(-64,-64,-64,128)
    pbSEPlay("balldrop",100,150)
    @sprites["capture"]=spriteBall
    spritePoke.visible=false
  end
end
(I also slowed down the ball wiggles, because I felt they were abnormally fast before)

On another note, might anyone know the specific changes to the form's page framerate fix? I have a heavily edited essentials and am not really interested in any of the new releases features(though they are nice!), but that's one thing that's been bugging me(pun intended).
Male
Seen October 20th, 2018
Posted August 6th, 2015
14 posts
5.2 Years
Woot, the first post didn't mention it (but the wiki did): the animation for walking through tall grass has been fixed! That's always been my biggest gripe, so needless to say, this is glorious. Many of the other changes will prove useful as well, and I'm sure not only to me.

So, thanks for that.~
Advertiser Content