mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 15:02:54 +08:00
Fix for scenario YMT entity overrides (stutters), Create new scenario chains in clusters
This commit is contained in:
parent
24370c1b5d
commit
b4c481d83f
@ -11,7 +11,7 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
List<MetaBuilderBlock> Blocks = new List<MetaBuilderBlock>();
|
||||
|
||||
int MaxBlockLength = 0x2000; //TODO: figure what this should be!
|
||||
int MaxBlockLength = 0x4000; //TODO: figure what this should be!
|
||||
|
||||
|
||||
public MetaBuilderBlock EnsureBlock(MetaName type)
|
||||
|
@ -3753,9 +3753,27 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
if ((EntityOverrides != null) && (EntityOverrides.Length > 0))
|
||||
{
|
||||
//mb.AddStructureInfo(MetaName.CScenarioEntityOverride); //will get added by MCScenarioEntityOverride
|
||||
//mb.AddStructureInfo(MetaName.CExtensionDefSpawnPoint);
|
||||
_Data.EntityOverrides = mb.AddWrapperArray(EntityOverrides);
|
||||
//_Data.EntityOverrides = mb.AddWrapperArray(EntityOverrides);
|
||||
|
||||
|
||||
mb.AddStructureInfo(MetaName.CScenarioEntityOverride);
|
||||
var cents = new CScenarioEntityOverride[EntityOverrides.Length];
|
||||
for (int i = 0; i < EntityOverrides.Length; i++)
|
||||
{
|
||||
var mcent = EntityOverrides[i];
|
||||
var cent = mcent.Data;
|
||||
var scps = mcent.GetCScenarioPoints();
|
||||
if (scps != null)
|
||||
{
|
||||
mb.AddStructureInfo(MetaName.CExtensionDefSpawnPoint);
|
||||
mb.AddEnumInfo((MetaName)3573596290);
|
||||
mb.AddEnumInfo((MetaName)700327466);
|
||||
cent.ScenarioPoints = mb.AddItemArrayPtr(MetaName.CExtensionDefSpawnPoint, scps);
|
||||
}
|
||||
cents[i] = cent;
|
||||
}
|
||||
_Data.EntityOverrides = mb.AddItemArrayPtr(MetaName.CScenarioEntityOverride, cents);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4429,6 +4447,18 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
|
||||
|
||||
public CExtensionDefSpawnPoint[] GetCScenarioPoints()
|
||||
{
|
||||
if ((ScenarioPoints == null) || (ScenarioPoints.Length == 0)) return null;
|
||||
CExtensionDefSpawnPoint[] r = new CExtensionDefSpawnPoint[ScenarioPoints.Length];
|
||||
for (int i = 0; i < ScenarioPoints.Length; i++)
|
||||
{
|
||||
r[i] = ScenarioPoints[i].Data;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override string Name
|
||||
{
|
||||
|
@ -4733,6 +4733,7 @@ namespace CodeWalker
|
||||
var copyn = CurrentScenarioNode?.ChainingNode;
|
||||
var copyp = CurrentScenarioNode?.MyPoint;
|
||||
var copye = CurrentScenarioChainEdge;
|
||||
var copycl = CurrentScenarioNode?.Cluster;
|
||||
|
||||
MCScenarioChain chain = new MCScenarioChain();
|
||||
if (copy != null)
|
||||
@ -4748,8 +4749,26 @@ namespace CodeWalker
|
||||
var pos1 = GetSpawnPos(10.0f);
|
||||
var pos2 = pos1 + Vector3.UnitX;
|
||||
|
||||
var n1 = CurrentScenario.ScenarioRegion.AddNode();
|
||||
var n2 = CurrentScenario.ScenarioRegion.AddNode();
|
||||
ScenarioNode n1 = null;// CurrentScenario.ScenarioRegion.AddNode();
|
||||
|
||||
if (copycl != null)
|
||||
{
|
||||
ScenarioNode copyclnode = new ScenarioNode(CurrentScenario);
|
||||
copyclnode.Cluster = copycl;
|
||||
copyclnode.ClusterMyPoint = new MCScenarioPoint(CurrentScenario.CScenarioPointRegion);
|
||||
copyclnode.ClusterMyPoint.InteriorName = 493038497; //JenkHash.GenHash("none");
|
||||
copyclnode.ClusterMyPoint.GroupName = 493038497;
|
||||
copyclnode.ClusterMyPoint.IMapName = 493038497;
|
||||
copyclnode.ClusterMyPoint.TimeStart = 0;
|
||||
copyclnode.ClusterMyPoint.TimeEnd = 24;
|
||||
n1 = CurrentScenario.ScenarioRegion.AddNode(copyclnode);
|
||||
}
|
||||
else
|
||||
{
|
||||
n1 = CurrentScenario.ScenarioRegion.AddNode();
|
||||
}
|
||||
|
||||
ScenarioNode n2 = CurrentScenario.ScenarioRegion.AddNode();
|
||||
|
||||
if (copyp != null)
|
||||
{
|
||||
@ -8910,6 +8929,11 @@ namespace CodeWalker
|
||||
}
|
||||
}
|
||||
UpdateScenarioNodeTreeNode(CurrentScenarioNode);
|
||||
|
||||
if (CurrentScenarioNode.ChainingNode != null)
|
||||
{
|
||||
ScenarioChainNodeTypeComboBox.SelectedItem = stype;
|
||||
}
|
||||
}
|
||||
|
||||
private void ScenarioPointModelSetComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user