• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Upscale sprites

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,210
Solutions
35
Reaction score
206
Hello, I'm trying to install this tutorial, but having problems when executing the command
Additional information: tibia.dat and tibia.spr version 8.6 extended. OTCv8 Client

Tutorial: In this part, when i execute:
npm run unpack-dat ./binary/Tibia.dat ./binary/Tibia.json

When I type the command line, it returns this error below, how to solve it?
Code:
[2024-10-07T21:39:03.754Z] Starting program unpack-dat
C:\Users\arthu\Downloads\Node Js\opentibia-tools-main\src\dat-loader\index.js:56
        const { name, reader } = ITEM_PROPERTIES.find(({id}) => id === propertyId);
                ^

TypeError: Cannot destructure property 'name' of 'ITEM_PROPERTIES.find(...)' as it is undefined.
    at readObjects (C:\Users\arthu\Downloads\Node Js\opentibia-tools-main\src\dat-loader\index.js:56:17)
    at Object.read (C:\Users\arthu\Downloads\Node Js\opentibia-tools-main\src\dat-loader\index.js:113:21)
    at C:\Users\arthu\Downloads\Node Js\opentibia-tools-main\index.js:17:41
    at Object.<anonymous> (C:\Users\arthu\Downloads\Node Js\opentibia-tools-main\index.js:69:3)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.18.0


additional information, i changed index.js, for debug, changed it:
JavaScript:
const readObjects = (headers) => {
    let itemId = 100;
    const results = {
        items: [],
        creatures: [],
        effects: [],
        distants: [],
    }
    let properties = [];

    while(fileReader.hasMore()) {
        const propertyId = fileReader.readNumber();
        const debug = ITEM_PROPERTIES.find(({id}) => id === propertyId);
        const { name, reader } = ITEM_PROPERTIES.find(({id}) => id === propertyId);
        const data = reader ? reader(fileReader) : undefined;
        if (propertyId === 255) { // magic number
            const { id, type, typeId } = getItemTypeProperties(itemId++, headers);
            results[type].push({...data, properties, id, type, typeId});
            properties = [];
        } else {
            properties.push({name, data});
        }
    }
    return results;
}

to it:
JavaScript:
const readObjects = (headers) => {
    let itemId = 100;
    const results = {
        items: [],
        creatures: [],
        effects: [],
        distants: [],
    }
    let properties = [];

    while(fileReader.hasMore()) {
        const propertyId = fileReader.readNumber();
        const debug = ITEM_PROPERTIES.find(({id}) => id === propertyId);
        if (!debug) {
            console.error(`Invalid propertyId: ${propertyId} for itemId: ${itemId+1}`);
        }
        const { name, reader } = ITEM_PROPERTIES.find(({id}) => id === propertyId);
        const data = reader ? reader(fileReader) : undefined;
        if (propertyId === 255) { // magic number
            const { id, type, typeId } = getItemTypeProperties(itemId++, headers);
            results[type].push({...data, properties, id, type, typeId});
            properties = [];
        } else {
            properties.push({name, data});
        }
    }
    return results;
}

and now use the same command line, and here is error debuged:

and here is item 102, what this error means?
 
Back
Top