Make it possible to scale + rotated pkmn models

PokeModelScale|Value - Scale all Pokémon models in battle by value (sng), default  = 1
PokeModelRotation|xRot,zRot - Rotate all Pokémon models by the specified radians. Y rotation is dynamically controlled by the game so I didn't want to mess with that.
This commit is contained in:
JappaWakka 2024-11-30 11:45:59 +01:00
parent 0415df9ee3
commit 2640ec070f
5 changed files with 51 additions and 32 deletions

View File

@ -254,10 +254,12 @@
OwnPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(12, OwnEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OwnPokemon), 3, WildPokemon.GetDisplayName(), 0, True, "Still", New List(Of Rectangle)}, 1,,, ownModel), NPC)
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
Screen.Level.Entities.Add(OppPokemonNPC)
@ -412,10 +414,12 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(OppPokemon), 1, OppPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)}, InitiallyVisibleOpp,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
@ -660,10 +664,12 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
Screen.Level.Entities.Add(OwnPokemonNPC)
@ -783,10 +789,12 @@
OppPokemonNPC = CType(Entity.GetNewEntity("NPC", New Vector3(15, 0 + OppEntityOffsetY, 13) + BattleMapOffset, {Nothing}, {0, 0}, False, New Vector3(0), New Vector3(1), BaseModel.BillModel, 0, "", True, New Vector3(1), 1, "", "", New Vector3(0), {PokemonForms.GetOverworldSpriteName(WildPokemon), 1, WildPokemon.GetDisplayName(), 1, True, "Still", New List(Of Rectangle)},,,, oppModel), NPC)
If ownModel <> "" Then
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OwnPokemonNPC.Scale = New Vector3(OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
If oppModel <> "" Then
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
OppPokemonNPC.Scale = New Vector3(OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
End If
Screen.Level.Entities.Add(OwnPokemonNPC)

View File

@ -112,11 +112,13 @@
Case 2
Select Case Me._entity
Case BattleEntities.OwnPokemon
BV2Screen.OwnPokemonNPC.Scale = New Vector3(BV2Screen.OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
BV2Screen.OwnPokemonNPC.Scale = New Vector3(BV2Screen.OwnPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
BV2Screen.OwnPokemonNPC.Rotation = NPC.GetRotationFromInteger(BV2Screen.OwnPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
BV2Screen.OwnPokemonNPC.ModelPath = _newTexture
BV2Screen.OwnPokemonNPC.Model = ModelManager.GetModel(BV2Screen.OwnPokemonNPC.ModelPath)
Case BattleEntities.OppPokemon
BV2Screen.OppPokemonNPC.Scale = New Vector3(BV2Screen.OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE
BV2Screen.OppPokemonNPC.Scale = New Vector3(BV2Screen.OppPokemon.GetModelProperties().Item1) * ModelManager.MODELSCALE * GameModeManager.PokeModelScale
BV2Screen.OppPokemonNPC.Rotation = NPC.GetRotationFromInteger(BV2Screen.OppPokemonNPC.faceRotation) + GameModeManager.PokeModelRotation
BV2Screen.OppPokemonNPC.ModelPath = _newTexture
BV2Screen.OppPokemonNPC.Model = ModelManager.GetModel(BV2Screen.OppPokemonNPC.ModelPath)
End Select

View File

@ -9,31 +9,36 @@
If System.IO.File.Exists(ContentPackFile) = True Then
Dim Lines() As String = System.IO.File.ReadAllLines(ContentPackFile)
For Each Line As String In Lines
If Line.GetSplit(0, "|").ToLower = "waterspeed" Then
GameModeManager.ForceWaterSpeed = CInt(Line.GetSplit(1, "|"))
Else
Select Case Line.CountSplits("|")
Case 2 'ResolutionChange
Dim TextureName As String = Line.GetSplit(0, "|")
Dim Resolution As Single = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator))
Select Case Line.GetSplit(0, "|").ToLower
Case "waterspeed"
GameModeManager.ForceWaterSpeed = CInt(Line.GetSplit(1, "|"))
Case "pokemodelscale"
GameModeManager.PokeModelScale = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator))
Case "pokemodelrotation"
GameModeManager.PokeModelRotation = New Vector3(CSng(Line.GetSplit(1, "|").GetSplit(0).Replace(".", GameController.DecSeparator)), 0, CSng(Line.GetSplit(1, "|").GetSplit(1).Replace(".", GameController.DecSeparator)))
Case Else
Select Case Line.CountSplits("|")
Case 2 'ResolutionChange
Dim TextureName As String = Line.GetSplit(0, "|")
Dim Resolution As Single = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator))
If TextureResolutions.ContainsKey(TextureName) = False Then
TextureResolutions.Add(TextureName, Resolution)
End If
Case 4 'TextureReplacement
Dim oldTextureName As String = Line.GetSplit(0, "|")
Dim newTextureName As String = Line.GetSplit(2, "|")
Dim oRS As String = Line.GetSplit(1, "|") 'oRS = oldRectangleSource
Dim nRS As String = Line.GetSplit(3, "|") 'nRS = newRectangleSource
If TextureResolutions.ContainsKey(TextureName) = False Then
TextureResolutions.Add(TextureName, Resolution)
End If
Case 4 'TextureReplacement
Dim oldTextureName As String = Line.GetSplit(0, "|")
Dim newTextureName As String = Line.GetSplit(2, "|")
Dim oRS As String = Line.GetSplit(1, "|") 'oRS = oldRectangleSource
Dim nRS As String = Line.GetSplit(3, "|") 'nRS = newRectangleSource
Dim oldTextureSource As New TextureSource(oldTextureName, New Rectangle(CInt(oRS.GetSplit(0)), CInt(oRS.GetSplit(1)), CInt(oRS.GetSplit(2)), CInt(oRS.GetSplit(3))))
Dim newTextureSource As New TextureSource(newTextureName, New Rectangle(CInt(nRS.GetSplit(0)), CInt(nRS.GetSplit(1)), CInt(nRS.GetSplit(2)), CInt(nRS.GetSplit(3))))
Dim oldTextureSource As New TextureSource(oldTextureName, New Rectangle(CInt(oRS.GetSplit(0)), CInt(oRS.GetSplit(1)), CInt(oRS.GetSplit(2)), CInt(oRS.GetSplit(3))))
Dim newTextureSource As New TextureSource(newTextureName, New Rectangle(CInt(nRS.GetSplit(0)), CInt(nRS.GetSplit(1)), CInt(nRS.GetSplit(2)), CInt(nRS.GetSplit(3))))
If TextureReplacements.ContainsKey(oldTextureSource) = False Then
TextureReplacements.Add(oldTextureSource, newTextureSource)
End If
End Select
End If
If TextureReplacements.ContainsKey(oldTextureSource) = False Then
TextureReplacements.Add(oldTextureSource, newTextureSource)
End If
End Select
End Select
Next
End If
End If

View File

@ -4,6 +4,8 @@ Public Class GameModeManager
Private Shared GameModePointer As Integer = 0
Public Shared Initialized As Boolean = False
Public Shared ForceWaterSpeed As Integer = -1
Public Shared PokeModelScale As Single = 1
Public Shared PokeModelRotation As New Vector3(0, 0, 0)
''' <summary>
''' Loads (or reloads) the list of GameModes. The pointer also gets reset.

View File

@ -517,6 +517,8 @@ Public Class NewOptionScreen
MusicManager.PlayNoMusic()
ContentPackManager.Clear()
GameModeManager.ForceWaterSpeed = -1
GameModeManager.PokeModelScale = 1
GameModeManager.PokeModelRotation = New Vector3(0, 0, 0)
For Each s As String In Core.GameOptions.ContentPackNames
ContentPackManager.Load(GameController.GamePath & "\ContentPacks\" & s & "\exceptions.dat")
Next