From 21242cffff7171c9f6403cfbab2e4e23d66e02b8 Mon Sep 17 00:00:00 2001 From: ook3d <47336113+ook3D@users.noreply.github.com> Date: Mon, 20 May 2024 16:29:57 -0400 Subject: [PATCH 1/2] update scenario chain NavSpeed --- .../GameFiles/MetaTypes/MetaTypes.cs | 34 +++++++++---------- .../Project/Panels/EditScenarioNodePanel.cs | 34 +++++++++---------- CodeWalker/Project/ProjectForm.cs | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs index 785cd28..a264533 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs @@ -2156,7 +2156,7 @@ namespace CodeWalker.GameFiles : byte //Key:3326075799 { Move = 0, - Unk_7865678 = 1, + MoveIntoVehicleAsPassenger = 1, MoveFollowMaster = 2, } @@ -2171,22 +2171,22 @@ namespace CodeWalker.GameFiles public enum CScenarioChainingEdge__eNavSpeed //SCENARIO (Path) Edge nav speed : byte //Key:1112851290 { - Unk_00_3279574318 = 0, - Unk_01_2212923970 = 1, - Unk_02_4022799658 = 2, - Unk_03_1425672334 = 3, - Unk_04_957720931 = 4, - Unk_05_3795195414 = 5, - Unk_06_2834622009 = 6, - Unk_07_1876554076 = 7, - Unk_08_698543797 = 8, - Unk_09_1544199634 = 9, - Unk_10_2725613303 = 10, - Unk_11_4033265820 = 11, - Unk_12_3054809929 = 12, - Unk_13_3911005380 = 13, - Unk_14_3717649022 = 14, - Unk_15_3356026130 = 15, + kSpeed5Mph = 0, + kSpeed10Mph = 1, + kSpeed15Mph = 2, + kSpeed25Mph = 3, + kSpeed35Mph = 4, + kSpeed45Mph = 5, + kSpeed55Mph = 6, + kSpeed65Mph = 7, + kSpeed80Mph = 8, + kSpeed100Mph = 9, + kSpeed125Mph = 10, + kSpeed150Mph = 11, + kSpeed200Mph = 12, + kSpeedWalk = 13, + kSpeedRun = 14, + kSpeedSprint = 15, } public enum rage__fwArchetypeDef__eAssetType //archetype assetType diff --git a/CodeWalker/Project/Panels/EditScenarioNodePanel.cs b/CodeWalker/Project/Panels/EditScenarioNodePanel.cs index 3b47cbd..323153d 100644 --- a/CodeWalker/Project/Panels/EditScenarioNodePanel.cs +++ b/CodeWalker/Project/Panels/EditScenarioNodePanel.cs @@ -176,7 +176,7 @@ namespace CodeWalker.Project.Panels ScenarioChainEdgeActionComboBox.Items.Clear(); ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.Move); - ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.Unk_7865678); + ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.MoveIntoVehicleAsPassenger); ScenarioChainEdgeActionComboBox.Items.Add(CScenarioChainingEdge__eAction.MoveFollowMaster); ScenarioChainEdgeNavModeComboBox.Items.Clear(); @@ -185,22 +185,22 @@ namespace CodeWalker.Project.Panels ScenarioChainEdgeNavModeComboBox.Items.Add(CScenarioChainingEdge__eNavMode.Roads); ScenarioChainEdgeNavSpeedComboBox.Items.Clear(); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_00_3279574318); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_01_2212923970); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_02_4022799658); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_03_1425672334); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_04_957720931); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_05_3795195414); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_06_2834622009); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_07_1876554076); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_08_698543797); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_09_1544199634); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_10_2725613303); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_11_4033265820); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_12_3054809929); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_13_3911005380); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_14_3717649022); - ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.Unk_15_3356026130); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed5Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed10Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed15Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed25Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed35Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed45Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed55Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed65Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed80Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed100Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed125Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed150Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeed200Mph); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeedWalk); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeedRun); + ScenarioChainEdgeNavSpeedComboBox.Items.Add(CScenarioChainingEdge__eNavSpeed.kSpeedSprint); } diff --git a/CodeWalker/Project/ProjectForm.cs b/CodeWalker/Project/ProjectForm.cs index 5d1f1a6..77dd5cf 100644 --- a/CodeWalker/Project/ProjectForm.cs +++ b/CodeWalker/Project/ProjectForm.cs @@ -6134,7 +6134,7 @@ namespace CodeWalker.Project float dir = 0; var action = CScenarioChainingEdge__eAction.Move; var navMode = CScenarioChainingEdge__eNavMode.Direct; - var navSpeed = CScenarioChainingEdge__eNavSpeed.Unk_00_3279574318; + var navSpeed = CScenarioChainingEdge__eNavSpeed.kSpeed5Mph; var stype = defaulttype; var modelset = defaultmodelset; var flags = defaultflags; From 71671940ebbd69a1dea2d78666848f0d7b76c036 Mon Sep 17 00:00:00 2001 From: ook3d <47336113+ook3D@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:18:10 -0400 Subject: [PATCH 2/2] Update Scenario Point Cluster Unknowns --- .../GameFiles/MetaTypes/MetaTypes.cs | 8 ++++---- .../Panels/EditScenarioNodePanel.Designer.cs | 20 +++++++++---------- .../Project/Panels/EditScenarioNodePanel.cs | 12 +++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs index a264533..1961f6e 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs @@ -5581,8 +5581,8 @@ namespace CodeWalker.GameFiles { public CScenarioPointContainer Points { get; set; } //0 0: Structure: CScenarioPointContainer//2380938603: Points//702683191 public rage__spdSphere ClusterSphere { get; set; } //48 48: Structure: 1062159465: ClusterSphere//352461053 - public float Unk_1095875445 { get; set; } //64 64: Float: 0: 1095875445 //spawn chance? eg 5, 30 - public byte Unk_3129415068 { get; set; } //68 68: Boolean: 0: 3129415068 + public float NextSpawnAttemptDelay { get; set; } //64 64: Float: 0: 1095875445 //spawn chance? eg 5, 30 + public byte AllPointsRequiredForSpawn { get; set; } //68 68: Boolean: 0: 3129415068 public uint Unused0 { get; set; }//72 public uint Unused1 { get; set; }//76 @@ -5618,8 +5618,8 @@ namespace CodeWalker.GameFiles _Data.ClusterSphere = new rage__spdSphere() { centerAndRadius = v4 }; } } - public float Unk1 { get { return _Data.Unk_1095875445; } set { _Data.Unk_1095875445 = value; } } - public bool Unk2 { get { return _Data.Unk_3129415068==1; } set { _Data.Unk_3129415068 = (byte)(value?1:0); } } + public float NextSpawnAttemptDelay { get { return _Data.NextSpawnAttemptDelay; } set { _Data.NextSpawnAttemptDelay = value; } } + public bool AllPointsRequiredForSpawn { get { return _Data.AllPointsRequiredForSpawn==1; } set { _Data.AllPointsRequiredForSpawn = (byte)(value?1:0); } } public MCScenarioPointCluster() { } public MCScenarioPointCluster(MCScenarioPointRegion region) { Region = region; } diff --git a/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs b/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs index f653caa..6e59363 100644 --- a/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs +++ b/CodeWalker/Project/Panels/EditScenarioNodePanel.Designer.cs @@ -2024,7 +2024,7 @@ // this.ScenarioClusterRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.ScenarioClusterRadiusTextBox.Location = new System.Drawing.Point(100, 29); + this.ScenarioClusterRadiusTextBox.Location = new System.Drawing.Point(146, 29); this.ScenarioClusterRadiusTextBox.Name = "ScenarioClusterRadiusTextBox"; this.ScenarioClusterRadiusTextBox.Size = new System.Drawing.Size(204, 20); this.ScenarioClusterRadiusTextBox.TabIndex = 9; @@ -2033,7 +2033,7 @@ // label157 // this.label157.AutoSize = true; - this.label157.Location = new System.Drawing.Point(51, 32); + this.label157.Location = new System.Drawing.Point(97, 32); this.label157.Name = "label157"; this.label157.Size = new System.Drawing.Size(43, 13); this.label157.TabIndex = 8; @@ -2044,9 +2044,9 @@ this.ScenarioClusterUnk2CheckBox.AutoSize = true; this.ScenarioClusterUnk2CheckBox.Location = new System.Drawing.Point(100, 81); this.ScenarioClusterUnk2CheckBox.Name = "ScenarioClusterUnk2CheckBox"; - this.ScenarioClusterUnk2CheckBox.Size = new System.Drawing.Size(55, 17); + this.ScenarioClusterUnk2CheckBox.Size = new System.Drawing.Size(169, 17); this.ScenarioClusterUnk2CheckBox.TabIndex = 12; - this.ScenarioClusterUnk2CheckBox.Text = "Unk 2"; + this.ScenarioClusterUnk2CheckBox.Text = "All Points Required For Spawn"; this.ScenarioClusterUnk2CheckBox.UseVisualStyleBackColor = true; this.ScenarioClusterUnk2CheckBox.CheckedChanged += new System.EventHandler(this.ScenarioClusterUnk2CheckBox_CheckedChanged); // @@ -2054,7 +2054,7 @@ // this.ScenarioClusterUnk1TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.ScenarioClusterUnk1TextBox.Location = new System.Drawing.Point(100, 55); + this.ScenarioClusterUnk1TextBox.Location = new System.Drawing.Point(146, 55); this.ScenarioClusterUnk1TextBox.Name = "ScenarioClusterUnk1TextBox"; this.ScenarioClusterUnk1TextBox.Size = new System.Drawing.Size(204, 20); this.ScenarioClusterUnk1TextBox.TabIndex = 11; @@ -2065,14 +2065,14 @@ this.label140.AutoSize = true; this.label140.Location = new System.Drawing.Point(4, 58); this.label140.Name = "label140"; - this.label140.Size = new System.Drawing.Size(90, 13); + this.label140.Size = new System.Drawing.Size(137, 13); this.label140.TabIndex = 10; - this.label140.Text = "Probability Unk 1:"; + this.label140.Text = "Next Spawn Attempt Delay:"; // // ScenarioClusterGoToButton // this.ScenarioClusterGoToButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ScenarioClusterGoToButton.Location = new System.Drawing.Point(382, 1); + this.ScenarioClusterGoToButton.Location = new System.Drawing.Point(428, 1); this.ScenarioClusterGoToButton.Name = "ScenarioClusterGoToButton"; this.ScenarioClusterGoToButton.Size = new System.Drawing.Size(68, 23); this.ScenarioClusterGoToButton.TabIndex = 7; @@ -2084,7 +2084,7 @@ // this.ScenarioClusterCenterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.ScenarioClusterCenterTextBox.Location = new System.Drawing.Point(100, 3); + this.ScenarioClusterCenterTextBox.Location = new System.Drawing.Point(146, 3); this.ScenarioClusterCenterTextBox.Name = "ScenarioClusterCenterTextBox"; this.ScenarioClusterCenterTextBox.Size = new System.Drawing.Size(276, 20); this.ScenarioClusterCenterTextBox.TabIndex = 6; @@ -2093,7 +2093,7 @@ // label139 // this.label139.AutoSize = true; - this.label139.Location = new System.Drawing.Point(53, 6); + this.label139.Location = new System.Drawing.Point(99, 6); this.label139.Name = "label139"; this.label139.Size = new System.Drawing.Size(41, 13); this.label139.TabIndex = 5; diff --git a/CodeWalker/Project/Panels/EditScenarioNodePanel.cs b/CodeWalker/Project/Panels/EditScenarioNodePanel.cs index 323153d..abea33b 100644 --- a/CodeWalker/Project/Panels/EditScenarioNodePanel.cs +++ b/CodeWalker/Project/Panels/EditScenarioNodePanel.cs @@ -516,8 +516,8 @@ namespace CodeWalker.Project.Panels ScenarioClusterAddToProjectButton.Enabled = !ScenarioClusterDeleteButton.Enabled; ScenarioClusterCenterTextBox.Text = FloatUtil.GetVector3String(c.Position); ScenarioClusterRadiusTextBox.Text = FloatUtil.ToString(c.Radius); - ScenarioClusterUnk1TextBox.Text = FloatUtil.ToString(c.Unk1); - ScenarioClusterUnk2CheckBox.Checked = c.Unk2; + ScenarioClusterUnk1TextBox.Text = FloatUtil.ToString(c.NextSpawnAttemptDelay); + ScenarioClusterUnk2CheckBox.Checked = c.AllPointsRequiredForSpawn; ScenarioClusterPointsListBox.Items.Clear(); ScenarioClusterAddPointButton.Enabled = true; @@ -2009,9 +2009,9 @@ namespace CodeWalker.Project.Panels float v = FloatUtil.Parse(ScenarioClusterUnk1TextBox.Text); lock (ProjectForm.ProjectSyncRoot) { - if (CurrentScenarioNode.Cluster.Unk1 != v) + if (CurrentScenarioNode.Cluster.NextSpawnAttemptDelay != v) { - CurrentScenarioNode.Cluster.Unk1 = v; + CurrentScenarioNode.Cluster.NextSpawnAttemptDelay = v; ProjectForm.SetScenarioHasChanged(true); } } @@ -2025,9 +2025,9 @@ namespace CodeWalker.Project.Panels bool v = ScenarioClusterUnk2CheckBox.Checked; lock (ProjectForm.ProjectSyncRoot) { - if (CurrentScenarioNode.Cluster.Unk2 != v) + if (CurrentScenarioNode.Cluster.AllPointsRequiredForSpawn != v) { - CurrentScenarioNode.Cluster.Unk2 = v; + CurrentScenarioNode.Cluster.AllPointsRequiredForSpawn = v; ProjectForm.SetScenarioHasChanged(true); } }