Check if picture is present in position x,y [Solved]

Discussion in 'RPG Maker MV' started by Hyouryuu-Na, Dec 26, 2018.

Thread Status:
Not open for further replies.
  1. Hyouryuu-Na

    Hyouryuu-Na Poker-faced creepy girl Veteran

    Messages:
    300
    Likes Received:
    315
    Location:
    Lazyland!
    First Language:
    Bangla
    Primarily Uses:
    RMMV
    Exactly what the title says. Is there any way to check if a picture is present in position x,y in pixels? I looked around in the internet but didn't find anything like this. If anyone has any idea, or knows a plugin please let me know. Or you can make a plugin for me ^^; I can't pay you though.
    Thank you for reading.
     
    #1
  2. Sauteed_Onion

    Sauteed_Onion Mmm Tasty Veteran

    Messages:
    554
    Likes Received:
    3,658
    Location:
    Perhaps on a steak or cheeseburger
    First Language:
    English
    Primarily Uses:
    RMMV
    Hmm, I'm sure there is, but what exactly are you trying to do?
    I'm using Yanfly's Button Common Events to make a common event that checks to see if a switch is activated or not, and if it isn't it pops a picture up and if it is, it takes the picture down, but I'll be using the built in x and y coordinate adjuster to place the image where I want it. I don't know if maybe using a conditional branch within a conditional branch to check for x and y coordinates will help you, but without knowing more and/or which plugins you are using I don't think we can help anymore. Hope this helped though.
     
    #2
  3. Hyouryuu-Na

    Hyouryuu-Na Poker-faced creepy girl Veteran

    Messages:
    300
    Likes Received:
    315
    Location:
    Lazyland!
    First Language:
    Bangla
    Primarily Uses:
    RMMV
    I want to check if there is a picture in x,y coordinates.
    The reason is to make an inventory system like in the resident evil games. The player can assign their items to slots. But there can't be more than one item in one slot. That's why I need to check if a picture is in a position because I'm going to use pictures instead of icons. If there is already a picture, the condition will return false and the player can't get the item.
     
    #3
    Sauteed_Onion likes this.
  4. Andar

    Andar Veteran Veteran

    Messages:
    28,305
    Likes Received:
    6,434
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I think you're going to this the wrong way.
    You could check for pictures, but only by going through the list of all displayed pictures and checking their coordinates.

    I think it would be better to come at this from a different direction:
    Pictures are only there if they're placed by a command. So have that place in your logic set a switch or variable to tell it "occupied", and check that later.

    Another alternative however would be to use a map for your inventory - instead of placing pictures when the command to open the inventory is given, you store current party position, turn the party invisible (or into a cursor) and then use the map grid for inventory, with events as a placeholder for items. This would probably need a lot of eventing to get everything right, but you could use those events more or less directly.
     
    #4
    Sauteed_Onion and Hyouryuu-Na like this.
  5. Hyouryuu-Na

    Hyouryuu-Na Poker-faced creepy girl Veteran

    Messages:
    300
    Likes Received:
    315
    Location:
    Lazyland!
    First Language:
    Bangla
    Primarily Uses:
    RMMV
    Oh! I was thinking wrong X0 Sorry for my idiocy. But I guess it happened because I was thinking of using a plugin that allows player to drag the pictures... Allowing them to place the picture anywhere. Then it will become hard to check islf tje slot is empty or not.
    But I cant try to approach the situation how you suggested @Andar

    Edit:
    I found a way to achieve what I was planning! The picture drag move plugin has an option to set a switch ON whenever a picture enters a region. That switch will help me check for slot availability. Though I can do this, I will also use the ideas @Andar gave me and see which one is the most flexible and effective.
     
    Last edited: Dec 26, 2018
    #5
    Sauteed_Onion likes this.
  6. FleshToDust

    FleshToDust Pixel Beginnings Veteran

    Messages:
    381
    Likes Received:
    2,232
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    If you use a switch it says it's occupied but if you use a variable you can tell exactly what item is occupying it depending on the number.
    If 0: Empty
    If 1: Sword
    If 2: Shield
    If 3: Healing Item
    etc.
     
    #6
    Hyouryuu-Na and Sauteed_Onion like this.
  7. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,409
    Likes Received:
    4,078
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #7
Thread Status:
Not open for further replies.

Share This Page