Good evening, all! Two questions this time.
1) Passive state application
Is there a way to give actors whatever chance to apply states automatically across all physical attacks? We know that you can do it per weapon--for example, that you could make a Poison Sword (wielder has a 25% chance to poison the enemy on strike) and edit the Poison Sword's Traits --> Attack --> Attack Skill --> Have it use a cloned version of the regular 0001 Attack skill, one that includes the chance to poison. However, that's not what we're after. We're looking for a trait elsewhere (perhaps a Poisoner state, a wearable Poisoner's Ring, etc.) that applies this effect to all physical attacks with any weapon, even those that wouldn't have it otherwise.
Perhaps entire... like... custom-created "chance to inflict each particular state" stats/parameters, perhaps? elsewhere in the chain, which the attack skills can then take into account? You'd need a way to tie the Add State value in skills to a variable instead of a hard number, though. But if there's any way that's feasible, it might just solve question 2 below.
2) Makeshift state menu
So, we're using VisuStella's Element/Status Core, which has a very beautiful screen to display a given party member's elemental strengths/weaknesses and bonus damage they inflict.
The neat thing about the VS cores is that the plugin management screen just lets you dive right into the full JS code of exactly what's being drawn here, where it gets it from, how it aligns and displays everything, everything. This is what appears to be the complete code of how this screen was generated:
We're not using the "Traits" tab on the above screen for anything important, and we could rename it and change the code to put basically whatever we want in there. So, to that end, maybe we could put state info there instead. Like, is there a way to copy but modify the above code for the two elemental columns (resistance + bonus damage) and turn them into something that displays the same kind of information but for states, with two state columns (state resistance + chance to inflict state?) Something that would show up if, say wearing a ring that adds a +5% Sleep and +5% Deep Sleep chance to their outgoing attacks and makes them +25% more resistant to Silence on incoming ones, at the cost of being more vulnerable to Fear (-50% resistance or so.) A screen that can just compile and display all total resistances and infliction chances for whichever select states we're including here, like the elements screen above, possibly even using the same code but just getting it to point at different stats/parameters instead.
We could make custom stats/parameters if the code needs something to point at to display them (I suppose "Actor's innate chance to inflict Poison" isn't really a thing if the game is used to that being calculated per Skill instead) but then we'd need to know how to make those stats/parameters actually affect the things they're supposed to be affecting.
Thank you so much for all your help, as always! :yhappy:
1) Passive state application
Is there a way to give actors whatever chance to apply states automatically across all physical attacks? We know that you can do it per weapon--for example, that you could make a Poison Sword (wielder has a 25% chance to poison the enemy on strike) and edit the Poison Sword's Traits --> Attack --> Attack Skill --> Have it use a cloned version of the regular 0001 Attack skill, one that includes the chance to poison. However, that's not what we're after. We're looking for a trait elsewhere (perhaps a Poisoner state, a wearable Poisoner's Ring, etc.) that applies this effect to all physical attacks with any weapon, even those that wouldn't have it otherwise.
Perhaps entire... like... custom-created "chance to inflict each particular state" stats/parameters, perhaps? elsewhere in the chain, which the attack skills can then take into account? You'd need a way to tie the Add State value in skills to a variable instead of a hard number, though. But if there's any way that's feasible, it might just solve question 2 below.
2) Makeshift state menu
So, we're using VisuStella's Element/Status Core, which has a very beautiful screen to display a given party member's elemental strengths/weaknesses and bonus damage they inflict.
The neat thing about the VS cores is that the plugin management screen just lets you dive right into the full JS code of exactly what's being drawn here, where it gets it from, how it aligns and displays everything, everything. This is what appears to be the complete code of how this screen was generated:
JavaScript:
// Declare Constants
const lineHeight = this.lineHeight();
const actor = this._actor;
const padding = this.itemPadding();
const labelFmt = '\\C[16]%1: \\C[0]%2';
const traitType1 = DataManager.traitSetType('Element');
const traitSet1 = actor.traitSet('Element');
const traitType2 = DataManager.traitSetType('SubElement');
const traitSet2 = actor.traitSet('SubElement');
const traitHeight = (this.innerHeight / Math.max(Window_StatusData.traitCol1.length, Window_StatusData.traitCol2.length)) - lineHeight;
let x = 0;
let y = 0;
let width = this.innerWidth / 2;
// Draw Actor Graphic
this.drawActorGraphic(0, width);
// Draw Element Trait Sets
if (traitType1.Visible || traitType2.Visible) {
this.drawItemDarkRect(x, y, width, lineHeight, 2);
this.drawItemDarkRect(width, y, width, lineHeight, 2);
if (traitType1.Visible) {
this.drawTextEx(labelFmt.format(traitType1.Label, traitSet1.Display), padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(labelFmt.format(traitType2.Label, traitSet2.Display), width + padding, y, width - padding * 2);
}
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
this.drawItemDarkRect(x, y, width, traitHeight);
this.drawItemDarkRect(width, y, width, traitHeight);
if (traitType1.Visible) {
this.drawTextEx(traitSet1.Description, padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(traitSet2.Description, width + padding, y, width - padding * 2);
}
this.resetDescriptionFontSize();
this.resetFontSettings();
y += traitHeight;
}
const topY = y;
// Prepare Elemental Data
const elementCol1 = this.getElementIDsCol1();
const elementCol2 = this.getElementIDsCol2();
let columnData;
if (elementCol2.length > 0) {
columnData = ['Resist','Resist','Bonus','Bonus'];
} else {
columnData = ['Resist','Bonus'];
}
const dataRows = Math.max(elementCol1.length, elementCol2.length, 1);
const dataCols = columnData.length;
// Draw Elemental Data
this.drawItemDarkRect(width * 0, y, width, lineHeight, 2);
this.drawItemDarkRect(width * 1, y, width, lineHeight, 2);
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.statusMenuDmgReceive, width * 0, y, width, 'center');
this.drawText(TextManager.statusMenuDmgDealt, width * 1, y, width, 'center');
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
const smallLineHeight = this.textSizeEx(' ').height;
// Draw Elemental Table
for (let i = 0; i < dataRows; i++) {
for (let j = 0; j < dataCols; j++) {
// Draw Dark Rect
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, smallLineHeight);
// Draw Element Name
let elementID = elementCol1[i];
if (dataCols === 4) {
elementID = (j % 2 === 0) ? elementCol1[i] : elementCol2[i];
}
if (!elementID) continue;
const name = $dataSystem.elements[elementID];
this.drawTextEx(name, colWidth * (j + 1/3) + padding, y, colWidth*2/3);
const type = columnData[j];
// Draw Resistance Data
this.resetFontSettings();
let drawText = '';
if (type === 'Resist') {
const rate = actor.elementRate(elementID);
const flippedRate = (rate - 1) * -1;
this.changeTextColor(ColorManager.paramchangeTextColor(flippedRate));
drawText = '%1%'.format(Math.round(flippedRate * 100));
if (actor.getAbsorbedElements().includes(elementID)) {
this.changeTextColor(ColorManager.powerUpColor());
drawText = TextManager.statusMenuDmgAbsorb.format(Math.round(rate * 100));
} else if (rate > 1) {
drawText = '%1'.format(drawText);
} else if (rate <= 1) {
drawText = '+%1'.format(drawText);
}
// Draw Bonus Damage Data
} else if (type === 'Bonus') {
const dealtPlus = actor.getDealtElementPlus(elementID);
const dealtRate = actor.getDealtElementRate(elementID);
const dealtFlat = actor.getDealtElementFlat(elementID);
const dealt = ((1 + dealtPlus) * dealtRate + dealtFlat) - 1;
this.changeTextColor(ColorManager.paramchangeTextColor(dealt));
drawText = '%1%'.format(Math.round(dealt * 100));
if (dealt >= 0) drawText = '+%1'.format(drawText);
}
// Draw Value
this.contents.drawText(drawText, colWidth * j, y, (colWidth/3) - padding, smallLineHeight, 'right');
}
y += smallLineHeight;
}
// Closing the Table
for (let j = 0; j < dataCols; j++) {
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, this.innerHeight - y);
}
We're not using the "Traits" tab on the above screen for anything important, and we could rename it and change the code to put basically whatever we want in there. So, to that end, maybe we could put state info there instead. Like, is there a way to copy but modify the above code for the two elemental columns (resistance + bonus damage) and turn them into something that displays the same kind of information but for states, with two state columns (state resistance + chance to inflict state?) Something that would show up if, say wearing a ring that adds a +5% Sleep and +5% Deep Sleep chance to their outgoing attacks and makes them +25% more resistant to Silence on incoming ones, at the cost of being more vulnerable to Fear (-50% resistance or so.) A screen that can just compile and display all total resistances and infliction chances for whichever select states we're including here, like the elements screen above, possibly even using the same code but just getting it to point at different stats/parameters instead.
We could make custom stats/parameters if the code needs something to point at to display them (I suppose "Actor's innate chance to inflict Poison" isn't really a thing if the game is used to that being calculated per Skill instead) but then we'd need to know how to make those stats/parameters actually affect the things they're supposed to be affecting.
Thank you so much for all your help, as always! :yhappy:
