RMMV javascript tutorial #2 - Change scene, create custom scene, create custom windows

Поділитися
Вставка
  • Опубліковано 5 лют 2025
  • Part 2 of the scripting tutorial series features changing scene through code, creating a custom menu scene and creating a custom window for the scene. Nothing fancy right now, but you have to start somewhere.
    If you have any questions, feel free to leave a comment. I'll try my best to answer.
    P.S Sorry for the cutting fails, but I don't make my videos to be pretty, but to be useful :P
    Useful links:
    RPG maker MV corescript:
    github.com/rpg...
    Kinoar's documentation:
    kinoar.github....

КОМЕНТАРІ • 70

  • @MagickAura
    @MagickAura 2 роки тому +23

    If you're trying to do this on MZ, you're going to get an error at 12:15. To fix this, just replace 'new Window_Custom(0, 0, 320, 240);' with 'new Window_Custom(new Rectangle(0, 0, 320, 240));'

  • @drawnsequence
    @drawnsequence 4 роки тому +5

    You're a really fantastic teacher. I've been stuck on how functions are supposed to work and your method of showing how they're initialized help me finally realize what's going on.

  • @AeridisArt
    @AeridisArt 4 роки тому +3

    Dude, you are a lifesaver!
    I've been trying to figure out how to make a custom quest menu that opens when pressing the "J" key for days now and I just discovered this video. Thank you so much!

  • @kevmansa
    @kevmansa 5 років тому +7

    I had been struggling with Windows, and this very clearly showed what needed to occur. Thank you!

  • @BazSupport
    @BazSupport 5 років тому +16

    Dude i have been looking how to add input control listeners without running a parallel event, thank you. Ive got so many ideas to try out now

  • @thatsagoodone8283
    @thatsagoodone8283 6 місяців тому +1

    Everytime I rename the Symbol at 04:00 it renames it in rpg_scenes.js, too.
    When I close the rpg_scenes.js, there is no prompt to not save. Everytime I open it again, it still has the symbol renamed.
    I looked into my preferences but the auto save is turned off. Is there a way to keep it from changing the source from which I copied it?
    Maybe of interest: My first symbol is highlighted green (same color as Scene_CustomMenu in the following text, all my colors of the code is otherwise identical to the video).
    But in the video, the first time after definining the function, Scene_CustomMenu is depicted yellow in the VIDEO. (Mine is green). Is that hinting at the problem?

  • @eddorneles
    @eddorneles 4 роки тому +2

    Thank you very much for your tutorials I'm learning a lot. The only point I didn't get very well was how (or when) the "Scene_CustomMenu.prototype.update()" is run, and how it effectively solved the problem. Thanks again!

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому +4

      The reason why it helped was, you need some time for the images to load, you cannot use them in the same frame you load them. I took the easy way out, because I was tired and could not remember the function you use for it, but normally you use Scene_CustomMenu.prototype.start to create all windows etc. once all images have been loaded (!ImageManager.isBusy()). I think I explain it in the next episode.

    • @eddorneles
      @eddorneles 4 роки тому

      @@porygtherpgmaker5503 Thank you very much for the fast answer! =D

  • @KyuubiMoon
    @KyuubiMoon 3 місяці тому

    Is it possible to create multiple windows or is it limited to 1? I cant seem to figure out how to make multiple appear.

  • @phasisart
    @phasisart 3 роки тому +1

    Hello there! Thanks for the amazing tutorial
    I've been having difficulty to learn JavaScript but the way you explain things and show coding helped a lot. I'll keep following all your other videos too.
    Just a thing, I can't make the face of the character apear in the window for some reason, I keep looking at your code and mine to see if something is missing on my (or if I typed something wrong which is common to happen) but it's all the same. Do you know what could have happened? Have it happened before with you?
    Thanks in advance and hope you have a great day

  • @PauloHPBender1988
    @PauloHPBender1988 4 роки тому

    Thanks a lot for this and all other tutorials!

  • @bartlomiejlakomski3598
    @bartlomiejlakomski3598 10 місяців тому

    Nice Video! Helped me a lot!

  • @MeasuresDesperately
    @MeasuresDesperately 4 роки тому +3

    Hello, I've downloaded Visual Studio and have been following along with you tutorial and have noticed that my keywords arent
    color coded the way yours is. I was wondering what the reason for this could be? its mainly the properties that arent color coded

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому +1

      Did you download Visual studio, or Visual studio code? They are two different IDEs. I use Visual studio Code. Visual studio is an IDE that is more useful for C++ programming rather than Javascript programming.

    • @MeasuresDesperately
      @MeasuresDesperately 4 роки тому

      @@porygtherpgmaker5503 oh i see, yes i downloaded visual studio and not visual studio code... thank you for responding so promptly... you're tutorials are magnificent.

  • @hanataba1291
    @hanataba1291 11 місяців тому

    Thanks for the tutorials!

  • @Mazapan88
    @Mazapan88 9 місяців тому

    I'm having an issue when the Menu opens, it seems I'm able to open it during text boxes which interrupts the textbox, I'm looking for a way to fix this issue please.

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  9 місяців тому +1

      Game_message has a function that answers your question. If I remember correctly, you'd check the "busy" state of the $gameMessage object.

    • @Mazapan88
      @Mazapan88 9 місяців тому

      @@porygtherpgmaker5503 thanks a lot!!!!

  • @พลัฏฐ์กรพัชรเจริญหิรัญ

    I have yet to find a way to create a button to exit the menu with most plugins, using images button that cannot be overlaid on the screen.

  • @ThreeSixNine...
    @ThreeSixNine... 5 років тому +1

    Great tutorials!

  • @ronaldleung9975
    @ronaldleung9975 4 роки тому

    sir, thanks for the video. But still I don't quite understand some of the points.
    How are the functions of prototype.create prototype.update, and prototype.initialize called in the program?
    I tried to track them from the js folder but I cannot find a clear answer.
    Also, what is the use of
    _alias_scene_map_update.call(this);
    in the final update function?
    ---------------------------------------------------------
    Edit: Oh does that mean the original Scene_Map.prototype.update is overrides, but hence we still keep the original arguments in the update loop?

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому

      The create method is called inside SceneManager.changeScene.
      The initialize method is always called in constructor (the initialize.apply(this, arguments) calls the initialize method and applies all arguments used in the constructor. I have absolutely no idea what the hell is that naming convention, because there's literally no difference from typing that directly into the constructor, but hey... They use it, so I did too, for the sake of consistency.).
      And the update method is always called in SceneManager.update, which is the ticker function for the engine.

  • @valdenirjrtk
    @valdenirjrtk 2 роки тому

    You are a angel!

  • @TROUBLE8637
    @TROUBLE8637 3 роки тому

    im having an issue with the keymapping. when i use Input.isTriggered it has the ... under it and it says "Property 'isTriggered' does not exist on type 'typeof Input'."

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  3 роки тому

      RMMV, or MZ? If MV, I'd suspect an old pirated version as it was missing there. If MZ, it would be normal as the two makers aren't totally compatible.

    • @TROUBLE8637
      @TROUBLE8637 3 роки тому

      @@porygtherpgmaker5503 what would be pirated?

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  3 роки тому

      @@TROUBLE8637 I was simply listing two possible reasons why it wasn't working. It's a default function in the MV engine, so either you're using MZ, or it's an extremely old version that doesn't include this function.

    • @TROUBLE8637
      @TROUBLE8637 3 роки тому

      @@porygtherpgmaker5503 i just installed it off steam 2 days ago lol. its been sitting in my library for over 2 years so it should be fully updated. but visual studio isnt recognizing isTriggered

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  3 роки тому

      @@TROUBLE8637 Can you upload a sample project somewhere?

  • @mr45buster
    @mr45buster 4 роки тому

    Hey, is there any way to create a window conditionally based off the plugin while on the map?

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому

      if(PluginManager.parameters(pluginName))
      Or there's another option, simply define a special global variable in the plugin you want to base the window on.
      var specialVar = true;
      then in your plugin simply
      if(specialVar)

    • @mr45buster
      @mr45buster 4 роки тому

      Poryg the RPG Maker thanks so much for ur reply... I should have specified better. I actually want it to so that the window can be added removed dynamically (either thru plugin commands or a switch or something). Realizing my comment was really poorly worded lol

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому

      @@mr45buster Have the plugin command hide the window using window's hide method. As for switch, you'd need to check for that in window's update loop.

    • @mr45buster
      @mr45buster 4 роки тому

      Poryg the RPG Maker that makes sense. I think I just need to play around more. I can get the window to appear all the time on the field, but I can’t get it to appear as I want. I’m sure there’s something I’m missing. Thanks for taking the time to reply!

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  4 роки тому

      @@mr45buster You need to hide the window inside the constructor function and then when you need, call show

  • @Meme-ge3lb
    @Meme-ge3lb 4 роки тому +1

    Is this applicable in rmxp??

    • @spiculicious
      @spiculicious 4 роки тому

      No, MV uses Javascript. XP uses Ruby so this is not compatible.

  • @gren8759
    @gren8759 Рік тому

    Good stuff

  • @kiro1599
    @kiro1599 Рік тому

    How do you add Developers Tools?

  • @pinkywhistle1648
    @pinkywhistle1648 5 років тому +1

    Hey nice video SUPERB helpful, I change the way you code in "cancel input", I change it to this "if(Input.isTriggered('p')) SceneManager.pop();" likely if I press "p button" it will show the custom menu and if I press again the "p button" it will close/cancel. uhmm is my code doesn't have negative effect isn't it? thank you so much I hope you make video on selectable custom menu too :)

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  5 років тому +1

      No, it doesn't have negative effect as long as the Input.keyMapper recognizes what "p" is. Sorry for not responding sooner, but the youtube notification system works just wonderfully - it doesn't notify me about the important ones.

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  5 років тому +3

      As for the video on custom selectable window, I don't think I'll make one, since it's too broad of a concept and if I do a video about "How to make this in a selectable window", it answers one particular "this", but doesn't answer the question for millions of different "thises" (I know it's "these", but that was on purpose) and that's what I'm trying to avoid. I intend my videos to be more or less modular, since if you want to be a good programmer, you essentially need to dissect a problem into small particles and learn more through experimentation - not even the best tutorial in the world can teach you better than practical experience. So the main series will teach the core important things you need to know and give you the base you can build on. For example the first 2 videos of the series contain all you need to know to create a basic selectable window. Video #1 shows you how you can draw stuff. #2 shows the setHandler and some of the important properties. That's about all that's needed in the core.
      I have nothing to teach about the windows. Trying to explain what each method does is pointless, since they're kind of self explanatory. If you want to change the rows, you need to search for something that contains "row" in it. If you want to change columns, you'll use "cols". If you want to change item width or item height, you'll search for that... Or for item rect and see how that handles item width and item height. And I could continue.
      What I will do however is create a new video series. I'll call it Tips & tricks and it will feature some of the concrete features to implement. Video #1 takes a basic selectable window and shows how to draw text at the top of it to have a sort of description. Video #2 shows how can you create custom and customizable items as well as how can you customize them. Something that is useful in custom shop plugins, because you want to be able to for example customize the price. But it's not a tutorial on "How to make a shop plugin", because the shop plugin contains selectable window, texts, icons and other things,... In other words the basic elements... Just implemented in a certain way.
      So you could say, these tutorials are there to point you in the right direction, but not to lead you by the hand.
      If you want to know about some concrete features to implement, feel free to leave them in the comments and I'll take a look. As long as it's a single feature or a pack of features, I might make a video about it in the tips & tricks.

    • @pinkywhistle1648
      @pinkywhistle1648 5 років тому +1

      @@porygtherpgmaker5503 Wow nice info, Yeah you're right that when it comes to being a programmer we need to extend and explore all things to get what we expect as an output. I'm also reading your comments on FORUM :) I really want to learn as much as i can in Javascript and your guide is so clearly to follow. I hope you still be able to continue your channel :)

    • @porygtherpgmaker5503
      @porygtherpgmaker5503  5 років тому +1

      @@pinkywhistle1648 Good luck in your learning! I'll try to deliver as best as I can. The next content might be a bit chaotic, since I'll be doing battles (people requested them quite a lot), but hopefully I'll still keep up the consciseness!

  • @egesaglam6173
    @egesaglam6173 5 років тому

    Thank you sp much bro

  • @ayusDs
    @ayusDs 4 роки тому

    Bro how to fix bug report of the game please help

  • @kanedasenpai
    @kanedasenpai 3 роки тому

    Tried that on RPMZ and didnt work ):

  • @omiorahman6283
    @omiorahman6283 4 роки тому

    Cool

  • @a-ahmadfikri719
    @a-ahmadfikri719 5 років тому

    cat salami

  • @egesaglam6173
    @egesaglam6173 5 років тому

    Thank you so much bro