First, I'm going to state the obvious, I really don't know coding too well. That said, I've been using Visustella ElementStatusCore and have managed to create a new entry using the following code:
It works just fine, though obviously quite messy and very WIP. When I add the <blah: blah> tages to an actor's notefield they show up properly as I want them to. However now I am attempting something else. I would like to, for example, change the metadata through a script call.
I've tried running the following in a scriptcall to test,
However I'm not seeing any changes in the status window. Nor do any errors come up in the dev console.
Am I going about this the wrong way? Is it just that I'm missing something simple? Or do I need to do some much heavier lifting to get the desired result?
I want to thank everyone for reading this post, and for any help I can receive on this.
JavaScript:
// Declare Constants
const lineHeight = this.lineHeight();
const actor = this._actor;
const thirdWidth = Math.floor(this.innerWidth / 2);
const padding = 8
let x = 0;
let y = 0;
// Draw Actor Graphic
this.drawActorGraphic(0, this.innerWidth / 2);
// Declare Parameter Rect
let rect = new Rectangle(0, 0, thirdWidth, this.innerHeight);
// Create New Actor Information
Game_Actor.prototype.fullname = function() {
const regex = /<fullname:\s*(\d+)>/i;
const match = this.actor().note.match(regex);
return match ? match[1] : 'Unknown';
};
Game_Actor.prototype.age = function() {
const regex = /<age:\s*(\d+)>/i;
const match = this.actor().note.match(regex);
return match ? parseInt(match[1]) : 'Unknown';
};
Game_Actor.prototype.gender = function() {
const regex = /<gender:\s*(.+)>/i;
const match = this.actor().note.match(regex);
return match ? match[1] : 'Unknown';
};
Game_Actor.prototype.hometown = function() {
const regex = /<hometown:\s*(.+)>/i;
const match = this.actor().note.match(regex);
return match ? match[1] : 'Unknown';
};
// Draw Skill Types
x = rect.x;
y = 0;
this.resetFontSettings();
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawTextEx(`\\C[16]Full Name:\\C[0] ${actor.fullname()}`, padding, 0, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawTextEx(`\\C[16]Class:\\C[0] ${actor.fullname()}`, padding, lineHeight, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawTextEx(`\\C[16]Age:\\C[0] ${actor.age()}`, padding, lineHeight * 2, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawTextEx(`\\C[16]Gender:\\C[0] ${actor.gender()}`, padding, lineHeight * 3, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawTextEx(`\\C[16]Hometown:\\C[0] ${actor.hometown()}`, padding, lineHeight * 4, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, this.innerHeight - y);
//
// Draw Weapon Types
rect.x += rect.width;
x = rect.x;
y = 0;
this.resetFontSettings();
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawText(`FillerText`, x + padding, 0, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawText(`FillerText`, x + padding, lineHeight, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
this.drawText(`FillerText`, x + padding, lineHeight * 2, this.contentsWidth(), lineHeight);
y += lineHeight;
this.drawItemDarkRect(x, y, rect.width, this.innerHeight - y);
// Draw Armor Types
// rect.x += rect.width;
// x = rect.x;
// y = 0;
// rect.width = this.innerWidth - rect.x;
// this.resetFontSettings();
// this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
// this.drawTextEx(`\\C[16]Age: \\C[0]${actor.age()}`, 24, 0, this.contentsWidth(), lineHeight);
// y += lineHeight;
// this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
// this.drawText(`Race: ${actor.race()}`, 24, lineHeight, this.contentsWidth(), lineHeight);
// y += lineHeight;
// this.drawItemDarkRect(x, y, rect.width, lineHeight, 2);
// this.drawText(`Hometown: ${actor.hometown()}`, 24, lineHeight * 2, this.contentsWidth(), lineHeight);
// y += lineHeight;
// this.drawItemDarkRect(x, y, rect.width, this.innerHeight - y);
It works just fine, though obviously quite messy and very WIP. When I add the <blah: blah> tages to an actor's notefield they show up properly as I want them to. However now I am attempting something else. I would like to, for example, change the metadata through a script call.
I've tried running the following in a scriptcall to test,
Code:
$gameActors.actor(1).actor().meta.Age = 25;
However I'm not seeing any changes in the status window. Nor do any errors come up in the dev console.
Am I going about this the wrong way? Is it just that I'm missing something simple? Or do I need to do some much heavier lifting to get the desired result?
I want to thank everyone for reading this post, and for any help I can receive on this.