From 714d963a1d02e40c32afa93cbb1f3f22217fec06 Mon Sep 17 00:00:00 2001 From: Ryan ShrineFox Date: Fri, 29 Jun 2018 02:39:05 -0400 Subject: [PATCH] Add item and object model spawning/attaching, NPC scale --- ModMenu.flow | 111 ++++++++++++++++++++++++++++++++------------------- ModMenu.msg | 46 +++++++++++++++++---- 2 files changed, 108 insertions(+), 49 deletions(-) diff --git a/ModMenu.flow b/ModMenu.flow index b179813..d7e5bae 100644 --- a/ModMenu.flow +++ b/ModMenu.flow @@ -110,7 +110,10 @@ void PlayerEditorDisplay() case 7: PlayerSelectModelScale(); break; - case 8: + case 8: + PlayerAttachItemModel(FLD_PC_GET_RESHND(0)); + break; + case 9: PlayerSetMaxMoney(); break; } @@ -393,6 +396,12 @@ void PlayerAnimViewerDisplay() BIT_ON( 4112 ); DisplayMessagePrompt( BagShowHide ); break; + case 5: // Umbrella On + FLD_BAG_ANIM_DISABLE(); + FLD_UMBRELLA_ANIM_CHANGE( 1 ); + case 6: // Umbrella Off + FLD_BAG_ANIM_DISABLE(); + FLD_UMBRELLA_ANIM_CHANGE( 0 ); } } } @@ -483,6 +492,18 @@ void PlayerSelectModelScale() } } +void PlayerAttachItemModel(int resHandle) +{ + int itemModelMajor = SelectNumberPrompt( ItemSpawnPrompt, 4 ); + int itemModelMinor = SelectNumberPrompt( ItemSpawnPrompt2, 3 ); + //FLD_PC_MODEL_ATTACH_ITEM( resHandle, itemModelMajor, itemModelMinor ); + int itemModel = FLD_ITEM_MODEL_LOAD( itemModelMajor, itemModelMinor ); + FLD_MODEL_LOADSYNC( itemModel ); + FLD_MODEL_SET_VISIBLE( itemModel, 1, 0 ); + FLD_MODEL_ATTACH_TRANSLATE( itemModel, resHandle, 101 ); + FLD_MODEL_ATTACH_ROTATE( itemModel, resHandle, 101 ); +} + // Camera Editor void CameraEditorDisplay() { @@ -509,6 +530,9 @@ void CameraEditorDisplay() case 4: CameraLock(); break; + case 5: + CAMERA_SHAKE_STOP(); + break; } } } @@ -711,6 +735,15 @@ void NpcControlMenuDisplay() case 1: // Animate Model NpcAnimViewerDisplay( gLastSpawnedNpcModelHandle ); break; + case 2: // Scale Model + NpcScale(); + break; + case 3: // Attach Item Model + PlayerAttachItemModel(gLastSpawnedNpcModelHandle); + break; + case 4: // Spawn Object + NpcSpawnObjectModel(FLD_PC_GET_RESHND(0)); + break; } } } @@ -794,6 +827,39 @@ void NpcModelAnimSelectIndex() gNpcAnimGapIndex = temp; } +void NpcScale() +{ + float temp = SelectFloatPrompt( ScalePrompt ); + if ( temp != -1 ) + { + float modelScale = temp / 10; + FLD_MODEL_SET_SCALE( gLastSpawnedNpcModelHandle, modelScale ); + } +} + +void NpcSpawnObjectModel( int resHandle ) +{ + float x = FLD_MODEL_GET_X_TRANSLATE( resHandle ); + float y = FLD_MODEL_GET_Y_TRANSLATE( resHandle ); + float z = FLD_MODEL_GET_Z_TRANSLATE( resHandle ); + float xr = FLD_MODEL_GET_X_ROTATE( resHandle ); + float yr = FLD_MODEL_GET_Y_ROTATE( resHandle ); + float zr = FLD_MODEL_GET_Z_ROTATE( resHandle ); + + int itemModelMajor = SelectNumberPrompt( ObjectSpawnPrompt, 3 ); + int itemModelMinor = SelectNumberPrompt( ObjectSpawnPrompt2, 3 ); + + int objectModel = FLD_OBJ_MODEL_LOAD( itemModelMajor, itemModelMinor ); + FLD_MODEL_LOADSYNC( objectModel ); + //FLD_OBJ_MODEL_LINKBG( objectModel ); + + FLD_MODEL_SET_TRANSLATE( objectModel, x, y, z, 0 ); + FLD_MODEL_SET_ROTATE( objectModel, xr, yr, zr, 0 ); + FLD_MODEL_SYNC_TRANSLATE( objectModel ); + FLD_MODEL_SYNC_ROTATE( objectModel ); + FLD_MODEL_SET_VISIBLE( objectModel, 1, 0 ); +} + // Battle void BattleTypeSelect() { @@ -1247,47 +1313,6 @@ void Misc2() } } -int SelectBoss() -{ - int i = 0; - while ( true ) - { - // Print which menu index we're on - PUTS( "SelectBoss menu index:" ); - PUT( i ); - - int selection = SEL_GENERIC_NOT_HELP( -1, i + SelectBoss ); - - PUTS( "SelectBoss choice:" ); - PUT( selection ); - - if ( selection == -1 ) - return -1; - - if ( selection < 4 ) - { - return selection + ( i * 4 ); - } - else if ( selection == 4 ) // previous - { - if ( i > 0 ) - i--; - else - i = 21; - } - else if ( selection == 5 ) // next - { - if ( i < 21 ) - i++; - else - i = 0; - } - - } - - return -1; -} - void EventBattle() { while ( true ) @@ -1700,7 +1725,9 @@ void PrintEnabledBits() { } void ToggleRange() { + DisplayMessagePrompt( FlagRangePrompt ); int range1 = SelectNumber( 4 ); + DisplayMessagePrompt( FlagRangePrompt2 ); int range2 = SelectNumber( 4 ); int onOff = SEL_GENERIC_NOT_HELP( -1, SelectOnOff ); diff --git a/ModMenu.msg b/ModMenu.msg index c5bc280..2262038 100644 --- a/ModMenu.msg +++ b/ModMenu.msg @@ -64,7 +64,8 @@ Player Options[w][e] [s]Set Team Name[f 4 26 5 21][e] [s]Animation Test[f 4 26 6 22][e] [s]Set Scale[f 4 26 7 23][e] -[s]Max Money[f 4 26 8 24][e] +[s]Attach Item Model[f 4 26 8 196][e] +[s]Max Money[f 4 26 9 24][e] [dlg GENERIC_HELP_16] [s]Add or remove your Personas, or[n]give you or your party[n]members new Skills.[e] @@ -88,7 +89,7 @@ Player Options[w][e] [s]Select one of the protagonist's[n]Field GAP files and view[n]its animations.[e] [dlg GENERIC_HELP_23] -[s]Change the size of the[n]protagonist's model.[e] +[s]Change the size of the[n]selected model.[e] [dlg GENERIC_HELP_24] [s]Adds 999,999 yen to your wallet.[e] @@ -278,7 +279,8 @@ Morgana Out of Bag[e] Morgana In Bag[e] Show Bag[e] Hide Bag[e] - +Umbrella On[e] +Umbrella Off[e] [dlg GAPMenuName] GAP Playback[w][e] @@ -310,8 +312,7 @@ Playback animation[f 4 26 5 81][e] [s]Execute the animation playback[n][clr 9]after the above settings[clr 0][n]have been completed.[e] [dlg ScalePrompt [Scale Model]] -Set Joker's model scale.[n](press Circle to end) -[n]Default is 10.[w][e] +Set the character's model scale.[n](press Circle to end)[n]Default is 10.[w][e] [dlg CameraMenuName] @@ -323,6 +324,7 @@ Adjust FOV[f 4 26 1 86][e] Rotate Camera[f 4 26 2 87][e] Unlock Camera[f 4 26 3 88][e] Lock Camera[f 4 26 4 89][e] +Disable Camera Shake[f 4 26 5 195][e] [dlg GENERIC_HELP_85] [s]Move the camera along the X, Y[n]or Z axis. Hold Square to change[n]the axis.[e] @@ -396,6 +398,9 @@ NPC Options[w][e] [sel SpawnMenu] Spawn Model[f 4 26 0 104][e] Animate Model[f 4 26 1 105][e] +Set Model Scale[f 4 26 2 23][e] +Attach Item Model[f 4 26 3 196][e] +Spawn Object Model[f 4 26 4 197][e] [dlg GENERIC_HELP_104] [s]Input a [clr 9]GMD filename[clr 0][n]to spawn a character model from.[e] @@ -517,7 +522,7 @@ Change Romance Route[f 4 26 5 136][e] Room Editor[f 4 26 6 137][e] Manual Input[f 4 26 7 138][e] Print Enabled Flags[f 4 26 8 139][e] -Mass Flag Editor[f 4 26 9 138][e] +Mass Flag Editor[f 4 26 9 197][e] [dlg GENERIC_HELP_131] [s]Show or hide the user interface[n]elements, such as the date, time,[n]and mission list.[e] @@ -841,7 +846,7 @@ Pyramid[e] Space Station[e] Casino[e] Cruise Ship[e] -Depth of Mementos[e] +Mementos Depths[e] Misc[e] [dlg PalaceName] @@ -880,3 +885,30 @@ Add Persona (Manual Input)[e] [dlg BagShowHide] The bag has been toggled.[n]To see the change, go to a new field[n]or reload the current one.[w][e] + +[dlg GENERIC_HELP_195] +Removes the swaying effect[n]of the camera that's[n]used in dungeons.[w][e] + +[dlg GENERIC_HELP_196] +Select an item's model ID to[n]spawn it and connect it to[n]the character's model.[w][e] + +[dlg GENERIC_HELP_197] +Select a range of flags[n]to either enable or disable.[w][e] + +[dlg ItemSpawnPrompt] +Enter the first half of the model's[n]ID from data.cpk/model/item.[n](Max 4 digits, press Circle to end).[w][e] + +[dlg ItemSpawnPrompt2] +Enter the last half of the model's[n]ID from data.cpk/model/item.[n](Max 3 digits, press Circle to end).[w][e] + +[dlg ObjectSpawnPrompt] +Enter the first half of the[n]model's ID from data.cpk/model/field_tex/object.[n](Max 3 digits, press Circle to end).[w][e] + +[dlg ObjectSpawnPrompt2] +Enter the last half of the[n]model's ID from data.cpk/model/field_tex/object.[n](Max 3 digits, press Circle to end).[w][e] + +[dlg FlagRangePrompt] +Enter the start of the[n]range to narrow down.[n](Max 4 digits, press Circle to end).[w][e] + +[dlg FlagRangePrompt2] +Enter the end of the[n]range to narrow down.[n](Max 4 digits, press Circle to end).[w][e] \ No newline at end of file