@DecastarDaDumy Are you using the correct engine? The question was asked for RPG Maker MZ and your profile says you use MV. MZ and MV do not use the same code for windows.
JavaScript questions that don't deserve their own thread
Javascript/Plugin SupportProbably a stupid question, but is it possible to get the length for variable?
For example, if I set variable 1 to "Charge" could run a code to return "6"?
I tried $gameVariables.Value(x).length but it didn't seem work. (obviously with X replacing the variable number)
For example, if I set variable 1 to "Charge" could run a code to return "6"?
I tried $gameVariables.Value(x).length but it didn't seem work. (obviously with X replacing the variable number)
lowercase v in value.
also "charge" would be 6
@ATT_Turan oohhhh. i'm sorry, i forgot there were differences in js syntax between engines 😅
is there an mv alternative then?
is there an mv alternative then?
It's not that there are differences in JavaScript syntax - the actual code for the two games is different in portions.
Code:
Window.prototype._updateCursor = function() {
var cursorOpacity = this.contentsOpacity;
this._windowCursorSprite.alpha = cursorOpacity / 255;
this._windowCursorSprite.visible = this.isOpen();
};
Is there a script call or somefin to change a specific map's tileset during a cutscene? I have variations of tilesets with different palettes, and I wanted to change the tileset briefly during a cutscene.
$gameMap.changeTileset(tilesetId);In general I recommend this spreadsheet for figuring out what script calls are needed to replicate an event command.
Though if it's a cutscene, wouldn't it be easier to just use the "Change tileset" event command?
Thank you so much! Yep, you are right, I forgot that command existed.
ohh. tysm. i don't have much js knowledge; the only thing i could code is lua and even that's just barely.
Using yanflys plugins is there a way to make a skill that increases the number of hits based on how much tp they have for example if their tp is above 25 the skill hits 2 times if the their tp is above 50 skill hits 3 times basically an extra hit per 25 TP, is there a way to achieve this effect ?
use the action sequences plugin to add more action effects if the user has the tp
i wonder if there's a way to display the skill user's parameter in message boxes and skill descs. tried calling for actor 2's atk value and it doesn't seem to work ;w;
i use this plugin for that, but theres other plugins too that lets you run code to be eval'd within text boxes
Plus, for the given example, you only need to put the value into a variable then use the default escape code to display the variable.
How do I get the value of the full incoming damage of an attack to an actor before the damage is dealt? I'm trying to make equipment that reduces the damage to 0 if the damage is less than 20% of an actor's Max HP.
what are you trying to do?
you can grab incoming damage with Turan's eval tags or visustella's battle core, but without knowing what youre trying to do with it theres no knowing if theyll do what you want
you can grab incoming damage with Turan's eval tags or visustella's battle core, but without knowing what youre trying to do with it theres no knowing if theyll do what you want
I want to reduce the incoming damage to 0 if the damage is less than 20% of an actor's Max HP.
What I'm trying right now is the notetag <JS Pre-Damage as Target> but I have no idea what object I have to get.
huh. the VS battle core page doesnt mention it, but try using
there should be a "value" variable that applies to the damage dealt
Code:
if (value < target.mhp/5)
value = 0;
Didn't know it was this simple. Thanks for this!
Original thread: https://forums.rpgmakerweb.com/threads/javascript-questions-that-dont-deserve-their-own-thread.46341/