uojs / uodatareader

Provides an API to read MUL/UOP files using Node.js
6 stars 0 forks source link

Map tiles return method #1

Closed lamo2k123 closed 7 years ago

lamo2k123 commented 7 years ago

It takes arguments: Id: Number // Map ID x: Number // Real character position X (NO need to divide by the number of tiles on the block axis X) y: Number // Real character position Y (NO need to divide by the number of tiles on the block axis Y) size: Number // size of the return unit type: String // return type of block

method return: Array

Later, I will write a more detailed description

kevinhikaruevans commented 7 years ago

I got maps and land sorta working (for UOP files only).

You should be able to clone it and check it out:

https://github.com/kevinhikaruevans/uodatareader/blob/556407dd7dc9c9c39e956405973d1d3bdd11d6f5/test.js

If you have any suggestions, let me know and I'll fix them :)

lamo2k123 commented 7 years ago

but what about getting json list of tiles?

kevinhikaruevans commented 7 years ago

You'll need to call JSON.stringify on map.getLandBlock.

Right now, getLandBlock still returns Array(64) of tile IDs and Z.

kevinhikaruevans commented 7 years ago

// load map block:
const felucca = new uodatareader.Map({
    baseDirectory: '../tmp/uo',
    mapId: 0
});

const area = felucca.getLandBlock(1, 1);
console.log(area);