Results 1 to 8 of 8

Thread: Game Maker

  1. #1
    Attempter of Things Nethran's Avatar
    Join Date
    Jan 2004
    Location
    Aloft in a balloon of cheese.
    Posts
    2,051

    Default Game Maker

    Has anyone here used Game Maker? I suck with GML, as I have absolutely no coding background, and it'd be cool if someone here had made a game with it before and could help me. :) I used to post on their official forums, but that got me nowhere.

    Also, I'd like to recommend it to people who would like to make games. :) It's easy to use if you keep things simple, and they even have an option for people who don't know how or do not want to code, so you can make games with drag&drop.

  2. #2

    Default

    I did mess around with it a few years ago, but haven't really came up with anything spectacular. Ask away I would say, I know some php so who knows if we can help you with your problems.

  3. #3
    Attempter of Things Nethran's Avatar
    Join Date
    Jan 2004
    Location
    Aloft in a balloon of cheese.
    Posts
    2,051

    Default

    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.

  4. #4

    Default

    If you want your items to automatically store like in diablo if you don't have the inventory opened, you simply need a global variable that switched between 0 and 1 when you open/close your inventory.

    You global variable would for example be "hud_invopen"
    apparently the whole 'selected' thing is a script that is in the game maker?
    If you want the items to go straight into the inventory this is a step you want to skip; better take a look at the script that stores your items in the inventory.
    Some steps the script will have to follow:
    0) Check what script to run; hud_invopen=true -> The selected=true script, if hud_invopen=true -> The stored=true script
    1) Check if there is place in the inventory (doing this first saves a silly bit of CPU load) and where
    2) Check if the item is close enough to the player
    3) On click, it should skip the 'selected=true' part and go straight for the inventory (I think this is stored=true? Can the player choose where he stores his items or does the game decide over this?)
    4) Some debugging could go here


    I'm just logically thinking here, but those scripts seem really really small to me I suppose most scripting is done already by 'game maker'?

  5. #5
    Attempter of Things Nethran's Avatar
    Join Date
    Jan 2004
    Location
    Aloft in a balloon of cheese.
    Posts
    2,051

    Default

    I made all of the variables.. And with move_snap, I don't know how to make it check if the space is empty, that's why right now I have it so you pick up the item, open your inventory, an dplace it in what spot you want it.

  6. #6

    Default

    Well, it's perhaps easiest to check which spaces are not empty, and then put the item in the next space that is 'not not empty'
    depends a bit on how it stores the items in the memory, you'll need to find the inventory script and take a good look at it and how it manages inventory space.

  7. #7
    Attempter of Things Nethran's Avatar
    Join Date
    Jan 2004
    Location
    Aloft in a balloon of cheese.
    Posts
    2,051

    Default

    It's overly simple, which is my problem.

    "move_snap(25,25)" makes 25x25 boxes into which items "snap". That's all there is to it.. I have another simple script that replaces the one I'm holding with the one in my inventory, and that's basically how the whole thing works right now. I might be able to move it and check for a collision, but I'd have to have the inventory window pop up for a split second while it moves it into it, because if it's not visible, the items won't snap into place.. If there was a way to overcome that, I'd be a very happy person.

  8. #8

    Default

    Well if you made the move_snap script yourself then you know how to overcome it, so I suppose you haven't made it yourself.
    You need to look in that script and check how items in the inventory are stored and how their position is stored.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •