JavaScript questions that don't deserve their own thread

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,166
Reaction score
14,211
First Language
English
Primarily Uses
RMMV
Feel free to ask any questions here that you feel do not warrant their own threads.

If you need help getting a plugin working, please start a NEW thread and include a link to where you downloaded the plugin from.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,548
Reaction score
3,300
First Language
Binary
Primarily Uses
RMMZ
I've been really enjoying JS so far, but I'm not sure if that deserves its own thread or not... Thoughts? :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,166
Reaction score
14,211
First Language
English
Primarily Uses
RMMV
If you want to discuss impressions/thoughts of Javascript, you can either start a thread here or in the Learning Javascript forum (that might be the more appropriate place) and I'll pin it for you.  That's definitely not what we want in THIS thread, as it's not a support question ;)
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
27
First Language
English
Primarily Uses
Hey everyone. In VX Ace, with help from the forum, I made a new window to remove actors from party with a list. The problem now is that the new RM doesn't come with a "script" editor. Am I supposed to go to the "js" folder and edit the base scripts there? It seems a lot harder than before,  all the scenes, windows are together in 1 file now.
 

Jackkel Dragon

Veteran
Veteran
Joined
Oct 15, 2012
Messages
48
Reaction score
24
First Language
English
Primarily Uses
RMMV
Out of curiosity, is there a simple way to create persistent switches/variables that works like Fomar's VXAce script? I'm converting a project that used persistent data, but I've yet to see any persistent data plugins/scripts.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,698
Reaction score
937
First Language
English
Primarily Uses
N/A
Out of curiosity, is there a simple way to create persistent switches/variables that works like Fomar's VXAce script? I'm converting a project that used persistent data, but I've yet to see any persistent data plugins/scripts.
Yes! MV actually makes it easier, but you will still need a plugin. MV has a GlobalData file that is created and used across saves that persistent data could be put in, but like I said, this would need a plugin. I might look into it if I have time later.

 

 


Hey everyone. In VX Ace, with help from the forum, I made a new window to remove actors from party with a list. The problem now is that the new RM doesn't come with a "script" editor. Am I supposed to go to the "js" folder and edit the base scripts there? It seems a lot harder than before,  all the scenes, windows are together in 1 file now.

 
You need to create a new plugin by creating a new JavaScript file (file extension is .js) in the plugins folder. for development sake, it's easier to work with the default classes split up rather than compiled into the large files that they come as.
 
Last edited by a moderator:

Hellreaper

Villager
Member
Joined
Oct 23, 2015
Messages
27
Reaction score
6
First Language
Dutch
Hi guys, I'm a c++ coder in training. If thats how you say it in english.

I wanted to try and get the map to display on the top left corner when you are walking around in town.

I got that working by saving the map as an image and drawing that image on the screen.

Not sure if I need to make a thread for this kind of thing but w/e.

is it possible to get the player location to display on the world map I made.

and if so how? an arrow would be sufficient. just so u can see on what part of the map you are currently located.

Thx
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
170
First Language
English
Primarily Uses
RMMV
Hi guys, I'm a c++ coder in training. If thats how you say it in english.

I wanted to try and get the map to display on the top left corner when you are walking around in town.

I got that working by saving the map as an image and drawing that image on the screen.

Not sure if I need to make a thread for this kind of thing but w/e.

is it possible to get the player location to display on the world map I made.

and if so how? an arrow would be sufficient. just so u can see on what part of the map you are currently located.

Thx
Get an arrow image and use a ratio of x to y of your actual map and the size of your mini map.
 

Bearsmith

Villager
Member
Joined
Nov 13, 2012
Messages
22
Reaction score
5
First Language
English
How do I get the value of a variable? I know how to set the value but I can't figure out how to get it back. It seems to be different from VXAce.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,593
Reaction score
3,811
First Language
Java's Crypt
Primarily Uses
RMMZ
How do I get the value of a variable? I know how to set the value but I can't figure out how to get it back. It seems to be different from VXAce.
Code:
var variableId = 1; $gameVariables.value(variableId);
 

tati light

Veteran
Veteran
Joined
Aug 15, 2015
Messages
160
Reaction score
110
First Language
English
Primarily Uses
Newbie question. When I create an array via script inside event, how can I get the string value to appear in a text message of another event?

(The following example: the second picture/event doesn't work, of course ^^')

3a1q.png


3a1r.png
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,593
Reaction score
3,811
First Language
Java's Crypt
Primarily Uses
RMMZ
If you want to display the array inside a text message, you need to set it's value to a RM variable and use \v to display it.
 
Last edited by a moderator:

tati light

Veteran
Veteran
Joined
Aug 15, 2015
Messages
160
Reaction score
110
First Language
English
Primarily Uses
If you want to display the array inside a text message, you need to set it's value to a RM variable and use \v to display it.
Is there no way to get the value of a self-made array? I wanted to avoid using the game variables because I will need to work with multi-dimensional arrays.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,593
Reaction score
3,811
First Language
Java's Crypt
Primarily Uses
RMMZ
Is there no way to get the value of a self-made array? I wanted to avoid using the game variables because I will need to work with multi-dimensional arrays.
Not inside a message, unless someone made a plugin that let you run a script inside a message, but that could get messy.

