uojs/uodatareader

Map tiles return method

Closed this issue · 4 comments

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

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 :)

but what about getting json list of tiles?

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

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

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

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