jcageman/d2mapapi

any chance list of rooms per level can be added?

Closed this issue · 4 comments

emko commented

i was going to try but i have zero c++ experience... i think you have to loop over the rooms using pRoomNext / pRoomsNear, basically i want the positions and size of all the rooms that make up the level. I think the created output object in the array would just need the PosX,PosY,SizeX,SizeY.

if its possible thanks.

struct Room1 {
   Room1** pRoomsNear;    //0x00
   DWORD _1[3];         //0x04
   Room2* pRoom2;         //0x10
   DWORD _2[3];         //0x14
   CollMap* Coll;         //0x20
   DWORD dwRoomsNear;      //0x24
   DWORD _3[9];         //0x28
   DWORD dwPosX;         //0x4C
   DWORD dwPosY;         //0x50
   DWORD dwSizeX;         //0x54
   DWORD dwSizeY;         //0x58
   DWORD _4[6];         //0x5C
   UnitAny* pUnitFirst;   //0x74
   DWORD _5;            //0x78
   Room1* pRoomNext;      //0x7C
}; 

Could you explain why you would want the rooms? It helps me judge if it makes sense to add it

emko commented

no problem, i just want to visualize how the game creates the mazes and joins them, i have some of the data from the game files and the rest from the mapRows, but i would need the location of the rooms that make up the level and i don't know any c++ to add it to your code

thanks

Ok, clear. It wouldn't be hard to add, but I would tend to say that for now this would be out of scope, since for most use cases this doesn't add anything, the rows already indirectly contain the relevant data for navigation. It's additional data the API would need to return, so that's why I hesitate.

emko commented

oh i see, thanks anyways was worth a shot asking before i try to learn some c++ to do it my self