Have you deployed the newest version? I see only rc.3
version which is the previous one
Title screen player.save() does not save data to the MongoDB
Normally 4.0.0-rc.4
is released
Hmm, I see on github this rc.4
tag, but here: https://www.npmjs.com/search?q=rpgjs it is not available, might be npm issue.
I can't either install this version because npm could not find it.
npm update 13:43:08
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @rpgjs/types@^4.0.0-rc.4.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
- Edited
I successfully updated dependencies,
but unfortunately, issue persists.
I prepared a branch if you want to reproduce: title-screen-integration
I save data on level-up (to gain level just kill 2 mobs with C button):
onLevelUp(player: RpgPlayer, leveledUpBy: number) {
player.showAnimation('level-up', 'default');
player.allRecovery();
player.save();
},
Then I refresh the page, login in and I am getting the same error: An error has occurred
without any error in console :/
I have this dynamic database for items with custom properties:
import { v4 } from 'uuid';
import Shield from './../../../item/Shield';
import { RpgPlayer } from '@rpgjs/server';
export default function CircleShield() {
@Shield({
id: v4(),
name: 'Shield',
graphic: 'shield',
price: 100,
pdef: Math.round(Math.random() * 5) + 3,
})
class CircleShield {
}
return CircleShield;
}
and also I added custom properties for player:
declare module '@rpgjs/server' {
export interface RpgPlayer {
inventoryGui?: Gui;
isInventoryOpened: boolean;
profileGui?: Gui;
profileGuiOpened: boolean;
inventory?: Backpacks,
}
}
Also video: https://imgur.com/QNdyNs1
Hmm, I can understand that. Animations don't use synchronization but just make a call to the client (socket.emit). And so the call to the client is faster than synchronization, so the animation takes place before the event appears on the client side (and is therefore not displayed).
You could say it's a bug, yes.
But I think it's easily solved:
// create event
// [...]
server.send() // force synchronization with you can also use player.server to access the server
// event.showAnimation(...)
I think this answer is for this post? https://community.rpgjs.dev/d/168-showanimation-does-not-show-animation-for-event-created-by-createdynamicevent/2
Hello,
I found out what is the problem.
PR: https://github.com/RSamaium/RPG-JS/pull/238
There is an issue when json.equipments
is undefined.
Then trying to get a map of undefined occurs.