Okay. :)
Code:
if selected=true&&place_meeting(x,y,obj_inv_box)&&!place_meeting(x,y,obj_invwindow)
{move_snap(25,25)
selected=false
global.pick=false
stored=true
exit}
That's my inventory currently. obj_invwindow is my inventory window, obviously, and obj_inv_box is the area in which my items are stored, I made it a seperate object than the rest of my inventory window because, obviously, I can't have people dumping their items anywhere on the window. move_snap means that it's sectioned into 25x25px boxes that the items "snap" into when you click them into it.
For you to be able to place items into your inventory right now, you have to click them, press "i" to open your inventory window, and then place them there. That's also how my equipment is supposed to work, I'm still working on it.. It's creating more move_snap boxes than I want and they're not centered on the area where I want equipment to go.
I want to be able to click items on the ground that are close to me and have them automatically store themselves in my inventory window whether or not it's visible at the time, and they have to go somewhere other items aren't, or else a window pops up saying my inventory is full. The wondow part I can take care of.
This is how I have it so that I can only pick up items close to me.
Code:
if selected=false&&point_distance(x,y,obj_player.x,obj_player.y)<=100
{selected=true
exit}
The "selected" variable is defines in my parent object for all items, it's so that the items know that they're picked up and need to follow the mouse accordingly.
The "global.pick" global variable is so that my character knows items are selected by the mouse and he cannot move until they are released.
"stored" of course is whether or not they're stored in my inventory, and "equipped" is whether or not they're equipped. Their stats only apply to my character if equipped=true.
Bookmarks