Plug-in for Menu that Adds an Image Depending on Variables?

Discussion in 'JS Plugin Requests' started by Pixel-the-Sea-Dog, Jun 30, 2019.

  1. Pixel-the-Sea-Dog

    Pixel-the-Sea-Dog Villager Member

    Messages:
    16
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Heya internet!
    So, I've been using RPG Maker MV for a project of mine. However, I suck at programming menus! :kaocry:
    I did a post somewhere, and they said I'd probably need a plug-in, so here I am!
    My game uses some really important variables to track stuff done in-game, things like Morality and Friendship for example.
    So, to cut to the chase, does anyone know how to get the system to look at a variable (or item) and then show a certain image whenever the menu is pulled up?
    I may also need help with getting an extra option (resume), as well as having the menu appear to the left, but those are other issues! I mostly just need to figure out Variables and Images in the menus!

    (Here's a digital drawing I made of what I want the menu to kinda look like after extensive testing with it, don't focus on the complex-ness, that's on me! Examples of what I mean with da plug-in stuff is down below)

    upload_2019-6-29_22-1-51.png

    For example:
    Let's use the Morality part of the fake menu I made so people can visualize what I'm saying!
    In my game, some actions will add or take away Morality.
    There will be 3 images that the menu could display for Morality:
    - Green (High Moral)
    - Yellow (Neutral Moral)
    - Red (Evil Moral)
    During the game, let's say the player made a choice that now puts their morality in the "Evil Moral" part. (3 to 0 in the Morality Variable). When they open the menu, the game needs to see the variable being from 3 - 0, and show an image in the top right (in this case, a crimson morality heart)

    Here's another Example:
    Another thing that happens in the game is death! Death in this game can be on purpose, or on accident, but either way, the player needs to be able to keep track of what teammates they may have killed.
    Right now, the game checks for an invisible item that appears in the inventory (used to mark if someone died by accident or on purpose).
    Using this, the game will have to check and see if they have the "Kibo is Dead" Item, and then add a skull image in the box.

    Also, just for detail's sake. I'm trying to make an "Available Endings" screen similar to "Bad Dream: Coma". Here's a screenshot of that as well!

    [​IMG]

    Difference being that the game will pick from a selection of 3 images (all of which being a row of 3 pictures depending on the route. There'll be one good, one neutral, and one bad. It'll select this depending on Moral, who they've killed, and the choices they made. When a path is chosen and they do something that eliminates an ending, a picture of a scribble is placed over it.

    Do note that I don't have much experience using plug-ins. I know where to add them, but how to make them is just beyond my world. However, if someone knows of someone who made a Plug-in like this, or knows how to get a menu to read variables and place images that are visible in the menu, then you have my thanks!:kaoslp:

    Either way, thank you for reading! If you have any questions about what I mean, let me know! :kaojoy:
     

    Attached Files:

    #1
  2. Minionice

    Minionice Warper Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    The plan of action will vary based on how you code and design you menus.

    If you want to talk scripting, then there are two core details we need. The first is accessing the system variable for Morality. That can easily be accomplished in a script as described here. The other issue is how to load your images into the menu. This takes a bit more work, but you basically need to use the ImageManager class in rpg_managers.js to load the image from whichever folder you choose for the images.

    If you are trying to avoid or want help with scripting, SRDude has a number of plugins and tutorials involving menus.

    Did you make any progress on your menus? If so, I could try to integrate the feature you are describing. If you haven't started anything with your menus, I'll add the functionality as an example using the default RMMV menu screen.

    Inform me of your progress when you can.
     
    #2
    Pixel-the-Sea-Dog likes this.
  3. Pixel-the-Sea-Dog

    Pixel-the-Sea-Dog Villager Member

    Messages:
    16
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Currently, the most I've done for my menu is removing all of the options other than Save, Settings, and Exit. I might begin using the video and plug-in you've shown me thus far in the morning, but overall I haven't done much menu-wise. I'll begin plopping in those 2 lines you said we need, just gotta know where! (Stay with me, this is my first time working with plug-ins :kaoslp:)
    Anywho, tysm for the help so far, I shall begin my menu stuff asap! :3
     
    #3
  4. Pixel-the-Sea-Dog

    Pixel-the-Sea-Dog Villager Member

    Messages:
    16
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Ok, so I've been playing with it trying to get the basic stuff ready (such as having the options be diagonal and to the left), but I've been having issues, here's a comparison. The first image a screenshot of the plug-in from the creator, and underneath it is a screenshot of my game's menu. Idk if you'd know what I did wrong here or not but hey it's worth a shot. You know more than I do after all! ^^
    So far, I've just opened the plug-in, opened the game, and entered the pause menu.

    [​IMG]
    upload_2019-7-1_21-2-32.png
     
    #4
  5. Minionice

    Minionice Warper Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Sorry, I haven't forgotten about this! I have been working on a plug-in to demonstrate how you would go about the original task of conditionally displaying the character images based on a system variable. I should have it done by tomorrow or Wednesday. I would finish it sooner, but I have work early in the morning. I will edit this post when I have something for you.

    In the meantime, here is a very simple example of what I mean. Enable this plugin and set the variable with ID 0001 with values from 0 to 9, and then run the game and open the menu screen. You will see different characters drawn depending on its value. I just want to give you a more robust example when I am ready to do so.

    Once you do that, just look at the plugin code for the logic behind it. Again, I'll try to make a better example that involves loading our own images and making our own window(s) in the coming days, but I need to go to sleep now. :/

    Keep at it!
     

    Attached Files:

    #5
    Pixel-the-Sea-Dog likes this.
  6. Pixel-the-Sea-Dog

    Pixel-the-Sea-Dog Villager Member

    Messages:
    16
    Likes Received:
    8
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright! Good to know, I also gotta sleep since it's almost 10, so no rush! I'll add the plug-in to my game in le morning. :3
     
    #6
  7. Minionice

    Minionice Warper Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Sorry, I haven't forgotten about this! I want to make this of better quality, but I made a small script that gives an example of what you might need. Create a blank project, and make an event on the map. Using the event, set variable 0001 to an integer between 0 and 9. Finally, enable this plugin, and run the project. Start the game and go to the menu; and select the blank command. The first face will show if the variable is between 0 and 3 (inclusive), the second if it's between 3 and 6 (inclusive), and the third if it's between 6 and 9 (inclusive). Close the application and restart it each time you change the variable value in the editor (I tried to make it less annoying to test, but I couldn't get the window to close, meaning that the game is stuck once you open that window). I'll try to improve this script some time this week so that you have a fully functioning example of your feature. Tell me if you are having trouble getting this plugin to work.
     

    Attached Files:

    #7

Share This Page