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:
When I type the command line, it returns this error below, how to solve it?
additional information, i changed index.js, for debug, changed it:
to it:
and now use the same command line, and here is error debuged:
and here is item 102, what this error means?
Additional information: tibia.dat and tibia.spr version 8.6 extended. OTCv8 Client
Tutorial:
This tutorial was made for a reason to support newbie OTS devs. I am not owner of any tools or solutions done neither I really promote to use OTCv8 but nevertheless this OTClient fork have already built-in everything you need regarding the support of upscaled sprites so you can investigate or play with them further. There are countless threads in support board of how to use upscaled sprites in the game client and if you were looking for a solution you are lucky cause this tutorial is for you.
Prerequisities
Prerequisities
- Download latest node.js - Downloading and installing Node.js and...
- Erikas Kontenis
- Replies: 17
- Forum: Basic
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?