redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
137
Reaction score
66
First Language
Belarusian
Primarily Uses
RMMV
Lately I've been thinking about how to speed up or simplify the development process, to make it more comfortable. And many people say that the problem of the maker is numerous menus for every single action, but we have the ability to do it all through JS. And so I tried, and immediately ran into a wall. I saw that all the scripted actions are done at the same time, which means you need a separate line of script for each individual action, right? It got even worse when I realized that each line of dialog will also need to be written in a separate script line. And this completely contradicts what I wanted to achieve, I wanted to move all the dialogs from my document into one line of script because the batch process works horribly for me.

So, my question is: will doing all tasks using scripts make it easier and faster if done correctly, or is knowledge of JS coding needed only in rare cases when performing complicated tasks? Could it be that I'm getting something wrong?
 

residntevl

Blideo games
Veteran
Joined
Jul 30, 2012
Messages
100
Reaction score
287
First Language
English
Primarily Uses
RMMV
Can you provide an example of what it is you are trying to accomplish? Your first few sentences are not very clear about what it is you want to do with code.

However,

Learning JS greatly improves your understanding of the engine and what its limitations are by default, allowing you to work with them and make them do things more to your vision in most instances. Learning JS allows you to manipulate lots of systems you might not otherwise have known about available to you as the evented options are not always as far reaching as they might need to be.

Also learning JS can help you create apps and other such stuff for other platforms, like back-end website work and discord bots as an example.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
137
Reaction score
66
First Language
Belarusian
Primarily Uses
RMMV
Can you provide an example of what it is you are trying to accomplish? Your first few sentences are not very clear about what it is you want to do with code.

However,

Learning JS greatly improves your understanding of the engine and what its limitations are by default, allowing you to work with them and make them do things more to your vision in most instances. Learning JS allows you to manipulate lots of systems you might not otherwise have known about available to you as the evented options are not always as far reaching as they might need to be.

Also learning JS can help you create apps and other such stuff for other platforms, like back-end website work and discord bots as an example.
I meant, will it be faster to write any event with script calls instead of using the default UI commands? Given that you will be typing pretty fast and know most of the necessary commands. But also, is there a way to show actions sequentially using script calls, not all at the same time? Like, if you want to show one message and then another one, but using one script call. Are there any separation signs?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,473
Reaction score
10,895
First Language
German
Primarily Uses
RMMV
You can make a game wich each of the four different levels of javascript knowledge, it just has different restrictions.
and you need to decide for yourself if that level is enough for you, or if you want to put in the work to get to the next level.

1) ZERO javascript
The entire editor and the event system is made to create games without javascript knowledge.
The difference is that without any knowledge of javascript, you'll basically have to follow the type of game that is a classic JRPG without much add-ons.

2) very basic javascript, 2-4 hours of learning
This is basically what is listed in the pinned topics about "how to use the damage formula" - learning how to call special effects and mathematics in the formula itself, so that your skills have multiple effects and are a bit more advanced.
the same level also allows you to use basic eval notetags on plugins and so on.

3) advanced javascript, 1-3 weeks of learning
Learn basic javascript programming to be able to handle complex eval notetags and things like yanfly's "lunatic code"-notetags and so on.
This is the level almost all advanced developers are at, and allows them to event a lot of complex systems.

4) plugin programmer, 3-6 MONTHS of learning
A plugin programmer does not only need to know javascript, but also needs to know how the engine itself works to be able to add his own plugins into it.
and that is NOT easy to learn, because there is almost no documentation for the engine.

But if you get through to this level, you can basically do whatever you want in the engine.


EDIT: the last questions were added by a ninja. ;-)

Unfortunately that is not how scripting works. Scripts are not miracle workers, they only allow variances where they were programmed for them.
Direct javascript use of commands allows the use of more variables where the event commands are more strict, but for changing the engines behaviour you need to go beyond the level 3 above.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,875
Reaction score
6,678
First Language
English
Primarily Uses
RMMV
It got even worse when I realized that each line of dialog will also need to be written in a separate script line.
This is where you lost me. I have never seen anyone recommend that users create their dialogue through JavaScript. It's way more complex to do so than to simply use the Show Text event command.
I meant, will it be faster to write any event with script calls instead of using the default UI commands?
No. I don't know of anyone who does this. You use the appropriate tool at the appropriate time - the event commands automate many things for you, and I don't know of anyone who completely eschews them.
So, my question is: will doing all tasks using scripts make it easier and faster if done correctly, or is knowledge of JS coding needed only in rare cases when performing complicated tasks? Could it be that I'm getting something wrong?
Yes and yes.

JavaScript is much more efficient for things like referencing actors/items/enemies, doing conditionals or loops, and getting information you can't access from the event commands, like skill data.

But no one has ever, that I've seen, suggested you should do everything in JavaScript, especially dialogue.
 

