Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I wish I could provide some input on this, but so far the most I've done with plugins is open their files and stare blankly; I don't even know where to start.
I sent Yami an email asking if he could provide some input on the issue though, so once I hear back from him, I'll be sure to pass it on!
In the meantime, have you actually looked at any of the plugin files..? Maybe they can provide some hints as to how things are being done. If you've got the head to go looking, I'm sure you'll glean more from them than I could, at any rate.
I was able to check and execute 3 methods, but I don't know if there are others besides the 3 I found.
export default class Plugin {
onStart() {
console.log('Hero created on scene',Scene);
}
update() {
console.log(`Hero updated`, Actor.latest);
}
onDestroy() {
console.log('Hero deleted');
}
}
I also understood how class importing works. There's a folder named 'Script' which isn't visible in the editor but is visible in the project. With an editor like Visual Code, it's easy to navigate through the code. To manipulate the 'hero', you just need to import and use the constant from the 'actor.js' file. This makes it easy to manage the hero via script. However, I still believe it would be better to have a documented Plugin Lifecycle to ease the manipulation of all the game's classes.
static eventTypeMap = {
update: 'update',
create: 'onCreate',
autorun: 'onStart',
collision: 'onCollision',
hittrigger: 'onHitTrigger',
hitactor: 'onHitActor',
destroy: 'onDestroy',
playerenter: 'onPlayerEnter',
playerleave: 'onPlayerLeave',
actorenter: 'onActorEnter',
actorleave: 'onActorLeave',
skillcast: 'onSkillCast',
skilladd: 'onSkillAdd',
skillremove: 'onSkillRemove',
stateadd: 'onStateAdd',
stateremove: 'onStateRemove',
equipmentadd: 'onEquipmentAdd',
equipmentremove: 'onEquipmentRemove',
itemuse: 'onItemUse',
keydown: 'onKeyDown',
keyup: 'onKeyUp',
mousedown: 'onMouseDown',
mousedownLB: 'onMouseDownLB',
mousedownRB: 'onMouseDownRB',
mouseup: 'onMouseUp',
mouseupLB: 'onMouseUpLB',
mouseupRB: 'onMouseUpRB',
mousemove: 'onMouseMove',
mouseenter: 'onMouseEnter',
mouseleave: 'onMouseLeave',
click: 'onClick',
doubleclick: 'onDoubleClick',
wheel: 'onWheel',
input: 'onInput',
focus: 'onFocus',
blur: 'onBlur',
destroy: 'onDestroy',
}
I know it actually adds the entries into the event types, as I've tested it myself by adding 'Create' and 'Destroy' event types to items (which by default only have 'Use Item'); I haven't actually tried using them though, as items aren't technically 'created' or 'destroyed' within a scene.
But as far as documentation, I want to say that the plugin info is potentially part of what Yami is working on, but I can't say that for sure, obviously. Only he can.
We've talked a few times over the past week, but it's only been short responses on his behalf, I guess he's still busy with stuff. Hopefully he gets everything smoothed out sooner rather than later, and can get back on top of things with the engine here!