JavaScript questions that don't deserve their own thread

Otacon6530

Veteran
Veteran
Joined
Apr 12, 2022
Messages
32
Reaction score
20
First Language
English
Primarily Uses
RMMV
Any documentation on how the structure of the map json in RPG Maker MZ?

Specifically, I want to manipulate the data attribute within the Map###.json file.

Here are my observations that I am hoping someone can confirm:
  1. Data is always a massive single dimension array.
  2. The amount of values in the array will be Width*Height*6.
  3. The data array is divided into 6 layers
    1. Layer 1 - will be first [width*height] values
    2. Layer 2 - will be second [width*height] values
    3. Layer 3 - will be third[width*height] values
    4. Layer 4 - will be fourth [width*height] values
    5. Shadow Layer - will be fifth[width*height] values
    6. Region Layer - will be sixth[width*height] values
  4. Within each layer the values represent the tile number within a tile set.
  5. The array for each layer will be used to populate the map from the upper left to right then go to the next line and repeats.
example: *Numbers are the array position for the first layer and the map only has 9 tiles.

0 1 2
3 4 5
6 7 8
 

alltheyuriz

The one the only Cat Dad
Veteran
Joined
Sep 18, 2020
Messages
750
Reaction score
541
First Language
English
Primarily Uses
RMMZ
hi i was wondering what the push.scene for Visutella's Quest system was im trying to make an event that involves the script pulling it up
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
75
Reaction score
11
First Language
French
Primarily Uses
Hello.

I'm trying to get the correct script to evaluate the TP gain of an item from the Database. Any help on that? Did not see it in the master script list.

Cheers.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,528
Reaction score
2,890
First Language
English
Primarily Uses
RMMV
I'm trying to get the correct script to evaluate the TP gain of an item from the Database. Any help on that? Did not see it in the master script list.
Where are you trying to access it? The short answer is it's the member variable tpgain - how exactly you access that will depend on where you're doing it and what code objects you're using.

One example would be $dataItems[13].tpgain
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
75
Reaction score
11
First Language
French
Primarily Uses
@ATT_Turan Thanks that's what I needed. I'm using it in a basic conditional branch to get the value directly from the item database.

Edit : @ATT_Turan I think I get what you said now, I can't access it in a script to set a variable to the value of an item TP Gain.
I'm using the script in a common event, called from an event in parallel.

This does not work :
Code:
$gameVariables.setValue(1185, $dataItems[$gameVariables.value(1043)].tpgain);
But this does :
Code:
$gameVariables.setValue(1042, $dataItems[$gameVariables.value(1043)].name);

Any help?

Edit 2 : Found the problem, lack of capitalization. It's tp.Gain and not tp.gain
 
Last edited:

Otacon6530

Veteran
Veteran
Joined
Apr 12, 2022
Messages
32
Reaction score
20
First Language
English
Primarily Uses
RMMV
Is this the best way to add code to existing methods? I am worried this would be intolerant of other plugins.

JavaScript:
Graphics.FPSCounter.prototype._createElements2 = Graphics.FPSCounter.prototype._createElements;

    Graphics.FPSCounter.prototype._createElements = function() {

        this._createElements2();

        Jams_Debugger.Manager._boxDiv = this._boxDiv;

    };
 

Fionn23

Veteran
Veteran
Joined
Dec 11, 2021
Messages
79
Reaction score
39
First Language
Filipino
Primarily Uses
RMMZ
How to code this in javascript?

Screenshot 2022-04-27 173601.jpg

Update: Nevermind. Found it.
 
Last edited:

AlphaOmega

Alpha Ωmega Graphics
Veteran
Joined
Jan 16, 2022
Messages
71
Reaction score
54
First Language
English
Primarily Uses
RMMV
So ive been looking but maybe im just too impatient to find it.
I am just in need of the script call for when an item is used.
I am using it in a conditional branch that is based on if the item was used...
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,528
Reaction score
2,890
First Language
English
Primarily Uses
RMMV
So ive been looking but maybe im just too impatient to find it.
I am just in need of the script call for when an item is used.
I am using it in a conditional branch that is based on if the item was used...
I can't fathom what you're trying to do based on your post, but the function to use an item is...useItem().

Game_Battler.prototype.useItem in rpg_objects
 

Boonty

