Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,206
Reaction score
870
First Language
Hungarian
Primarily Uses
RMVXA
Okay, so I have been trying out this MV at my friend's PC for a few days now.


I really don't like many things in MV (like all of the "RPG" classes dumped in a huge file, and this whole "plugin" stuff bull, but ohh, well, I can make my scripts without using that... thing...), but I decided to learn a bit of JS with it.


I have searched the internet for a good guide which shows the difference between the syntax usage in Ruby and JS. I found some of them (like array iteration, class making), but I still need many more.


I would look through the default MV scripts for some examples, but sadly, I have no idea where can I find some stuffs I really need.


One of them is hash iteration (or can 'forEach' be used for that too? If so, how exactly?).


I am not asking anyone to write down all the differences (but anyone is free to do so if someone is up for the task, of course). I am asking for an already made list if possible.


Searching for "syntax differences between Ruby and JavaScript" did not yield many useful results, and I have no idea how else could I search for it.


Thanks for any answers in advance!


Edit:


Ohh, and if anyone knows an OFFLINE (downloadable) JS guide/tutorial (in text, not video tutorials), please point me to it as well! Thankies!
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
893
First Language
German
Primarily Uses
RMMZ
and this whole "plugin" stuff bull, but ohh, well, I can make my scripts without using that... thing...)
Unless you want to directly edit the index.html: No, you can't, and there is kinda no reason, since the PluginManager, parameters and easy enabling/disabling of plugins make it easier to handle scripts.You would iterate over an object (there are no hashes) like this:

Code:
for(var key in object) { ... }
or
Code:
Object.keys(object).forEach(function(key) { ... });
In general, JS is a completely different language, so you should probably start from scratch.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,206
Reaction score
870
First Language
Hungarian
Primarily Uses
RMVXA
I wouldn't call opening billions of boxes to STILL type in the SAME things I could simply type in into my own script txt file any way easier, no matter how I look at it.


I am talking about script settings, such as changing some texts displayed, window sizes, etc.


It makes no difference between writing it inside a (very) little box or inside the txt file itself, aside from the fact that it is very annoying to write long text settings into a (very) small box.


Maybe it's just me liking all my settings inside a big, scrollable text file organized instead of multitude of (very) small boxes.


What do you mean by editing the Index.html file? I already made some custom buttons and text settings for them inside the text files itself, and it works well. o.o


But nevermind that, it is my personal preference, I guess.


Okay, hashes are basically objects, right?


I see, so I must use the keys from the hashes (with the .keys function - convenient, I haven't thought about that :D ).


I can't really iterate the object itself with the pairs themselves (key + data)? Or if I can, how would I access the key and the data itself inside the iteration?


I can see many resemblance between Ruby and JS (and between some other languages as well), which let me make some edits here and there already.


Making classes, new methods (called functions here, I think?) and such things. No need for separating all my Ruby knowledge entirely, in my opinion. With a few weeks of practice, I am sure that I can get most of the syntax stuffs right. But I would need an offline JS book for that, because my connection is limited and can't really get any help if I am stuck, which slows me down a whole lot. >.>


Thanks for the help!
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,812
Reaction score
893
First Language
German
Primarily Uses
RMMZ
Starting with ES6, JavaScript gets a Map class, that allows you to iterate over the entries: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map


MV utilizies ES5, but since most of ES6's functionalities only represent a thin wrapper over ES5, it is possible to write plugins in ES6 and compile them down to (barely readable) ES5. You probably should ask DarknessFalls about this, since he is (i think) the only one writing his plugins that way.
 

Latest Threads

Latest Posts

Latest Profile Posts

Custom slip rates and custom ailment durations for enemies really opens up the floodgates for status effect use. I can have Poison and Time Stop affect bosses without it breaking their balance! Finally, a healthy middle ground.

(Especially after I cooked up a thing that prevents you from re-applying deadly states more than once in specific occassions.)
Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.
The only time my brother shows me any kind of support is by liking or LOL my Facebook Comments.
I finally finished the Coliseum for my game. Love how it looks. Credits for the assets goes to Kokoro Reflections, @Starbird_Resources, and @megumi014.
Colossuem.png

Forum statistics

Threads
124,522
Messages
1,164,204
Members
163,357
Latest member
UniverseOwO
Top