Hisao Shou

Veteran
Veteran
Joined
Jan 8, 2015
Messages
186
Reaction score
32
Primarily Uses
I meant, will it be faster to write any event with script calls instead of using the default UI commands? Given that you will be typing pretty fast and know most of the necessary commands. But also, is there a way to show actions sequentially using script calls, not all at the same time? Like, if you want to show one message and then another one, but using one script call. Are there any separation signs?
From my own experience, learning basic JS then learning how the engine works by making small plugins helped me a lot to make more complex systems.

You can do many things with events, but sometimes making them via script can be easier. Think about a game window. Let's say you want to display lists with certain data in them for the player to see, that would be difficult to do with events but with script you can do it. Or let's say if you want to make a HUDs or mini-games, it is easier to make them the way you want if you know scripting them.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
137
Reaction score
66
First Language
Belarusian
Primarily Uses
RMMV
But no one has ever, that I've seen, suggested you should do everything in JavaScript, especially dialogue.
Well, no one told me either I guess. It was my initiative and this thread was created to help me understand what JS is best for and if I should do it with my needs. And for the most part I got answers to those questions, the only thing I would like to know more specifically about is when you can do something faster with scripts than you can with a regular interface. For example you mentioned conditionals. By quick search I found about what it looks like, here:
1653864809455.png
And I can see that it will be easier to do complex multi conditions with scripts, but what about the simplier ones? I just want to know some more what you think about those cases where it's faster and easier to use scripts. I didn't quite get the referencing part.
 

residntevl

Blideo games
Veteran
Joined
Jul 30, 2012
Messages
100
Reaction score
287
First Language
English
Primarily Uses
RMMV
I tend to use scripts in place of event actions only when those event actions are unable to do something I couldn't do in the default editor. I believe in that screenshot you posted it would be simpler to do this instead:
1653869336557.png

The editor provides you all of these tools to make development easier on the user and you don't need to spend so much time typing out code, which may be fallible to syntax errors. There are still instances in which you could make this eventing shorter, such as using a script check in the conditional instead of having 3 conditionals to check the first condition you could compress it into one, like so.
$gameVariables.value(1) < 10 && $gameVariables.value(2) >= 0 && $gameVariables.value(2) <= 100
1653869481888.png

An advanced knowledge of JS should enhance how effectively you can work within the tools provided to you, rather than to replace all instances of the tools available.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,875
Reaction score
6,678
First Language
English
Primarily Uses
RMMV
And I can see that it will be easier to do complex multi conditions with scripts, but what about the simplier ones?
Well, if it's simple, then no need to use a complex tool, is there?

But I would never bother typing out all that like you have in your example. There's a script box in the Conditional Branch event command. 0 reason to use game message background and positioning and formatting functions.
I just want to know some more what you think about those cases where it's faster and easier to use scripts.
The biggest use I get out of mixing JS into events is to toggle self switches on other events. I would hate to have my global game variable or switch list cluttered up with tons of little things for every cutscene or story event I have.
I didn't quite get the referencing part.
There's no way to get in your event commands the ID of the current map's tileset.

There's no way to get in your event commands any information about a skill beyond whether an actor knows it.

There's no way to get in your event commands some information that comes from plugins - I use Yanfly's Quest Log and have to use JavaScript functions to check whether a given quest is accepted or what stage it's in.

The event editor has no way to reference some information about your game. It's hard for me to pull random examples out of my head on demand, because honestly I use JavaScript in my events very infrequently.

I use it much more for actual modification to the game via plugins or in notetags to achieve specific effects.
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,234
First Language
English
Primarily Uses
RMMV
3) advanced javascript, 1-3 weeks of learning
Learn basic javascript programming to be able to handle complex eval notetags and things like yanfly's "lunatic code"-notetags and so on.
This is the level almost all advanced developers are at, and allows them to event a lot of complex systems.
This is the level I'm at currently, albeit with more than 3 weeks of learning. However, I wouldn't dare call myself an "Advanced JavaScripter" cuz that just sounds egotistical, imo. I'd actually call this level of proficiency "Intermediate JavaScript". Btw, would making considerable edits to plugins and RM's core scripts be considered a part of this level of proficiency?

I'll consider myself at "Advanced JavaScript" once I figure out how to implement a CTB system into the battle system I'm using (LeTBS). I'm definitely not at level 4 aka "Plugin Programmer" yet. Though, I am still learning every day.

Idk where I was going with this, but the takeaway is that even though I'm supposedly at the "Advanced JavaScript" level according to @Andar's description, I still feel like a total noob at JS. So while it's true that I can accomplish way more than when I first started, I'd feel conceited labeling myself at "Advanced JavaScript", lol.

