I
Incinerator
Guest
Understandable.No, I don't plan on making any other CIL macro.
Understandable.No, I don't plan on making any other CIL macro.
{ "ID of Field": { "ID of Battle in the Field": "ID of Battle Music", ... }, ...}
Thanks, I really appreciate it.Battles have the music ID "0" (for normal encounters), "35" (for bosses) and "111" (for Hunter's Chance). Some battles are not registered in these files, when they don't stop the music played in the field (the "Don't Stop Music" battle flag is also checked for them in the "Enemy" panel).
Now I get proper random encounters in that field, but the music doesn't change to the battle theme. Instead, the normal field music keeps playing. Is there any sort of SoundCode that I have to add somewhere in the field script for that?SetRandomBattleFrequency( 60 )
SetRandomBattles( 2, 859, 849, 854, 854 )
Hi tirlititi, I've done a bit of playtesting in the last few days, but it seems the desired changes to the battle theme won't take effect. Here's what I did:No: as you can see from the format of the "BtlEncountBGMMetaData.txt", the battle musics are not linked by "1 Battle -> 1 Music" but rather by "1 Field + 1 Battle -> 1 Music". So you need to add a line for your new battle (or, more precisely, to your new use of a battle inside a field) inside this .txt file.
No sound code needs to be added in the field script.
If you add random battles to a field that doesn't have it, you need to add the function "Main_Reinit" to the script for the player to regain control after the battle.Hi tirlititi, I've done a bit of playtesting in the last few days, but it seems the desired changes to the battle theme won't take effect. Here's what I did:
I've exported the BtlEncountBGMMetaData.txt, opened it with a text editor and made the required changes, and then I imported it again using the "import selection" function in Hades Workshop. I've done this with both resource.assets files (the x64 and the x86) to be sure. However, I still don't get any music changes in my new random battles. Both resource.assets files are updated according to the fiel change date. Is there anything else I'm missing?
Also, I've encountered another problem: When adding random battles to a new field, after such a battle the field music doesn't resume and I can't move my character anymore. I've noticed that all fields that naturally have random battles also have a main_reinit function in their scripts, while fields without random battles don't. So I'm guessing I need to write a main_reinit function for the fields that I've added random encounters to, right? I'm just unsure what exactly I need to put there, as these scripts seem to differ from field to field. From what I see it's something similar to each respective field's main_init function, but before I resort to (potentially fruitless) trial and error I was hoping that you could give me some general tips as to what I can copy/paste from the main_init script.
Function Main_Reinit set VAR_GlobBool_159 = 0 RunScriptAsync( 0, 250, 13 ) if ( VAR_GlobBool_155 == 1 ) { ATE( 1 ) } ShowTile( 11, 0 ) ShowTile( 12, 0 ) if ( VAR_GlobBool_158 == 0 ) { 0x27( 127 ) } else { 0x27( 255 ) } Wait( 2 ) ShowTile( 9, 0 ) RunTileAnimation( 0, 0 ) SetTileAnimationFlags( 0, 16 ) SetTileAnimationSpeed( 0, 64 ) RunSPSCode( 10, 130, 195, 0, 0 ) RunSPSCode( 10, 145, 6000, 0, 0 ) RunSPSCode( 10, 155, 255, 0, 0 ) RunSPSCode( 10, 160, 16, 0, 0 ) RunSPSCode( 10, 170, 0, 0, 0 ) RunSPSCode( 10, 156, 1, 0, 0 ) RunSPSCode( 10, 131, 1, 0, 0 ) SetCameraFollowHeight( 500 ) if ( VARL_GenBool_2926 ) { ShowTile( 9, 1 ) } if ( VAR_GlobUInt8_24 ) { RunScriptAsync( 2, 15, 14 ) } if ( VAR_GlobUInt8_25 ) { RunScriptAsync( 2, 18, 14 ) } Wait( 2 ) if ( VAR_GenUInt8_13 == 9 ) { SetTextVariable( 2, 0 ) WindowAsync( 6, 0, 65 ) RaiseWindows( ) WaitWindow( 6 ) set VAR_GenUInt8_13 = 0 } if ( VAR_GenUInt8_14 == 9 ) { SetTextVariable( 2, 1 ) WindowAsync( 6, 0, 65 ) RaiseWindows( ) WaitWindow( 6 ) set VAR_GenUInt8_14 = 0 } set VAR_GlobBool_159 = 1 if ( VAR_GlobBool_158 == 1 ) { set VAR_GlobBool_158 = 1 if ( VAR_GlobBool_159 == 1 ) { if ( VAR_GlobBool_156 == 0 ) { EnableMove( ) 0x27( 255 ) if ( VAR_GlobBool_144 == 0 ) { EnableMenu( ) } } } } if ( VAR_GlobUInt8_17 == 255 ) { set Op66(( GetData_12 - 160 ), ( GetData_13 - 112 )) } 0xA9( 250 ) FadeFilter( 7, 16, VAR_GlobUInt8_17, 0, 0, 0 ) return
if ( VARL_GenBool_7962 == 0 ) { DisableMove( ) DisableMenu( ) RunSoundCode( 265, 0 ) Wait( 10 ) 0xA9( 250 ) FadeFilter( 4, 24, VAR_GlobUInt8_17, 255, 255, 255 ) Wait( 25 ) RunSoundCode3( 53248, 3096, 0, -128, 125 ) Wait( 30 ) 0xA9( 250 ) FadeFilter( 5, 16, VAR_GlobUInt8_17, 0, 0, 0 ) Wait( 70 ) RunSoundCode( 0, 73 ) WindowSync( 1, 128, 400 ) WindowSyncEx( 22, 1, 128, 401 ) Wait( 10 ) 0xA9( 250 ) FadeFilter( 4, 24, VAR_GlobUInt8_17, 255, 255, 255 ) Wait( 25 ) RunSoundCode3( 53248, 3096, 0, -128, 125 ) Wait( 30 ) 0xA9( 250 ) FadeFilter( 5, 16, VAR_GlobUInt8_17, 0, 0, 0 ) Wait( 10 ) WindowSyncEx( 22, 1, 128, 402 ) WindowSync( 1, 128, 403 ) WindowSyncEx( 22, 1, 128, 404 ) WindowSync( 1, 128, 405 ) FadeFilter( 2, 24, 0, 64, 64, 64 ) RaiseWindows( ) WindowSync( 1, 16, 406 ) WindowSync( 1, 16, 407 ) WindowSync( 1, 16, 408 ) WindowSync( 1, 16, 409 ) set VARL_GenBool_7962 = 1 } DisableMove( ) DisableMenu( ) RunSoundCode( 0, 73 ) WindowSync( 1, 16, 410 ) switch 5 ( GetDialogChoice ) from 0 { case +0: RunSoundCode( 0, 0 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 896 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 899 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 897 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 210 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 211 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 57 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 82 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 231 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 280 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) Battle( 1, 763 ) RunSoundCode( 0, 111 ) DisableMenu( ) DisableMove( ) Wait( 20 ) 0xA9( 250 ) FadeFilter( 4, 24, VAR_GlobUInt8_17, 255, 255, 255 ) Wait( 25 ) RunSoundCode3( 53248, 3096, 0, -128, 125 ) Wait( 30 ) 0xA9( 250 ) FadeFilter( 5, 16, VAR_GlobUInt8_17, 0, 0, 0 ) Wait( 30 ) RunSoundCode( 0, 5 ) FadeFilter( 2, 24, 0, 64, 64, 64 ) RaiseWindows( ) WindowSync( 1, 16, 411 ) 0xA9( 250 ) FadeFilter( 4, 24, VAR_GlobUInt8_17, 255, 255, 255 ) Wait( 25 ) RunSoundCode3( 53248, 3096, 0, -128, 125 ) Wait( 30 ) 0xA9( 250 ) FadeFilter( 5, 16, VAR_GlobUInt8_17, 0, 0, 0 ) Wait( 30 ) FadeFilter( 2, 24, 0, 64, 64, 64 ) RaiseWindows( ) WindowSync( 1, 16, 412 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 15 ) AddItem( 15, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 25 ) AddItem( 25, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 39 ) AddItem( 39, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 49 ) AddItem( 49, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 44 ) AddItem( 44, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 56 ) AddItem( 56, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 61 ) AddItem( 61, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 63 ) AddItem( 63, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 67 ) AddItem( 67, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 78 ) AddItem( 78, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 83 ) AddItem( 83, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 84 ) AddItem( 84, 1 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 87 ) AddItem( 87, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 96 ) AddItem( 96, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 97 ) AddItem( 97, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 131 ) AddItem( 131, 6 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 147 ) AddItem( 147, 7 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 163 ) AddItem( 163, 4 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 164 ) AddItem( 164, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 167 ) AddItem( 167, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 175 ) AddItem( 175, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 176 ) AddItem( 176, 8 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 191 ) AddItem( 191, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 195 ) AddItem( 195, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 197 ) AddItem( 197, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 209 ) AddItem( 209, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 222 ) AddItem( 222, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 198 ) AddItem( 198, 8 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 225 ) AddItem( 225, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 226 ) AddItem( 226, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 227 ) AddItem( 227, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 228 ) AddItem( 228, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 229 ) AddItem( 229, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 230 ) AddItem( 230, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 231 ) AddItem( 231, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 232 ) AddItem( 232, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 233 ) AddItem( 233, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 234 ) AddItem( 234, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 238 ) AddItem( 238, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 235 ) AddItem( 235, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 241 ) AddItem( 241, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 242 ) AddItem( 242, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 243 ) AddItem( 243, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 247 ) AddItem( 247, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 248 ) AddItem( 248, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 249 ) AddItem( 249, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 250 ) AddItem( 250, 13 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 253 ) AddItem( 253, 50 ) WindowSync( 7, 0, 68 ) RunSoundCode3( 53248, 108, 0, -128, 125 ) SetTextVariable( 0, 254 ) AddItem( 254, 50 ) WindowSync( 7, 0, 68 ) WindowSync( 1, 16, 413 ) WindowSync( 1, 16, 414 ) set VARL_GenBool_7963 = 1 FadeFilter( 6, 16, VAR_GlobUInt8_17, 255, 255, 255 ) EnableMove( ) RunSoundCode( 0, 73 ) EnableMenu( ) Wait( 16 ) FadeFilter( 7, 16, VAR_GlobUInt8_17, 0, 0, 0 ) TerminateEntry( 255 ) break case +1: DisableMenu( ) DisableMove( ) Menu( 0, 0 ) EnableMove( ) EnableMenu( ) break case +2: DisableMenu( ) DisableMove( ) Party( 4, 0 ) UpdatePartyUI( ) EnableMove( ) EnableMenu( ) break case +3: DisableMenu( ) DisableMove( ) SetHP( 0, 9999 ) SetMP( 0, 999 ) CureStatus( 0, 255 ) SetHP( 1, 9999 ) SetMP( 1, 999 ) CureStatus( 1, 255 ) SetHP( 2, 9999 ) SetMP( 2, 999 ) CureStatus( 2, 255 ) SetHP( 3, 9999 ) SetMP( 3, 999 ) CureStatus( 3, 255 ) SetHP( 4, 9999 ) SetMP( 4, 999 ) CureStatus( 4, 255 ) SetHP( 5, 9999 ) SetMP( 5, 999 ) CureStatus( 5, 255 ) SetHP( 6, 9999 ) SetMP( 6, 999 ) CureStatus( 6, 255 ) SetHP( 7, 9999 ) SetMP( 7, 999 ) CureStatus( 7, 255 ) SetHP( 8, 9999 ) SetMP( 8, 999 ) CureStatus( 8, 255 ) SetHP( 9, 9999 ) SetMP( 9, 999 ) CureStatus( 9, 255 ) SetHP( 10, 9999 ) SetMP( 10, 999 ) CureStatus( 10, 255 ) SetHP( 11, 9999 ) SetMP( 11, 999 ) CureStatus( 11, 255 ) RunSoundCode3( 53248, 534, 0, -128, 125 ) FadeFilter( 2, 24, 0, 64, 64, 64 ) RaiseWindows( ) WindowSync( 1, 16, 80 ) EnableMove( ) EnableMenu( ) break case +4: EnableMove( ) EnableMenu( ) Wait( 16 ) FadeFilter( 7, 16, VAR_GlobUInt8_17, 0, 0, 0 ) if ( GetDialogChoice == 0 ) { FadeFilter( 7, 16, VAR_GlobUInt8_17, 0, 0, 0 ) } else { EnableMove( ) 0x27( 255 ) EnableMenu( ) } } return
Hi Tirlititi, sorry for the late reply to the Ipsen Curse topic, but it took me a while to play up to that point in the game (my first playthrough with the Steam version). Plus, I've never used dnSpy before so I also had to learn debugging and stuff (still more of a beginner, lol..).@Kefka: Yes, it is possible with dnSpy again. In the "btl_calc::CalcMain", you need to put the line "btl_calc.CalcSub_15E(cALC_VAR);" a bit everywhere ^^'
Again, having a look at this file makes it easier to read the spell effects before editing the real thing (that has idiotic names and is harder to read).
For example, go to the "case 19" (Physical Strike effect) and change it to this:
Code: [Select]You should put the line before the "CalcSub_20X" ("DoSetDamage_..." in the readable version).Code:case 19: btl_calc.CalcSub_13A(cALC_VAR); btl_calc.CalcSub_141(cALC_VAR); btl_calc.CalcSub_143(cALC_VAR); btl_calc.CalcSub_159(cALC_VAR); if (btl_calc.CalcSub_152(cALC_VAR)) { btl_calc.CalcSub_15E(cALC_VAR); btl_calc.CalcSub_203(cALC_VAR); btl_calc.CalcSub_270(cALC_VAR); } break;
byte x = (byte)5;
byte x = (byte)(intvalue1 + intvalue2);
if (cALC_VAR.at_pow - cALC_VAR.df_pow > 0)