JavaScript questions that don't deserve their own thread

Syngeno

Villager
Member
Joined
Jan 28, 2017
Messages
24
Reaction score
8
First Language
English
Primarily Uses
RMMV
With yanfly's grid-free doodads, is there a way to copy doodad data from one ap to another? I have a copy of a map for a cut scene but I'd rather not have to set each and every single doodad again XD thanks
 

artlis

Warper
Member
Joined
Dec 31, 2012
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Hey, I'm having a strange issue I don't understand where hooking into a Game_Enemy's setup function is giving me errors even though I don't change anything.

Code:
var Game_Enemy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function() {
  Game_Enemy_setup.call(this);
};

that gives me

Code:
TypeError: Cannot read property 'params' of undefined
    at Game_Enemy.paramBase (file:///D:/Games/playground/js/rpg_objects.js:4343:24)
    at Game_Enemy.Game_BattlerBase.param (file:///D:/Games/playground/js/rpg_objects.js:2449:22)
    at Game_Enemy.Object.defineProperties.mhp.get (file:///D:/Games/playground/js/rpg_objects.js:2131:42)
    at Game_Enemy.Game_BattlerBase.recoverAll (file:///D:/Games/playground/js/rpg_objects.js:2619:20)
    at Game_Enemy.setup (file:///D:/Games/playground/js/rpg_objects.js:4307:10)
    at Game_Enemy.setup (file:///D:/Games/playground/js/plugins/ART_AggroSystem.js:78:20)
    at Game_Enemy.initialize (file:///D:/Games/playground/js/rpg_objects.js:4291:10)
    at new Game_Enemy (file:///D:/Games/playground/js/rpg_objects.js:4283:21)
    at Game_Troop.<anonymous> (file:///D:/Games/playground/js/rpg_objects.js:5255:25)
    at Array.forEach (native)

in the debugger.

My goal is to initialize a new variable to work with in Game_Enemy, so any help with that would be appreciated.



edit:
ugh figured it out right as i posted, forgot to pass the arguments, if I could delete this post i would.
 
Last edited:

Rujirei

Warper
Member
Joined
Feb 13, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
N/A
Bit of a noobie question (maybe?)

I'm trying to give my item descriptions more flavour text (think Dark Souls):
7a6d31e70e.jpg

I've rearranged the item menu to compensate for this as shown above, but now I need to work out how to put more text into the help window. In addition (But it's not required), I'd like to have a larger image displayed above the text representing said item. I've heard about using Notes to replace the item description space but I have no idea how to. Sorry if this is a more complicated question than this page warrants.

UPDATE: I've figured out how to use the notes by myself, the only issue now is displaying the image.
 
Last edited:
Joined
Nov 5, 2016
Messages
69
Reaction score
6
First Language
English
Primarily Uses
wait i realized the answer to my original question seconds after i posted this,
Where's The Delete Button!!!

please don't pay any attention to this post, the very fact that i had to ask is very embarassing
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Is it possible for the system to execute a plugin command/script call/common event every time the menu is accessed and closed?

Besides having a global parallel event checking for when the menu is opened/closed to execute those actions.

Edit: I tried this:
Code:
var _Scene_Map_callMenu = Scene_Map.prototype.callMenu;
Scene_Map.prototype.callMenu = function() {
    _Scene_Map_callMenu.call(this);
    $gameTemp.reserveCommonEvent(215);
};

and it executes the common event each time I call the menu.
(I just tested incrementing a variable so far)

Are there any risks behind what I tried?

Edit 2: Oh, it "reserves" the common event. As in, it executes immediately after leaving the menu. Not at the same time of entering the menu :/
 
Last edited:

AsuranFish

Veteran
Veteran
Joined
Jan 3, 2017
Messages
121
Reaction score
88
First Language
English
Primarily Uses
I'm not experienced with JavaScript - but I do have a general idea of how it works. I want to come up with a script for a specific weapon in my game.

Basically, the idea is the weapon changes colors depending on the user's state, probably using Yanfly's Weapon Animation Plug in...

The general idea is... something like...

Code:
if user.state = Enfire
then <Weapon Image: Fire Sword>

elseif user.state = Enblizzard
then <Weapon Image: Ice Sword>

else
<Weapon Image: Steel Sword>

Can something like this go in the Note section of the weapon, and if so - what's the syntax/structure I should be using? I get the logic of what I want to do, but don't really know how to tell the game what to do.

Thanks in advance!
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
943
Reaction score
593
First Language
English
Primarily Uses
RMMV
Greetings all. I'm trying to make a state that forces the actor afflicted with it to auto-battle. This is fine on it's own, but I'm running into an issue where an auto-battling actor is capable of using skills that the player wouldn't normally be able to use. Is there a function I can call to get all sTypes an actor is capable of using?

Eg: Actor1 started as a wizard, and had access to Black Magic, and learned some of those skills. At some point Actor1 became a Knight instead, and lost access to the Black Magic sType. If Actor1 becomes an auto-battle actor, he will suddenly be able to use black magic spells again, even though the player has no way to do that.

If I could find a function to list sTypes an actor can use, I could filter the available skills by sType... I think. Any ideas?
 

Ellie Jane

Veteran
Veteran
Joined
Mar 17, 2012
Messages
764
Reaction score
1,519
First Language
English (UK)
Primarily Uses
RMMV
Can you change resolution during gameplay or does it have to be called beforehand? Trying to debug a plugin I'm making but if the answer's as simple as "you can't change resolution during gameplay" that'd be a big help.
 

Pheryus

Villager
Member
Joined
Aug 18, 2015
Messages
19
Reaction score
2
First Language
Portugues
Primarily Uses
Question about windows:
Is there a way to change the z order of the windows? For instance, the window I created using js stays in the front of the standard message system, so some part of the message window and the messages itselfs are cutted off. Is there a way to display the message system on the front of the other windows?
 

Doomguard

Villager
Member
Joined
Jan 9, 2017
Messages
24
Reaction score
1
First Language
English
Primarily Uses
How can I remove the 'Options' command from the main menu? I found a plugin using google, but I don't know if it's available for commercial use or not. Yeah, I'm being a bit paranoic.

Thanks for reading!!!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,779
Reaction score
2,921
First Language
English
Primarily Uses
RMMZ
Having a bit of a confusing issue here. I've created a new instance of Window_Base into which I'm drawing a face graphic, and I put in the call to drawFace and everything and it's all hunky-dory. In the initialize method I call ImageManager.loadFace(filename) to load in the graphic prior to calling the refresh function.

The problem is, when I iniitially call the scene, the window is blank. The face graphic doesn't show up until the second time it's accessed. It works fine if ImageManager.loadFace is called in the console prior to starting the scene, so what's causing it to not show up initially?

Edit: Never mind, I figured it out. I had to call the window's refresh function in the start function of the scene so that the image would be loaded before it displayed.
 
Last edited:

Korokage

Veteran
Veteran
Joined
Mar 1, 2015
Messages
56
Reaction score
9
First Language
English
Primarily Uses
Hello. I was thinking about... very rude boss mechanics and I was wondering if this would be the correct if statement to use if I was, say, checking to see if someone was using a skill to heal someone:

if (this.isSkill() && target.result().hpDamage < 0)

EDIT: I hit post too soon!

Additional information: this code would be in a state on an actor and if the check, uh, checks out then it forces an enemy to do an action.
 

BloodletterQ

Chaotic Neutral Assassin
Veteran
Joined
Aug 15, 2012
Messages
1,540
Reaction score
1,189
First Language
English
Primarily Uses
N/A
How can I get the character whose turn it is to not move up when I'm selecting a command?
 

GoodSelf

Zhu Li! Do the thing!
Veteran
Joined
Jul 23, 2016
Messages
598
Reaction score
1,135
First Language
English
Primarily Uses
RMMV
So I just recently started dabbling with javascript, and I'm trying to make my first plugin. I simply want to adjust the x,y,width, and height of the Select Item Window, and be able to use a plugin command to change those params in game. My issue is, that I don't quite understand how to alias this particular function (Nor really how to alias at all, except for the select few commands I've seen done in videos, etc).
This is the code from MV:
Code:
function Window_EventItem() {
    this.initialize.apply(this, arguments);
}

Window_EventItem.prototype = Object.create(Window_ItemList.prototype);
Window_EventItem.prototype.constructor = Window_EventItem;

Window_EventItem.prototype.initialize = function(messageWindow) {
    this._messageWindow = messageWindow;
    var width = Graphics.boxWidth;
    var height = this.windowHeight();
    Window_ItemList.prototype.initialize.call(this, 0, 0, width, height);
    this.openness = 0;
    this.deactivate();
    this.setHandler('ok',     this.onOk.bind(this));
    this.setHandler('cancel', this.onCancel.bind(this));
};

At first, I tried altering this line: Window_ItemList.prototype.initialize.call(this, 0, 0, width, height);
But no changes showed in my game (probably cause I have no idea what I'm doing =] )

I think I can replace 0, 0, width, height with variables for the plugin command functionality, but I guess I'm looking for some help on aliasing this particular function, and others like it.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
598
First Language
English
Primarily Uses
RMMV
@GoodSelf - I'm not sure if this is what you are looking for.
PHP:
Window_EventItem.prototype.initAlias = Window_EventItem.prototype.initialize;
Window_EventItem.prototype.initialize = function(messageWindow) {
  // do stuff
  this.initAlias.apply(this, arguments);
  // do stuff
};
Window_ItemList.prototype.initAlias = Window_ItemList.prototype.initialize;
Window_ItemList.prototype.initialize = function(x, y, width, height) {
  // do stuff
  this.initAlias.apply(this,arguments);
}

Or better yet (because I now see what , alias Window_ItemList.prototype.initialize the same way.
 
Last edited:

GoodSelf

Zhu Li! Do the thing!
Veteran
Joined
Jul 23, 2016
Messages
598
Reaction score
1,135
First Language
English
Primarily Uses
RMMV
@GoodSelf - I'm not sure if this is what you are looking for.
PHP:
Window_EventItem.prototype.initAlias = Window_EventItem.prototype.initialize;
Window_EventItem.prototype.initialize = function(messageWindow) {
  // do stuff
  this.initAlias.apply(this, arguments);
  // do stuff
};

It's like greek to me. I'll take a look at this code and do some research, thanks!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
598
First Language
English
Primarily Uses
RMMV
I edited my post with a second alias, because after looking at your thing deeper, I wasn't sure which part was plugin and which part was rpg_windows.js

But any function can be aliased like that unless it returns a thing, I think. Then just return its alias apply or call.
 

padr81

Guy whose game is taking too long.
Veteran
Joined
Apr 26, 2013
Messages
739
Reaction score
763
First Language
english
Primarily Uses
N/A
Simple question I think. I want to load a picture/bust for each character instead of their face in the menu screen. Is this a difficult job or pretty straightforward?
 

Latest Threads

Latest Profile Posts

Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension
Sherriff: This permit you're renewing expired two months ago, you haven't been concealing illegally have you?

Me, remembering the sheriff was at the range with me a couple weeks ago and unsure if he'd noted me draw from IWB: I plead the fifth.
Stardew Valley's ConcernedApe announced their new game with a teaser. Hyped. It gave me some ideas to think about for the games I'm going to make as well.
Doing RPG Maker News for 21st October 2021

Forum statistics

Threads
115,985
Messages
1,094,652
Members
151,268
Latest member
RamsesMont
Top