But no one has ever, that I've seen, suggested you should do everything in JavaScript, especially dialogue.
Dialogue is definitely one of the things I'd rather use the built-in editor for. Hardcoding the in-game dialogue would definitely be more work than using the editor.

And I can see that it will be easier to do complex multi conditions with scripts, but what about the simplier ones? I just want to know some more what you think about those cases where it's faster and easier to use scripts. I didn't quite get the referencing part.
Look into Yanfly's plugin library and familiarize yourself with "Lunatic Mode". With basic JS knowledge, you'll be able to greatly expand upon/beyond the limits of the stock RPGMaker.
 

BenSD

Could be anybody
Veteran
Joined
Dec 22, 2021
Messages
397
Reaction score
562
First Language
English
Primarily Uses
RMMZ
It's super useful to have some rudimentary knowledge of JS, and I would encourage you to learn a little, but there's not really any point in writing code that the editor is already coded to do; use JS to add 'or' to your conditionals (which is possible in editor in a roundabout way, but still) or for arrays, things like that, but there's no sense in using it for anything basic you can just click your way through (obviously, that's not always going to be true -- sometimes JS really is simpler -- but it's overwhelmingly true).
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,473
Reaction score
10,895
First Language
German
Primarily Uses
RMMV
So, my question is: will doing all tasks using scripts make it easier and faster if done correctly, or is knowledge of JS coding needed only in rare cases when performing complicated tasks? Could it be that I'm getting something wrong?
Yes, there are a few things you got wrong. But to understand them you'll need some background info.

There is a rather complex construct in the engine that could be called the "main game loop". This main game loop handles all timing and coordination between all parts of the engine and your game.
The entire event system has been programmed with safeguards and access ways that make entering objects into that loop easy to handle.

But to access that directly by javascript is extremely complex and full of problems. You already mentioned the timing problems when adding messages, but other cases are even worse. For example there is no direct javascript equivalent for the event command "call common event" - the javascript equivalent is called "reserve common event" and you cannot "time" that command - the common event will be executed when the game loop determines it has time to execute that, which might or might not be immediatly or a lot of cycles later.

The event system was especially designed to make the time handling of the game loop easy, and most of the experienced programmers prefer to use the events for that to spare them the headache of having to check and program all safeguards around the game loop themselves for every tiny message or access.


On the other hand however, the event commands are extremely strict. The command windows have only very limited data entry options, and several of the good options are still missing despite the community having asked for them over and over.
Just as an example: try to add a random equipment to the party. the event command can only be set to a specific item, there is no way to use a variable to calculate the ID of an item to be given.
To do that in an easy way, you'll need the javascript equivalent of the command, where you can easily replace the fixed ID with a calculated number.

Limitations like that are why most developers sooner or later begin to learn the basics of javascript to support advanced eventing.

But I know of no one who ever proposed to completely replace the event system with javascript.
Back in VXAce there had been exactly ONE try to make a framework for creating events by RGSS3 (the Ruby variant used as a script language in VXA), but no one really used that script after realising how complex and difficult that is, and even Tsukihime had abandoned that idea and never revisited it later in MV.
Instead you always get the "clone"-type systems where an event is only copied instead of constructed, because it is much easier to create the event in the editor than to create the dataobject of the event in a scripting language.


Basically the good developers always combine both events and script, they never try to completely replace events with scripts for a lot of reasons (mostly because its less work and easier bughunting)
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
137
Reaction score
66
First Language
Belarusian
Primarily Uses
RMMV
Thank you all guys.

I'm really still thinking about whether to start or not, because unfortunately I already have a lot of responsibilities and on the one hand I understand how often I run into walls and have to go to this forum in search of help, and on the other hand I understand that one can not endlessly expand their skill set. You have to choose what you really need so you don't tear yourself between too many areas.

It just all probably started when I decided to see what the development process looks like on other engines in general, on Unity for example. So you see that wonderful redactor, where you can customize everything in order to make your workflow comfy and producrive, and then you go back to your home, the maker. Redactor in which you've already made quite a big game, and you realize how limited and inconvenient these pop-up menus are, which you're not even able to stretch, which the editor won't even let you close in case you need to check some event on the map.

I understand that the engine is designed on the principle of accessibility, but that's probably it's main problem for us, if the engine is made for everyone, the developers with serious requests will suffer. (Or as you have already shown me, find a way out through JS). Thanks again.

I just want to take this opportunity to ask. I really could not find information on this topic, is there any way to at least re-bind the standard editor keys? I get depressed every time I realize that the quick open event button is Enter. For which I have to reach all the way across the keyboard.
 

BenSD

Could be anybody
Veteran
Joined
Dec 22, 2021
Messages
397
Reaction score
562
First Language
English
Primarily Uses
RMMZ
is there any way to at least re-bind the standard editor keys? I get depressed every time I realize that the quick open event button is Enter. For which I have to reach all the way across the keyboard.

