41
Research & Development / Re: Something on my free time
« Last post by 黒い灯影 on December 07, 2024, 08:02:41 pm »i think when you miss levels, it sets you to the next tier, because the battle script just check how many battles you'd had, and if it reaches one of the numbers on the chart, it sets it to that level.
it specifically writes the level number when it reaches a certain threshold. with "WRITE_TO_MEM"
yeah, chapter 2 saves Elan's level elsewhere, Register 100, and then in Chapter 3, it moves it back from Register 100 to 53.
I can see you can screw yourself if you manage to rack up over 580 battles in ch 2 or ch 4, it will not trigger any of the WRITE_TO_MEM opcodes.
Code: (BattleCount check) [Select]
@JUMP014
0x01A9: 0x0D_OP RESET_EACH_ANM_PROPERTY()
0x01AA: 0x04_OP UNLOAD_ANM(0)
0x01AC: 0x04_OP UNLOAD_ANM(1)
0x01AE: 0x04_OP UNLOAD_ANM(2)
0x01B0: 0x04_OP UNLOAD_ANM(3)
0x01B2: 0x04_OP UNLOAD_ANM(4)
0x01B4: 0x04_OP UNLOAD_ANM(5)
0x01B6: 0x04_OP UNLOAD_ANM(6)
0x01B8: 0x04_OP UNLOAD_ANM(7)
0x01BA: 0x1F_OP STOP_PCM_ON_NEXT_REFRESH()
0x01BB: 0x32_OP READ_REGISTER(50)
0x01BD: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(1,@JUMP022)
0x01C2: 0x35_OP INC_REGISTER(48) <--- Increase Battle count
0x01C4: 0x32_OP READ_REGISTER(48) <--- Then read battle count
0x01C6: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(20,@JUMP015) <-- jump, if not equals 20
0x01CB: 0x25_OP GO_SUB_JUMP(@JUMP567) <-- only goes here if battle count==20
0x01CE: 0x34_OP WRITE_TO_MEM(53,3) <--- write 3 to level register
0x01D2: 0x14_OP JUMP_TO(@JUMP022)
@JUMP015
0x01D5: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(40,@JUMP016)
0x01DA: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x01DD: 0x34_OP WRITE_TO_MEM(53,4)
0x01E1: 0x14_OP JUMP_TO(@JUMP022)
@JUMP016
0x01E4: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(80,@JUMP017)
0x01E9: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x01EC: 0x34_OP WRITE_TO_MEM(53,5)
0x01F0: 0x14_OP JUMP_TO(@JUMP022)
@JUMP017
0x01F3: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(140,@JUMP018)
0x01F8: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x01FB: 0x34_OP WRITE_TO_MEM(53,6)
0x01FF: 0x14_OP JUMP_TO(@JUMP022)
@JUMP018
0x0202: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(220,@JUMP019)
0x0207: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x020A: 0x34_OP WRITE_TO_MEM(53,7)
0x020E: 0x14_OP JUMP_TO(@JUMP022)
@JUMP019
0x0211: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(320,@JUMP020)
0x0216: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x0219: 0x34_OP WRITE_TO_MEM(53,8)
0x021D: 0x14_OP JUMP_TO(@JUMP022)
@JUMP020
0x0220: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(440,@JUMP021)
0x0225: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x0228: 0x34_OP WRITE_TO_MEM(53,9)
0x022C: 0x14_OP JUMP_TO(@JUMP022)
@JUMP021
0x022F: 0x33_OP JUMP_IF_LAST_READ_NOT_EQUAL(580,@JUMP022)
0x0234: 0x25_OP GO_SUB_JUMP(@JUMP567)
0x0237: 0x34_OP WRITE_TO_MEM(53,10)
Code: (Level up animation) [Select]
@JUMP567
0x53D1: 0x03_OP LOAD_ANM(0,"ANM\LVUP")
0x53DC: 0x07_OP LOAD_PALETTE_FROM_ANM(0)
0x53DE: 0x0A_OP SET_BUFFER_PROPERTIES(0,0,0,0,128,0,0,[{1:1}])
0x53EB: 0x0C_OP UPDATE_BUFFER_PROPERTY_0C(0)
0x53ED: 0x1D_OP PLAY_PCM(0,"PCMSE\RSR202")
0x53FC: 0x05_OP FADE_IN_VIEWPORT_GRAYSCALE(255,12)
0x5400: 0x13_OP SLEEP_MILLISECONDS(200)
0x5403: 0x06_OP FADE_OUT_VIEWPORT_GRAYSCALE(255,12)
0x5407: 0x1F_OP STOP_PCM_ON_NEXT_REFRESH()
0x5408: 0x26_OP RETURN()
it specifically writes the level number when it reaches a certain threshold. with "WRITE_TO_MEM"
yeah, chapter 2 saves Elan's level elsewhere, Register 100, and then in Chapter 3, it moves it back from Register 100 to 53.
I can see you can screw yourself if you manage to rack up over 580 battles in ch 2 or ch 4, it will not trigger any of the WRITE_TO_MEM opcodes.