StudioBlue
Sponsor
Okay, this is my first time asking for this kind of support, and it's to figure HOW to do something in scripting. I've been noodling with scripting for a while, mostly through Atoa's ABS, so I'm not a complete newbie here. I'm still no grand poo-bah of coding, though...
My situation is that the battle transition I want to use for my game is a series of 114 PNGs, rapidly displaying one after another, with a mere one frame wait in between. 90 of those PNGs show before switching to the @next_scene, with the other 24 showing afterwards. The problem that I am running into is that the first time I do this, the battle transition is VERY slow. Afterwards, once things are (I assume) in cache, the transition is very fast.
What I'd like to know is a way to preload everything in cache, even if it's once right before a battle, and then released right after the battle starts. Even if this causes a brief delay before the battle starts, it's better than the choppiness I have seen so far. My code is ugly, but I will post it anyway.
And for a reference, here is the video of the transition AFTER doing it once (I stage the transition for the purposes of this video to make it look smooth). The transition occurs at approximately the 41 second mark.
I have looked in this and other forums, but I don't know WHAT to look for topic-wise. If this has already been addressed and dealt with, I apologize. Just point me in the correct direction, and I will mosey on that way.
Thank you in advance. If any more information is required, I will do my best to be prompt and courteous.
EDIT: I don't know if the poster marks a post as resolved or a moderator. Apologies if I am stepping on anyone's toes here.
My situation is that the battle transition I want to use for my game is a series of 114 PNGs, rapidly displaying one after another, with a mere one frame wait in between. 90 of those PNGs show before switching to the @next_scene, with the other 24 showing afterwards. The problem that I am running into is that the first time I do this, the battle transition is VERY slow. Afterwards, once things are (I assume) in cache, the transition is very fast.
What I'd like to know is a way to preload everything in cache, even if it's once right before a battle, and then released right after the battle starts. Even if this causes a brief delay before the battle starts, it's better than the choppiness I have seen so far. My code is ugly, but I will post it anyway.
Code:
def kingdomheartstrans(frames=114)
Audio.se_play("Audio/SE/KingdomHeartsBattleStart",100)
@khbattlestart = Sprite.new
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00000")
@khbattlestart.x = 0
@khbattlestart.y = 0
@khbattlestart.z = 9999
@khbattlestart.opacity = 255
wait(1)
Graphics.update
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00001")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00002")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00003")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00004")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00005")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00006")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00007")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00008")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00009")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00010")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00011")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00012")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00013")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00014")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00015")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00016")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00017")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00018")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00019")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00020")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00021")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00022")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00023")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00024")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00025")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00026")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00027")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00028")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00029")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00030")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00031")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00032")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00033")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00034")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00035")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00036")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00037")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00038")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00039")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00040")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00041")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00042")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00043")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00044")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00045")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00046")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00047")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00048")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00049")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00050")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00051")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00052")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00053")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00054")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00055")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00056")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00057")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00058")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00059")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00060")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00061")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00062")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00063")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00064")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00065")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00066")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00067")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00068")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00069")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00070")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00071")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00072")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00073")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00074")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00075")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00076")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00077")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00078")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00079")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00080")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00081")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00082")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00083")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00084")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00085")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00086")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00087")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00088")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00089")
wait(1)
@khbattlestart.bitmap = RPG::Cache.battlestart("BattleStartTrans_00090")
Graphics.freeze
File.delete('Data/scrn_tmp')
$scene = @next_scene
Graphics.transition(20)
wait(1)
@khbattlestart.dispose
end
And for a reference, here is the video of the transition AFTER doing it once (I stage the transition for the purposes of this video to make it look smooth). The transition occurs at approximately the 41 second mark.
http://www.youtube.com/watch?v=K1dPBq0piLg
I have looked in this and other forums, but I don't know WHAT to look for topic-wise. If this has already been addressed and dealt with, I apologize. Just point me in the correct direction, and I will mosey on that way.
Thank you in advance. If any more information is required, I will do my best to be prompt and courteous.
EDIT: I don't know if the poster marks a post as resolved or a moderator. Apologies if I am stepping on anyone's toes here.