Veteran
Veteran
Joined
Oct 10, 2018
Messages
147
Reaction score
55
First Language
French
Primarily Uses
RMMV
Hello all,

I am currently working on my battle HUD and I would like to add a window with the parameters of the active battler

Do you know what plugin can I use ?

I am on RPG MV.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,528
Reaction score
2,890
First Language
English
Primarily Uses
RMMV
I am currently working on my battle HUD and I would like to add a window with the parameters of the active battler

Do you know what plugin can I use ?
This would really be better as a new thread in Plugin Requests, as it doesn't ask anything about using JavaScript :wink:

But there are a number of plugins and tools for helping you to make HUDs and windows. SRD's HUD Maker and Luna Engine come to mind.
 

AlphaOmega

Alpha Ωmega Graphics
Veteran
Joined
Jan 16, 2022
Messages
71
Reaction score
54
First Language
English
Primarily Uses
RMMV
I can't fathom what you're trying to do based on your post, but the function to use an item is...useItem().

Game_Battler.prototype.useItem in rpg_objects
I thank you for your reply, and that helped thanks! It may not have made sense to you, but it was what i needed ;)


So that brings me to the other thing i am trying to find
in implementing subjugate from Yanfly tips and tricks and having issues figuring out where the debuffs are getting the icons assigned from
basicly where is it in the system telling which icons to use....

// Add DEF buff to user
user.addBuff(3, turns);
// Add MDF buff to user
user.addBuff(5, turns);

i would just like to change the icon IDs assigned to them since i have a full custom icon sheet already made... and this was a spur of the moment addin.... but not sure where to look to do so any help is appreciated!!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,528
Reaction score
2,890
First Language
English
Primarily Uses
RMMV
where is it in the system telling which icons to use....
 

AlphaOmega

Alpha Ωmega Graphics
Veteran
Joined
Jan 16, 2022
Messages
71
Reaction score
54
First Language
English
Primarily Uses
RMMV
THANK YOU! I dont know how i missed it! I must not have been using the right keywords i guess... im usually really good at searching >.<
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,759
Reaction score
2,309
First Language
English
Primarily Uses
RMMV
Quick question: Is there any reason I should use one of these over the other?
(a.equips()[1] ? 2 : 3) vs (!a.equips()[1] ? 3 : 2)
I'm basically trying to check whether the 2nd weapon slot is empty or not.
 

Raizen

Veteran
Veteran
Joined
Oct 24, 2012
Messages
425
Reaction score
752
First Language
Portuguese
Primarily Uses
RMMV
Quick question: Is there any reason I should use one of these over the other?
(a.equips()[1] ? 2 : 3) vs (!a.equips()[1] ? 3 : 2)
I'm basically trying to check whether the 2nd weapon slot is empty or not.
if you can make a syntax without !, it will perform better since ! is an operator, so it does the same thing as the first, but it has extra work changing the boolean value of a.equips()[1].

Its not like something that will visibly effect your game, but for good practices try always to code as the first one :ysrs:
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,303
Reaction score
1,052
First Language
French
If I want to include the percentage of CNT in a damage formula, do I have to do like this?

100*a.cnt
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,528
Reaction score
2,890
First Language
English
Primarily Uses
RMMV
If I want to include the percentage of CNT in a damage formula, do I have to do like this?

100*a.cnt
I'm not sure that's a JavaScript question so much as basic math, but yes :stickytongue: You express a decimal as a percentage by multiplying by 100.

I think the JavaScript portion of the question is...why would you want to do that in a damage formula? If you're using it to express a percentage of something, you'd do that by using the decimal, which the parameter is already formatted for.
 

boikish

Always trying to help :)
Veteran
Joined
Sep 8, 2016
Messages
175
Reaction score
50
First Language
English
Primarily Uses
N/A
Any script that clears the current balloon from the player?
 

Latest Threads

Latest Posts

Latest Profile Posts

The main game of my trilo/saga 50%OFF on Steam..... its now or never more
I swap between Ace and MZ so I can stay fresh but - what do you mean you can use subfolders in the plugin's folder for easier organization!?
Did some new music again, praise be. To the next song!
Watch Studio Blue play Numina by starlit in our latest RPG Maker Games Critique stream starting NOW!

Forum statistics

Threads
123,141
Messages
1,154,284
Members
161,478
Latest member
mrlimbs
Top