Skip to content

Commit

Permalink
Add item and object model spawning/attaching, NPC scale
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrineFox committed Jun 29, 2018
1 parent a69e0e9 commit 714d963
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 49 deletions.
111 changes: 69 additions & 42 deletions ModMenu.flow
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 );
}
}
}
Expand Down Expand Up @@ -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()
{
Expand All @@ -509,6 +530,9 @@ void CameraEditorDisplay()
case 4:
CameraLock();
break;
case 5:
CAMERA_SHAKE_STOP();
break;
}
}
}
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );
Expand Down
46 changes: 39 additions & 7 deletions ModMenu.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]

0 comments on commit 714d963

Please sign in to comment.