The easiest way is to just set the value to a temp variable before showing the message:

$gameVariables.setValue(1, ar[0]);You can even use the same variable (in this example, 1) everytime.
 

tati light

Veteran
Veteran
Joined
Aug 15, 2015
Messages
160
Reaction score
110
First Language
English
Primarily Uses
Not inside a message, unless someone made a plugin that let you run a script inside a message, but that could get messy.

The easiest way is to just set the value to a temp variable before showing the message:

$gameVariables.setValue(1, ar[0]);You can even use the same variable (in this example, 1) everytime.
Ah... I see... so I would need to pre-set the values I want inside gameVariables for temporary use... yes, it will be more work to do, but definitely possible. I think I got it, I will test here... Thanks very much!

Edit: It worked as intended, thanks again!
 
Last edited by a moderator:

laaghisce

Veteran
Veteran
Joined
Apr 18, 2015
Messages
33
Reaction score
24
First Language
English
Primarily Uses
RMMV
I'm unsure about asking this but I'll give it a shot.  ;_;  
Can I ask for help on how a plugin works that involves knowledge of JS? I do not know anything about any scripting language and I doubt it's something I can learn in a few minutes.

For an example of what I'm asking help for: Yanfly's Main Menu Manager. I've looked over the video many times and have tweaked the examples that came with the plugin already but still do not understand anything.  :(
 

babykgar

Villager
Member
Joined
Oct 19, 2015
Messages
14
Reaction score
1
First Language
English
I've got a question about a function in Window_Base. Can someone tell me exactly what .fittingHeight() does? Here's the code from dev tools window, as seen in the file rpg_windows.js:

Window_Base.prototype.fittingHeight = function(numLines) {    return numLines * this.lineHeight() + this.standardPadding() * 2;};

I'm reading through plugins that change up menus, and I keep seeing this being used, but I'm still not sure what's going on with this...
 

Torqus

Veteran
Veteran
Joined
Aug 2, 2015
Messages
169
Reaction score
27
First Language
English
Primarily Uses
I'm unsure about asking this but I'll give it a shot.  ;_;  

Can I ask for help on how a plugin works that involves knowledge of JS? I do not know anything about any scripting language and I doubt it's something I can learn in a few minutes.

For an example of what I'm asking help for: Yanfly's Main Menu Manager. I've looked over the video many times and have tweaked the examples that came with the plugin already but still do not understand anything.  :(
Are you using the help from the plugin? You'll have more details there.

Also you should give more details on what your problem is, I might be able to help actually.

I'm also having problems with that plugin, need to make a "Main Bind" open a Event Selector window (kadokawa plugin) but can't make it work :S
 

laaghisce

Veteran
Veteran
Joined
Apr 18, 2015
Messages
33
Reaction score
24
First Language
English
Primarily Uses
RMMV
Are you using the help from the plugin? You'll have more details there.

Also you should give more details on what your problem is, I might be able to help actually.

I'm also having problems with that plugin, need to make a "Main Bind" open a Event Selector window (kadokawa plugin) but can't make it work :S
I have looked at the help window in the program for this plugin, but I still do not understand what certain terms mean. ;c

I've looked up some, such as 'eval' and 'bind' but can't make any sense out of those.

And I'd love any help with understanding this script! Would you like me to pm you or post what I'd like to implement with this plugin?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,166
Reaction score
14,211
First Language
English
Primarily Uses
RMMV
I've got a question about a function in Window_Base. Can someone tell me exactly what .fittingHeight() does? Here's the code from dev tools window, as seen in the file rpg_windows.js:

Window_Base.prototype.fittingHeight = function(numLines) {    return numLines * this.lineHeight() + this.standardPadding() * 2;};I'm reading through plugins that change up menus, and I keep seeing this being used, but I'm still not sure what's going on with this...
Yeah, fitting_height was also used in Ace, and maybe even VX.

So we're saying the number of lines by the height of each line, which will give the height of all the items combined. Adding standardPadding * 2 gives enough room for some spacing at the top and bottom of the contents.

@laaghisce, what you are asking for is a detailed walkthrough of a plugin. First I have to ask why you want to look at the script, if you have no scripting experience? Are you trying to use it, or to learn how to make one yourself? To use a plugin, you should not have to go into the script at all. If you want to learn how to make one, this is not the thread for it to happen in.

If you want your detailed walkthrough, could you please post a new thread in the Learning Javascript forum, state what plugin you're going to look at, ask what questions you would like answered, and someone will help you out :)
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

One feature that I'm missing is the ability to see Who is viewing a topic...

It was kinda nice to 'see' some faces, even if they don't say anything.
unnamed_image.jpg
SOMEONE'S SINGLE! HE DOES LIKE ALL GENDERS! SADLY, HE HAS NO NUMBER TO NOTE OF BECAUSE HE HAS NO USE FOR A PHONE, BECUASE SUMMONING WORKS MUCH BETTER AND DOES NOT COME WITH AN ITEMISED BILL.
I just found out that MZ regional price on Steam in my place is much cheaper than MV.
Our water started to work again, now i don't have to fill up our toilet with water again.

Forum statistics

Threads
108,887
Messages
1,040,314
Members
141,325
Latest member
alessandrochiper
Top