Jump to content

Photo

DMap info


  • Please log in to reply
3 replies to this topic

#1 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 02 August 2018 - 08:30 AM

I see a large number of methods/fields for getting info about a DMap; however, the one thing I need appears absent as far as I can tell. How can I get the DMap's "Type"? (Overworld, Dungeon, Interior, BS-Overworld) I don't see a method or field for that in particular.



#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 August 2018 - 03:44 PM

I see a large number of methods/fields for getting info about a DMap; however, the one thing I need appears absent as far as I can tell. How can I get the DMap's "Type"? (Overworld, Dungeon, Interior, BS-Overworld) I don't see a method or field for that in particular.


I included this in 2.54, but there's no access to this in earlier versions.
You'd need to create your own table in 2,50,x, by making an array and manually inserting values for the fields that you require.

 
int hackDMapData[3072] =  //map, type, level, offset, compass, midi  * 512
{
    1,DMT_OVERWORLD, 0, 0, -1, 1, //DMAP 0
    2,DMT_ODUNGEON, 1, 0x05, 0x16, 2, //DMAP 1
    2,DMT_ODUNGEON, 2, 0x3A, 0x02, 2, //DMAP 2
    //and so forth
};

int __getDM_Type(int dmap_id)
{
    return hackDMapData[id*dmap_id + 1];
}

int __getDM_Level(int dmap_id)
{
    return hackDMapData[id*dmap_id + 2];
}

int __getDM_Map(int dmap_id)
{
    return hackDMapData[id*dmap_id];
}

int __getDM_LMIDI(int dmap_id)
{
    return hackDMapData[id*dmap_id + 5];
}


#3 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 02 August 2018 - 04:03 PM

So basically, hardcode the DMap values. I was hoping there was an easier way, but oh well.



#4 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 August 2018 - 08:49 PM

So basically, hardcode the DMap values. I was hoping there was an easier way, but oh well.

Sorry, you have only two choices: Use a hardcoded hack-job, or use an alpha build where you can do this:

dmapdata dm = Game->LoadDMapData(id);
int temptype = dm->Type;



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users