As far as I know, there is not. On the other hand, if reaching across the keyboard is your biggest concern, your game must be going well :p
 

Arctica

Veteran
Veteran
Joined
Jul 19, 2021
Messages
226
Reaction score
333
First Language
----
Primarily Uses
N/A
Nah, you can't do everything in JS. As someone once told me, you can't change the editor itself, that's what is off limits to JavaScript and that's intended. Though once your ideas start going beyond what the editor can do that's when you look to plugins or write your own.

All the makers were designed with a 1 person dev in mind, so it's intended to be as intuitive as possible.

I'll tell you what I use though for learning JS and at least parts of the engine:

^ Actually that is basically the JS library. Note: It all works in the engine but for some aspects you have to 'translate' JS to engine JS if that makes sense. You can know the language but not necessarily know how the engine works.

^I donno if MV or the older ones have the same thing.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,875
Reaction score
6,678
First Language
English
Primarily Uses
RMMV
I get depressed every time I realize that the quick open event button is Enter. For which I have to reach all the way across the keyboard.
...dude, where the heck do you put your hands? The whole point of the Enter key is that it's supposed to be right next to your pinky O__o

I don't mean to be insensitive if you have some kind of disability and you're only working with one hand or something...but in that case, you'd probably have something like a Nostromo or similar input device with programmable keys.
 

residntevl

Blideo games
Veteran
Joined
Jul 30, 2012
Messages
100
Reaction score
287
First Language
English
Primarily Uses
RMMV
...dude, where the heck do you put your hands? The whole point of the Enter key is that it's supposed to be right next to your pinky O__o

I don't mean to be insensitive if you have some kind of disability and you're only working with one hand or something...but in that case, you'd probably have something like a Nostromo or similar input device with programmable keys.
If you're using your mouse left handed then yes the enter key would be next to your pinky when selecting events in the editor.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
137
Reaction score
66
First Language
Belarusian
Primarily Uses
RMMV
...dude, where the heck do you put your hands? The whole point of the Enter key is that it's supposed to be right next to your pinky O__o

I don't mean to be insensitive if you have some kind of disability and you're only working with one hand or something...but in that case, you'd probably have something like a Nostromo or similar input device with programmable keys.
One hand rests on the left side of the keyboard, the other on the mouse. You can't use the editor with both hands on the keyboard, half of the actions are literally mouse-based. Maybe I really don't understand something basic.

I just tried to use both hands and... you can't. You can't event navigate through event action menu, it's fully mouse-based. Should I like always jerking my hand from mouse to keyboard just to press the enter key?:biggrin:

Edit: But actually double click solves this problem, I just used to always open the menu and select this option manually.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,875
Reaction score
6,678
First Language
English
Primarily Uses
RMMV
If you're using your mouse left handed...

One hand rests on the left side of the keyboard, the other on the mouse.
Well, since he was asking about keyboard shortcuts, I presumed he was using...y'know, the keyboard :stickytongue:
You can't use the editor with both hands on the keyboard, half of the actions are literally mouse-based. Maybe I really don't understand something basic.
There's a button between right Ctrl and Alt that pulls up the right-click menu for whatever you have currently selected on the screen. So if you're in event mode, using the arrow buttons will move around the tiles on the map and you can use that button to open the right-click menu for quick event creation (or just press Enter to make a new event or select an existing one as your hand will be near it).

If you're using a laptop, whether or not you have that key varies, but it's standard on PC keyboards.
I just tried to use both hands and... you can't. You can't event navigate through event action menu, it's fully mouse-based.
I don't know what "event action menu" means, but if you mean the Event Editor, you can navigate between all of the parts of that screen using Tab just like any other Windows application. There's nothing in it that requires a mouse click.

But if your hand is on the mouse, I don't see the reason for a shortcut key for events, you can select/make a new one by double clicking on a tile or right-click for the Quick Event Creation menu.
But actually double click solves this problem, I just used to always open the menu and select this option manually.
Gotcha.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm finally done with my demo for the Cube Trail! All that needs to happen is playtesting of the four main characters for any balance changes that need to be done.
Finally finished a little game for the one map challenge!
Game Link
IMG_6319.png
imgur sure is getting weird, one day I lose gradually all my images, the other I get them back randomly and then again they disappear again.
Despite OPT2 praise it still has some strange stories in it. Lady Mikka is trying to work herself to death because of guilt. Guilt over what? ¯\_(ツ)_/¯ So instead of finding a NPC to have a heart to heart with her they decide the cure is a new kimono. So when she drops dead she'll at least be well dressed. I haven't even got to the strange part yet.
Did so much work on the game today. I wish I could post it all in this status update but there is a character limit of course haha. I thought about making a topic for updates, though... maybe.

Forum statistics

Threads
131,691
Messages
1,222,276
Members
173,441
Latest member
Purple-H
Top