That is a Control Variables event command, not a script call. Sorry about that - something I had read in a previous post made me think you wanted to use the event command.
If you want to do it all inside a script, do this:
$gameVariables.setValue(15, $gameVariables.value(15) + 'X')
It will be faster/better than calling a common event, if everything else is happening via script.
JavaScript questions that don't deserve their own thread
● ARCHIVED · READ-ONLY
-
-
The following forces an action in battle:
$gameParty.members()[0].forceAction(1, 1);
BattleManager.forceAction($gameParty.members()[0]);
BattleManager.processForcedAction();
But what can I call to then end the player's turn and go to the enemy's turn?
(I have a button for Attack which on pressed forces the attack action.)
I'd recommend mapping out how the battle system flows, and look how to change and restructure it to support your ideas.
I know it's a lot more work than a simple patch that may work. On the long run, however, it'll lead to a more robust and manageable battle-system. Patchwork battle systems really become a huge PITA to maintain.
*hugs*
- Zeriab -
I'm trying to make a plugin that grants the player additional stats to use in damage formulas. Everything works fine except for one tiny little issue. The formulas aren't working. Right now, all the stats are set to calculate using the formula "base + ((this.level * mod) / 128)", where base and mod are values set in the settings.
Again for all stats base is set at 20 and mod is set at 60. By using the formula the answer (using a calculator) is 20.46875 (floored to get 20). However, MV is somehow calculating the value to be 200.46875, which makes no mathematical sense whatsoever. To check, I also tried the formula ((this.level * mod) / 128) + base" which gave me an answer of 0.46875. What am I doing wrong?
Just for reference here's the code itself:
Game_BattlerBase.prototype.xstatEval = function(statId) {
var formula = Crystal.XStats[statId][1];
var base = Crystal.XStats[statId][2];
var mod = Crystal.XStats[statId][3];
return eval(formula);
};
Edit: Nevermind. I accidently set base and mod to strings instead of numbers and it threw off the game. Feel free to ignore this question. -
Hello everyone,
I would like to know how i can store in a variable the common event used for a skill. -
How could I set a picture to fadeout in the middle of a script?
So this is my code
if($gameVariables.value(16) == 1){$gameScreen.showPicture(10, "Note1", 1, 782, 435, 30, 30, 255, 0);}
but it's in the middle of a nested conditional, so I don't think a wait command will work (I want the player to still be able to do actions the whole time.)
I want the picture to appear, remain for about a second and then fade out over the course of another second. How could I do this?
EDIT: Solved. I used the movePicture script call and changed the transparency. -
Apologies for the double post.
With this code:
$gameMessage.add("Hey");
$gameMessage.add("How is it");
$gameMessage.add("Going?");
the game displays it all in one message box as Hey How is it Going?
How can I get it (within the same script call) to display it as 3 separate message boxes? -
Does anyone know if it's possible for a note tag on a skill to reference the skill Id of the skill the note tag is on?
I'm trying to set up a custom Mp cost which uses the default MpCost of the skill in the formula, but can't find a way to reference this value from inside the note box. The less changes I have to make when copy-pasting it to every skill not box, the better, so if I could find a way to reference the cost without using $dataSkills[ID].mpCost it would be ideal, as otherwise I have to change that ID number for ever skill.
Thanks.
edit: I derped, I can use 'cost' to get this value without the skillId of the skill being used. -
@Songsmith you need to add a wait so the message can be displayed before adding the next line. However, how you do that depends on the context of your script.
-
@Songsmith you need to add a wait so the message can be displayed before adding the next line. However, how you do that depends on the context of your script.
I tried adding a wait script call (gotten from the master script call list on this site) and got a "gameInterpreter is not defined" error message.
These messages are are inside of a nested conditional in a script call. -
That's right - I said how you do it depends on your context. There is no such thing as gameInterpreter.
If you're doing it inside a script call, is there a reason you can't just do it with event commands? -
Kind of, yes, because it's in an "if" statement that checks for keyboard input that isn't natively supported.
i managed to solve my current issue by just having it turn on a switch and then running regular text event commands when that switch is turned on.
but I'd still like to know if there is another way to solve this. -
If you're just saying "if key X pressed, do this stuff" you don't need a script call to do it. The Conditional Branch command has a script entry area where you can do the test, and then you can add the messages as Show Text commands.
-
If you're just saying "if key X pressed, do this stuff" you don't need a script call to do it. The Conditional Branch command has a script entry area where you can do the test, and then you can add the messages as Show Text commands.
I didn't know that! Thank you. -
Is there a way to modify the battle scene so that the enemy's attack will be executed together with the player's turn? For example, I finished selecting my turn and when it executes, the enemy's do too.
-
The question may have been asked already but is there official (or unofficial) support for ES6's Javascript in RPG Maker MV ?
-
Hi there, just a little question.
I have create an HUD with pictures and i want make it trasparent when character is under it, it's on the top right corner in some map the character can walk under that.
How can i do that? -
You'd need to do a couple of tests to see the player's screen x and screen y values, and if the screen x is greater than your hud's x and the screen y is less than your hud's y (at the bottom), adjust the transparency. You might have to play around with the numbers a bit, as I'm not sure if screen x and y is based on the sprite's top left corner or bottom middle position.
-
I think I've seen this somewhere, but I've spent the whole day searching the internet and the Script Call list, but I still can't find it.
I need a script call to check which actor the player / party leader is.
I need it to make a conditional branch, but all I can find is the condition and the script for 'if actor x is in party'.
My problem with this is at there are moments in the game where the two actors I want to use would both be in the party, but I still want it to show the first branch if the first actor is the leader. -
Control Variables > Game Data > Party Member #1's Actor Id
will put the leader's actor id into a variable, then you just use the variable in the conditional branch.
Don't need to do any scripting for this at all :) -
Hello, I want to ask a question. Maybe it´s answered ort is easy to know:
When you dye the screen of the game, entering in a battle, the screen is still dyed, and I would want to remove it in the battle.
What do I have to do? A common event putting a conditional where if any enemy appears, the screen comes back to normal? Or is there a plugin?