JavaScript questions that don't deserve their own thread

worshipme

Veteran
Veteran
Joined
Jun 14, 2016
Messages
34
Reaction score
5
First Language
Filipino
Primarily Uses
RMMV
Hello again guys. I'm back and brought another problem beyond my knowledge.

Yanfly's Cleric Stance is a buff that makes the user deal more magical damage at the expense of lessening his/her healing capabilities.

My problem is that my heals has an element called "HEAL" (so I can buff or debuff them anytime I want) and has a damage formula. Can we go around the Cleric Stance's code and make my magic damages deal more and the "HEAL" element be debuffed? I really am out of ideas >_<

Yanfly's Cleric Stance (state):
//Cleric Stance (Yanfly)
<Custom Confirm Effect>
if (this.isMagical() && this.isHpEffect() && value > 0) {
value = Math.ceil(value * 1.50);
} else if (this.isMagical() && this.isHpEffect() && value < 0) {
value = Math.ceil(value * 0.50);
}
</Custom Confirm Effect>

TY in advance! :)
 

IAmJakeSauvage

Veteran
Veteran
Joined
Dec 4, 2015
Messages
418
Reaction score
671
First Language
English
Primarily Uses
RMMV
Hey guys,

I'm still struggling with this - in my status menu the bottom line is cut off - is there a way to either change the padding for "Parameters/Experience" or to remove them entirely so that the bottom line will show? :)
 

Attachments

  • status.png
    status.png
    412.1 KB · Views: 10

AsuranFish

Veteran
Veteran
Joined
Jan 3, 2017
Messages
121
Reaction score
88
First Language
English
Primarily Uses
Is it possible to change a skill's name and icon if certain conditions are met?

Thanks!
 
Joined
Jun 9, 2017
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'd like to execute movement commands in a plugin that I am building, but I am having trouble because it looks like the plugin execution happens outside of the regular movement loop. I end up with behavior where the move commands are executed very quickly in sequence without waiting for previous movement commands to resolve.

In my latest iteration, I am trying to control movement by using setMoveRoute or forceMoveRoute, but this seems to have the same limitations as executing the movement commands directly.

Code:
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_pluginCommand.call(this, command, args);
    if (command === 'RandomMovement') {
      var gc = Game_Character;
      character = this.character();
      moveRoute = {
        list:[
          {code: gc.ROUTE_TURN_RANDOM, indent: null},
          {}
        ],
        repeat: true,
        skippable: true,
        wait: true
      };
      character.forceMoveRoute(moveRoute);
    }
  };

When I run character.setMoveRoute(moveRoute), nothing happens
When I run character.forceMoveRoute(moveRoute), the event turns randomly very, very quickly.

I have a similar problem if I call character.turnRandom(); directly

How can I execute a movement command and then instruct the plugin to wait until the movement is completed before executing additional code?

If it is helpful, the project is here: https://github.com/wbhumphrey/special-tactics/blob/master/js/plugins/RandomMovement.js
 
Last edited:

yuyu!

The Hero of Rhyme
Member
Joined
Feb 19, 2014
Messages
25
Reaction score
13
* EDIT - SOLVED (already) *
OK, I'm dumb. I was calling the scene via SceneManager.goto, instead of SceneManager.push. Can't pop what hasn't been pushed!

...Carry on. ;)

* END EDIT *

popScene() closes my game ??

