Hi Enigma. Great framework u got there. I'm still trying to get access to navigation data. After initial success all went down to shithole after Scene class update xD Here is what I got (based on information from this thread):
Code:
public class SceneRaw : MemoryObject
{
public const int SizeOf = 700;
public SceneRaw(ProcessMemory memory, int address);
public SerializeData x0E8_SceneSnoId { get; }
public float x0FC_MeshMinX { get; }
public float x100_MeshMinY { get; }
}
so far I used this Scene:
Code:
public class Scene : MemoryObject
{
// 2.0.5.24017
public const int SizeOf = 0x210; // 528
public Scene(ProcessMemory memory, int address)
: base(memory, address) { }
public SerializeData x00_SceneSnoId { get { return Field<SerializeData>(0x000); } }
public int x00C { get { return Field<int>(0x00C); } }
public NavMeshDef x040_NavMeshDef { get { return Field<NavMeshDef>(0x040); } }
public SerializeData x068 { get { return Field<SerializeData>(0x068); } }
public int x070_Count { get { return Field<int>(0x070); } }
public int[] x074_PtrArray_SceneSnoId { get { return Dereference<int>(0x074, x070_Count); } }
public SerializeData x0A8 { get { return Field<SerializeData>(0x0A8); } }
public int x0B0_Count { get { return Field<int>(0x0B0); } }
public int[] x0B4_PtrArray_SceneSnoId { get { return Dereference<int>(0x0B4, x0B0_Count); } }
public int x0F0_Count { get { return Field<int>(0x0F0); } }
public int[] x0F4_PtrArray_MarkerSetSnoId { get { return Dereference<int>(0x0F4, x0F0_Count); } }
public SerializeData x168 { get { return Field<SerializeData>(0x168); } }
public int x170 { get { return Field<int>(0x170); } }
public int x178_Count { get { return Field<int>(0x178); } }
public NavZoneDefinition x180_NavZoneDef { get { return Field<NavZoneDefinition>(0x180); } }
public int x208_AppearanceSnoId { get { return Field<int>(0x208); } }
public int x20C_PhysMeshSnoId { get { return Field<int>(0x20C); } }
}
and following code to gather navigation data (all Nav* classes are based on AutoGenerated classes):
Code:
float plauer_x = ActorHelper.GetLocalActor().x0A4_WorldPosX;
float plauer_y = ActorHelper.GetLocalActor().x0A8_WorldPosY;
foreach (SnoDefinition<MemoryObject> sno_def in Engine.Current.SnoGroupsByCode[(int)SnoGroupId.Scene].x10_Container)
{
if (sno_def.x08_SnoGroupId != SnoGroupId.Scene)
continue;
Scene s = sno_def.x10_SnoItemAs<Scene>();
foreach (SceneRaw sr in Engine.Current.ObjectManager.x798_Storage.x1BC_Scenes)
{
if (s.x0E8_SceneSnoId == sr.x0E8_SceneSnoId.x00)
{
NavCell[] nav_cells = s.x180_NavZoneDef.x0C_NavCells;
if (nav_cells == null)
continue;
foreach (NavCell nav_cell in nav_cells)
{
float min_x = nav_cell.x00_Min.x00_X + sr.x0FC_MeshMinX - plauer_x;
float min_y = nav_cell.x00_Min.x04_Y + sr.x100_MeshMinY - plauer_y;
float max_x = nav_cell.x0C_Max.x00_X + sr.x0FC_MeshMinX - plauer_x;
float max_y = nav_cell.x0C_Max.x04_Y + sr.x100_MeshMinY - plauer_y;
//nav_cells_vis.Add(new NavCellVis(new PointF(min_x, min_y), new PointF(max_x, max_y), (nav_cell.x18_Flags & 1) != 0));
}
break;
}
}
}
Could you help me out with finding current location of NavZoneDefinition in Scene. Another thing is, application crashes on access to scenes using:
Code:
SceneRaw sr in Engine.Current.ObjectManager.x798_Storage.x1BC_Scenes
so I guess SceneRaw is not up to date as well :/