Trying to create my own custom scene (so far, so good). However, my cancel handler (which triggers popScene) keeps closing my game, instead of simply returning to Scene_Map. Any clues? I'm guessing the game is closing Scene_Map instead of my custom scene, but I'm not sure why it would do that. :(

Code:
    function Scene_CustomShop() {
        this.initialize.apply(this, arguments);
    }

    Scene_CustomShop.prototype = Object.create(Scene_MenuBase.prototype);
    Scene_CustomShop.prototype.constructor = Scene_CustomShop;

    Scene_CustomShop.prototype.initialize = function() {
        Scene_MenuBase.prototype.initialize.call(this);
    };

    Scene_CustomShop.prototype.create = function() {
        Scene_MenuBase.prototype.create.call(this);
        this.createGoldWindow();
        this.createDummyWindow();
        this.createListWindow();
        this.createBuyConfirmMenu();
    };

    Scene_CustomShop.prototype.createGoldWindow = function() {
        //this._goldWindow = new Window_Gold(0, this._helpWindow.height);
        this._goldWindow = new Window_Gold(0, 0);
        this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;
        // Add window
        this.addWindow(this._goldWindow);
    };

    Scene_CustomShop.prototype.createDummyWindow = function() {
        var wy = this._goldWindow.y + this._goldWindow.height;
        var wh = Graphics.boxHeight - wy;
        this._dummyWindow = new Window_Base(0, wy, Graphics.boxWidth, wh);
        this.addWindow(this._dummyWindow);
    };

    Scene_CustomShop.prototype.createListWindow = function() {
        // Create window
        var wy = this._goldWindow.height;
        var ww = Graphics.boxWidth;
        var wh = Graphics.boxHeight - wy;
        this._csListWindow = new Window_CustomShop(0, wy, ww, wh);
        // Set handlers
           this._csListWindow.setHandler('ok',     this.onBuyOK.bind(this));
        this._csListWindow.setHandler('cancel', this.popScene.bind(this));
        // Add window
        this.addWindow(this._csListWindow);
        // Activate window
        this._csListWindow.activate();
        this._csListWindow.select(0);
    };

    Scene_CustomShop.prototype.createBuyConfirmMenu = function() {
        var wy = this._dummyWindow.y;
        this._confirmBuyWindow = new Window_CSBuyConfirm(0, wy);
        this._confirmBuyWindow.hide();
        this.addWindow(this._confirmBuyWindow);
    };

    Scene_CustomShop.prototype.start = function() {
        Scene_MenuBase.prototype.start.call(this);
    };

    Scene_CustomShop.prototype.update = function() {
        Scene_MenuBase.prototype.update.call(this);
    };

    Scene_CustomShop.prototype.onBuyOK = function() {
        this._item = this._csListWindow.item();
        this._csListWindow.hide();
        this._confirmBuyWindow.setup(this._item[0], this._item[1]);
        this._confirmBuyWindow.show();
        this._confirmBuyWindow.activate();
    };
 
Last edited:

Snuffy

Veteran
Veteran
Joined
Oct 28, 2015
Messages
32
Reaction score
28
First Language
English
NEW QUESTION (that doesn't deserve its own thread)

What is the best way to have a side view battle system (currently using YED Sideview Battlers) where the actor has a walk animation, but that animation is only used when the actor is moving? I'm almost at the point of putting my walk animation in another sprite slot, and then specifically calling for it in Yanfly's Action sequences before I tell the actor to move. I just don't get it, why would the engine use the "walk" animation once the actor is standing still?
 

worshipme

Veteran
Veteran
Joined
Jun 14, 2016
Messages
34
Reaction score
5
First Language
Filipino
Primarily Uses
RMMV
Hi again guys!

I have a passive state that will temporarily give +1 bonus DEF to the affected battler each time he takes physical damage but I want to erase all bonuses given after every battle.

<Custom Respond Effect>
if (value > 0 && this.isPhysical()) {
target._paramPlus[3] += 1;
}
</Custom Respond Effect>

<Custom Turn End Effect>
if ($gameParty.performEscape() || $gameTroop.aliveMembers().length == 0 || $gameParty.aliveMembers().length == 0) {
target.clearParamPlus();
}
</Custom Turn End Effect>

Erasing the bonuses seems to work if I clear all the troops and win the battle but if the party has managed to escape, the bonuses will stay and becomes permanent.

The words highlighted in red doesn't work. What should I replace there to remove all the bonuses after every battle even if the party manages to escape?

Thank you very much in advance.
 

KillerK70

Villager
Member
Joined
Oct 25, 2015
Messages
12
Reaction score
0
First Language
English
Edit: I figured it out. In that case, anyone know a list of javascript terms/commands?
 
Last edited:

TheChilliPL

Villager
Member
Joined
Dec 6, 2015
Messages
23
Reaction score
3
First Language
Polski [Polish]
Is there any Window_Base method to clear text if I want to change it?
 

LTN Games

Indie Studio
Veteran
Joined
Jun 25, 2015
Messages
708
Reaction score
639
First Language
English
Primarily Uses
RMMV
@TheChilliPL it's usually done in your refresh() method. It won't clear just text but everything within the window itself. This should do the trick.
PHP:
this.contents.clear()
 

TheChilliPL

Villager
Member
Joined
Dec 6, 2015
Messages
23
Reaction score
3
First Language
Polski [Polish]
@TheChilliPL it's usually done in your refresh() method. It won't clear just text but everything within the window itself. This should do the trick.
PHP:
this.contents.clear()
Oh, thanks ;)
By the way is it possible to make two windows with common border (Window_Base with text + Window_Command for selecting)
 

AFletch88

Veteran
Veteran
Joined
Jul 1, 2017
Messages
38
Reaction score
2
First Language
English
Primarily Uses
RMMV
How could I check say for example I have an exp system the the max Exp increases to the value of the parameter.
Code:
<Custom Deselect Effect>

var paramId = 6;

target._agiExp = target._agiExp || 0;

var maxAgiExp = //the current value of the actor's Agility Value\\

if (target.result().missed || target.result().evaded) {

var agiExpGain = 1;

target._agiExp += agiExpGain;

if (target._agiExp >= maxAgiExp) {

var agiGain = Math.floor((Math.random() * 3) + 1);;

target.addParam(paramId, agiGain);

target.startAnimation(123);

target._agiExp = 0;

}

}

</Custom Deselect Effect>

The part // \\ is what I'm trying to get to work. I've tried actor.paramId but that didn't seem to work, any help would be great.
 

Teague

Villager
Member
Joined
Jul 8, 2017
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMMV
Which game function is called when an actor uses a skill in RPG Maker MV? I want to conditionally switch what weapon is used for the skill.
 

Teague

Villager
Member
Joined
Jul 8, 2017
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMMV
@waynee95
This is for a plugin I'm making, intended to fix the issue where actors only ever use their first weapon by default even if they have multiple weapon slots. It's almost there, I just gotta make sure I'm applying the changes in the right function so it's a little more dynamic than just 'Actor uses their strongest available weapon to attack'.

A notetag for another plugin is not the most helpful answer in this situation.

Edit: Plus, that doesn't change the internal variable my plugin adds to keep track of which weapon to use.
 
Last edited:

Nantas

- Game developer -
Veteran
Joined
Jan 7, 2017
Messages
209
Reaction score
140
First Language
French
Primarily Uses
RMMV
I need a little javascript requirement.
It's for an action sequence.

I want the javascript "if" check if the skill's target is the user of the target.

Thank you in advance !


EDIT : I have found myself, even if I don't know any javascript xD

this is the eval :
if (target.name() === user.name())
else
 
Last edited:

AsuranFish

Veteran
Veteran
Joined
Jan 3, 2017
Messages
121
Reaction score
88
First Language
English
Primarily Uses
Hi all, was hoping I could get some help w/ this issue!

I have an ability that inflicts a state and calls a common event to change a party member's battler if the state is inflicted, similar to the Toad spell from Final Fantasy. I'm handling this by creating a conditional for each party member to check if they're under the state, and changing their actor images if so.

The trouble comes with changing the image back. Because I'm using custom images for each and every job class, I'd have a ton of conditionals to create to get the proper images set back up once the state is removed. Seems it would be very easy to overlook something in this process as well.

Is there a better way to swap an actor's images back and forth other than having a ton of conditional statements?
 

BloodletterQ

Chaotic Neutral Assassin
Veteran
Joined
Aug 15, 2012
Messages
1,540
Reaction score
1,189
First Language
English
Primarily Uses
N/A
I'm curious to know if there's a way to modify the space between characters in certain windows, name so that I can have a two-part icon within text.
 

D.L. Yomegami

Sanely Insane
Veteran
Joined
Jan 22, 2017
Messages
194
Reaction score
253
First Language
English
Primarily Uses
RMMZ
Never mind; I made my own thread for this question.
 
Last edited:

Johnboy

Veteran
Veteran
Joined
Jan 13, 2016
Messages
353
Reaction score
128
First Language
English
Primarily Uses
@AsuranFish Have you tried Victor's State Graphics Plugin? You can specify in the actor noteboxes which characterset to use with which state. You can even change faces and map sprites if you wanted to go the extra mile.

If you are using Yanfly plugins, place the Victor plugin below the Yanfly ones and it will work. I use it in my game.
 

Latest Threads

Latest Posts

Latest Profile Posts

New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.
Today the 2nd part of the RPGMakergame "A Thief's voyage" came out.


Go show DutchPowerCreations some love.
love it when you forget to put a certain thing in the movement route and suddenly a character starts spinning at 10000 rpm
I'm sorry. I have a bad feeling I've been manic the past couple of days. Antidepressants have only been making things worse somehow -- too drowsy to function, followed by insomnia. Why not making me go crazy to boot?

Forum statistics

Threads
116,992
Messages
1,103,644
Members
152,885
Latest member
cheetar
Top