View previous topic :: View next topic |
Author |
Message |
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Thu Apr 20, 2006 7:17 am Post subject: Gamemaker 6 Help |
|
|
I could always go to the gamemaker forums for this, but I decided to go here instead. I mean, we've got wourm and dessgeega here!
Anyway, I was messing around last night and ran into a few issues that obstructed my progess. I'll list them below in hopes that someone might be able to come up with a solution (by the way, I'm making a metroidvaniaish platformerish thing):
1. My character is getting stuck on a lot of edges. I changed the size of his bounding box to manual and that helped a bit, but what else can I do?
2. My character wields a weapon that I currently have set as a different object. When this weapon hits a wall the character is sent flying backwards. My problem is that the weapon stays in place and doesn't follow him when he moves backwards. I tried making the weapon into a child of the character, but then my variables get all confused for some reason.
3. Uhh, how do I use diagonal directions as easily as I can vertical and horizontal directions. Is it even possible?
Thanks! I looked into GM lingo yesterday and I don't think I'd have problems using it, but I'd like to look into other options first.
-Wes _________________
|
|
Back to top |
|
|
dessgeega loves your favorite videogame
Joined: 16 Jun 2005 Posts: 6563 Location: bohan
|
Posted: Thu Apr 20, 2006 7:32 am Post subject: Re: Gamemaker 6 Help |
|
|
SuperWes wrote: | 1. My character is getting stuck on a lot of edges. I changed the size of his bounding box to manual and that helped a bit, but what else can I do? |
what you want to do is give your character a mask - a hitbox. draw a square that represents the part of your character that should register collisions, then import it into the game as a sprite. open the object for the character - on the left side you should see "mask - same as sprite". set the mask to the new hitbox image.
the second question i guess could have a bunch of solutions depending on how the weapon is implemented. parents and children aren't used for that sort of thing, though - they're used for communication between objects, mostly. like if your character reacts to enemies, you'll have a parent object "enemy" and then "snake", "slime", and "scorpion" will all be children of "enemy".
and by "use diagonal directions" do you mean accept input from the player? because a good way to do it is to use the keyboard_check() variable to detect whether two arrow keys are being pressed at the same time, and then react accordingly. a more simple way to do it, though, is to have one object handle horizontal movement and another handle vertical. _________________
|
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Thu Apr 20, 2006 10:51 am Post subject: Re: Gamemaker 6 Help |
|
|
dessgeega wrote: | what you want to do is give your character a mask - a hitbox. draw a square that represents the part of your character that should register collisions, then import it into the game as a sprite. open the object for the character - on the left side you should see "mask - same as sprite". set the mask to the new hitbox image. |
Hit box. What? HA! Ok, seriously, umm, I'll try this but I don't see how it does anything different than just manually setting the sprite's hitbox. If it works though I'll give you a thumb up.
dessgeega wrote: | the second question i guess could have a bunch of solutions depending on how the weapon is implemented. parents and children aren't used for that sort of thing, though - they're used for communication between objects, mostly. like if your character reacts to enemies, you'll have a parent object "enemy" and then "snake", "slime", and "scorpion" will all be children of "enemy". |
This is GREAT to know, but it doesn't answer my question. You've seen the weapon, think of it as a sword, or, oh, I don't know, a boxing glove. If you swing the sword while running the sword stands still at the point you swang it instead of it following your character. How can you have the sword move on the same path as the character?
dessgeega wrote: | and by "use diagonal directions" do you mean accept input from the player? because a good way to do it is to use the keyboard_check() variable to detect whether two arrow keys are being pressed at the same time, and then react accordingly. a more simple way to do it, though, is to have one object handle horizontal movement and another handle vertical. |
I totally mean "accept input from the player." But I don't know how to use the keyboard_check() variable. Would I put "if keyboard_check(<up> && <right>) is equal to true" do the following? And if so, which event would I throw it into? Step?
-Wes _________________
|
|
Back to top |
|
|
dessgeega loves your favorite videogame
Joined: 16 Jun 2005 Posts: 6563 Location: bohan
|
Posted: Thu Apr 20, 2006 11:00 am Post subject: Re: Gamemaker 6 Help |
|
|
SuperWes wrote: | Hit box. What? HA! Ok, seriously, umm, I'll try this but I don't see how it does anything different than just manually setting the sprite's hitbox. If it works though I'll give you a thumb up. |
because, fool, your game is still reading the pixels of the character's sprite as its edges for collision detection. so your character is getting caught by that one pixel on his ear or whatever. that's why you need to set the character's mask to a smooth square.
Quote: | This is GREAT to know, but it doesn't answer my question. You've seen the weapon, think of it as a sword, or, oh, I don't know, a boxing glove. If you swing the sword while running the sword stands still at the point you swang it instead of it following your character. How can you have the sword move on the same path as the character? |
well, mr. snippy von snipmeister, you could have the glove move to a position to the left/right/wherever of the character during its step action?
Quote: | I totally mean "accept input from the player." But I don't know how to use the keyboard_check() variable. Would I put "if keyboard_check(<up> && <right>) is equal to true" do the following? And if so, which event would I throw it into? Step? |
well, it'd be more like "keyboard_check(vk_up) && keyboard_check(vk_right)" ("vk" meaning "virtual key") or something. yeah, step would be the logical place to put it. _________________
|
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Thu Apr 20, 2006 11:30 am Post subject: Re: Gamemaker 6 Help |
|
|
dessgeega wrote: | because, fool, your game is still reading the pixels of the character's sprite as its edges for collision detection. so your character is getting caught by that one pixel on his ear or whatever. that's why you need to set the character's mask to a smooth square. |
Oooh. Ok cool. I'm a dummy. But wait! What's the sprite bounding box for if not hit detection?
dessgeega wrote: | well, mr. snippy von snipmeister, you could have the glove move to a position to the left/right/wherever of the character during its step action? |
See, I had this in mind, but I didn't know how to use gamemaker lingo to say it. I tried looking it up but I got lost. I think I need someone to point me to a good tutorial. I also need somone to answer this question for me so I can throw it in and see if it works (kinda like you did for the below question). Any takers?
dessgeega wrote: | well, it'd be more like "keyboard_check(vk_up) && keyboard_check(vk_right)" ("vk" meaning "virtual key") or something. yeah, step would be the logical place to put it. |
Now THIS is some good help. You're the bomb. In your game are you using mainly drag and drop or are you throwin' in some gamemaker lingo?
Seriously, thanks for your help. It's really... uhh... helpful? Woo!
-Wes _________________
|
|
Back to top |
|
|
dessgeega loves your favorite videogame
Joined: 16 Jun 2005 Posts: 6563 Location: bohan
|
Posted: Thu Apr 20, 2006 11:42 am Post subject: Re: Gamemaker 6 Help |
|
|
pixels outside of the sprite bounding box aren't looked at in collisions. but only pixels inside the box are used in collision detection, not the whole box. so your character can still get stuck on pixels inside the box.
SuperWes wrote: | In your game are you using mainly drag and drop or are you throwin' in some gamemaker lingo? |
i actually use mostly drag & drop with variables (like keyboard_check() for example). it's useful to know how these work! for example, every object has an x and y value. you can read OBJECT_Z's x and y values by typing OBJECT_Z.x and OBJECT_Z.y. this could be helpful in positioning your boxing glove!
i typically only use gml when i need to do things drag & drop can't do, like read and write to files. _________________
|
|
Back to top |
|
|
Lackey .
Joined: 11 Jul 2005 Posts: 1107 Location: Canada
|
Posted: Thu Apr 20, 2006 2:16 pm Post subject: |
|
|
Quote: | pixels outside of the sprite bounding box aren't looked at in collisions. but only pixels inside the box are used in collision detection, not the whole box. so your character can still get stuck on pixels inside the box. |
Just turn "precise collision checking" off in the sprite settings. Then the collision box will be...a box. No need for masks unless you need to do something strange. _________________ | Little bird fighting against a bat sect game | |
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Thu Apr 20, 2006 5:04 pm Post subject: |
|
|
Lackey wrote: | Quote: | pixels outside of the sprite bounding box aren't looked at in collisions. but only pixels inside the box are used in collision detection, not the whole box. so your character can still get stuck on pixels inside the box. |
Just turn "precise collision checking" off in the sprite settings. Then the collision box will be...a box. No need for masks unless you need to do something strange. |
THANKS!
That's the best advice of all time.
-Wes _________________
|
|
Back to top |
|
|
wourme .
Joined: 01 Jul 2005 Posts: 362 Location: Maridia
|
Posted: Thu Apr 20, 2006 5:18 pm Post subject: |
|
|
I've never needed to use masks. As Lackey said, turning off precise collisions makes the boundaries based on the hitbox you define rather than the sprite's pixels. Though masks are necessary in some earlier versions of GM.
If you've already tried either or both of these solutions and still have trouble with sticking, it might have something to do with the solid attribute. You want walls and blocks to be solid so that the collision puts the character just before impact rather than overlapping.
As for the weapon following along, you might set the weapon's x and y coordinates in the character's "End Step" event. This will make it follow along seamlessly no matter what. For example:
obj_sword.x = x + 5;
obj_sword.y = y + 10;
You can, of course, use variations on this if the sword is swung around.
SuperWes wrote: | Is it even possible? |
I believe that pretty much anything is possible in Game Maker, so long as it isn't heavy on 3D or massively multiplayer.
Edit: You might find this site useful. It helped me in a few places when I was new to GM:
http://www.gmkb.madladdesigns.co.uk/ |
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Sat Apr 22, 2006 6:38 pm Post subject: |
|
|
This site is a huge help. I have another set of problems now though.
1. I've got platform that travels on a specified path. Whenever my character jumps on the platform both the platform and the character stop. I figured out that this is because the platform is solid. So I tried making the platform non solid and he just flies through it. How can I have the platform continue along the path with my character on it when he jumps on it?
2. My guy can push around blocks. I've got it so that the crates look nice when moving around individually. I'm attempting to do this by setting hspeed to -10 and having it slow down with each step until it reaches zero. This is nice, but I want to make is so that when one crate hits the next one the remaining force is transferred to the other crate and the first one stops. I tried doing this by saying "other.hspeed=self.hspeed, self.hspeed=0," but it doesn't seem to work. Both crates end up stopping.
Thanks in advance! That one site is a huge help!
-Wes _________________
|
|
Back to top |
|
|
dessgeega loves your favorite videogame
Joined: 16 Jun 2005 Posts: 6563 Location: bohan
|
Posted: Sat Apr 22, 2006 6:49 pm Post subject: |
|
|
SuperWes wrote: | 2. My guy can push around blocks. I've got it so that the crates look nice when moving around individually. I'm attempting to do this by setting hspeed to -10 and having it slow down with each step until it reaches zero. This is nice, but I want to make is so that when one crate hits the next one the remaining force is transferred to the other crate and the first one stops. I tried doing this by saying "other.hspeed=self.hspeed, self.hspeed=0," but it doesn't seem to work. Both crates end up stopping. |
i think the issue is you havn't set a direction for the other crate to move in. it moves at the correct speed - it just doesn't move anywhere. _________________
|
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Sat Apr 22, 2006 11:15 pm Post subject: |
|
|
Nope. I don't think that matters. hspeed is the horizontal speed and it's set to a negative or positive value depending on if it's moving right or left. Because of this, I have no clue what's going on. It's almost like because it's the same object acting on the same type of object it gets confused. Any other ideas?
-Wes
EDIT: Further proof of bugs! I tried making it destroy "other" when the first block touches the other one and they both disappeared! Crazy! _________________
|
|
Back to top |
|
|
wourme .
Joined: 01 Jul 2005 Posts: 362 Location: Maridia
|
Posted: Sun Apr 23, 2006 12:27 am Post subject: |
|
|
SuperWes wrote: | Nope. I don't think that matters. hspeed is the horizontal speed and it's set to a negative or positive value depending on if it's moving right or left. Because of this, I have no clue what's going on. It's almost like because it's the same object acting on the same type of object it gets confused. Any other ideas?
-Wes
EDIT: Further proof of bugs! I tried making it destroy "other" when the first block touches the other one and they both disappeared! Crazy! |
I think the source of your problem is that both blocks register the collision, not just the moving one--each is the other's "other." One thing you can do is check whether a block is moving at the time oc the collision and if it's not, treat it differently than the one that is. If that makes sense. |
|
Back to top |
|
|
SuperWes Updated the banners, but not his title
Joined: 07 Dec 2004 Posts: 3725
|
Posted: Sun Apr 23, 2006 12:55 am Post subject: |
|
|
Oooh. That does make sense. I'll try it. Thanks!
-Wes _________________
|
|
Back to top |
|
|
a_plus .
Joined: 09 Jan 2006 Posts: 252 Location: olympia
|
Posted: Mon Apr 24, 2006 10:53 pm Post subject: |
|
|
while we're at it! i'm rather new with game maker, and mostly a beginner at coding, so bear with me. hope i'm clear with my issues!
i'm trying to make a mouse-driven character with the effects of inertia. basically, i want it to control more or less like the old mac game crystal crazy, or, i guess, a mouse-controlled asteroids? am i going to have to learn a lot of physics for this? i know very little.
i have... something started, but it just doesn't work quite right. you can move the player with the mouse and once you let go, it continues in the direction/speed it was going at the last step the mouse was moving. however! as soon as you move the mouse again, there's no effect on its speed -- it's as if you started from a standstill. what i have, as a placeholder, is this:
Code: |
if ((mouse_x == last_x) && (mouse_y == last_y))
{
motion_set(last_direction,3);
window_mouse_set(x,y);
}
|
so, it checks to see if the current mouse position is the same as the last position (via other code i didn't paste). if they're the same, aha! the mouse hasn't moved, so just drift.
that's what i'm stuck on. it... works, in a way, but there's no cumulative intertia! and i really have very little idea where to start. that speed of 3 has to go, i know, probably to be replaced with some formula.
...is that sensical? |
|
Back to top |
|
|
dessgeega loves your favorite videogame
Joined: 16 Jun 2005 Posts: 6563 Location: bohan
|
Posted: Mon Apr 24, 2006 10:59 pm Post subject: |
|
|
a_plus wrote: | i'm trying to make a mouse-driven character with the effects of inertia. basically, i want it to control more or less like the old mac game crystal crazy, or, i guess, a mouse-controlled asteroids? am i going to have to learn a lot of physics for this? i know very little. |
that is great! crystal quest/crystal crazy/crazy quest is a fine fine game.
i'm not very good with physics but i did program a mouse game a little while ago. i will try to be helpful when i am less frazzled and more awake. _________________
|
|
Back to top |
|
|
simplicio .
Joined: 03 May 2005 Posts: 1091
|
Posted: Mon Apr 24, 2006 11:03 pm Post subject: |
|
|
Yeah, Kill Your Television definitely felt like it had something. I'm not sure if it was inertia or what, but I noticed it. |
|
Back to top |
|
|
a_plus .
Joined: 09 Jan 2006 Posts: 252 Location: olympia
|
Posted: Mon Apr 24, 2006 11:05 pm Post subject: |
|
|
i betcha if i had gm6 registered i could get at the asteroids game that comes with it and get at least a bit of info! if only i weren't bro-o-o-o-oke. |
|
Back to top |
|
|
wourme .
Joined: 01 Jul 2005 Posts: 362 Location: Maridia
|
Posted: Mon Apr 24, 2006 11:08 pm Post subject: |
|
|
a_plus wrote: | ...is that sensical? |
You might want to use motion_add instead of motion_set. Set ignores the current speed and direction. And if you do it this way, you'll probably also want to set a maximum speed in the step event:
Code: | if speed > 5 then speed = 5; |
Another nice shortcut is friction. You can just put something like this in the create event:
This slows the object down by this amount each step, regardless of direction.
With Game Maker's built-in functions, you really don't need to do the math yourself unless you want to do something tricky. |
|
Back to top |
|
|
a_plus .
Joined: 09 Jan 2006 Posts: 252 Location: olympia
|
Posted: Mon Apr 24, 2006 11:16 pm Post subject: |
|
|
i think i tried motion_add before -- it just makes everything fly off the scren at a ridiculously huge speed. hrumph. |
|
Back to top |
|
|
a_plus .
Joined: 09 Jan 2006 Posts: 252 Location: olympia
|
Posted: Wed Apr 26, 2006 7:00 pm Post subject: |
|
|
so, i did find this old dos clone of crystal quest, xquest, and the source is available! now if only i could figure out wht part of it did the inertia/movement... |
|
Back to top |
|
|
J.Goodwin .
Joined: 31 Jul 2006 Posts: 297 Location: North Shore, MA
|
Posted: Sat Aug 05, 2006 6:03 pm Post subject: |
|
|
How many versions is the registration good for?
Do you get upgrades until the next major version, or no upgrades, or lifetime upgrades? _________________ Gamertag - FalcomAdol -- Don't Click Here 触手
Playing - Ninety-Nine Nights - Xbox 360 |
|
Back to top |
|
|
wourme .
Joined: 01 Jul 2005 Posts: 362 Location: Maridia
|
Posted: Sat Aug 05, 2006 10:05 pm Post subject: |
|
|
Your registration isn't guaranteed to carry over to the next major numbered release, but so far no one has had to register twice. Those who registered version 4 years ago still get the full version of 6. I suspect that this policy won't change any time soon.
It's so cheap for what you get anyway that I personally don't care either way. |
|
Back to top |
|
|
J.Goodwin .
Joined: 31 Jul 2006 Posts: 297 Location: North Shore, MA
|
Posted: Sun Aug 06, 2006 9:44 am Post subject: |
|
|
wourme wrote: | Your registration isn't guaranteed to carry over to the next major numbered release, but so far no one has had to register twice. Those who registered version 4 years ago still get the full version of 6. I suspect that this policy won't change any time soon.
It's so cheap for what you get anyway that I personally don't care either way. | Probably true.
Thanks. _________________ Gamertag - FalcomAdol -- Don't Click Here 触手
Playing - Ninety-Nine Nights - Xbox 360 |
|
Back to top |
|
|
J.Goodwin .
Joined: 31 Jul 2006 Posts: 297 Location: North Shore, MA
|
Posted: Mon Aug 14, 2006 12:21 pm Post subject: |
|
|
Well, from the diametrically opposed direction:
I've been goofing around with GameMaker with some success.
Now, Microsoft goes out and announced XNA Studio Express, and the content creator program, and just now I'm hearing that GarageGames is porting TorqueEngine, Shader, and Builder over to XNA Express.
Basically, this means that for, like $200, you can buy a game creating engine similar to GameMaker, and compile and run your games on Xbox360. The only people who would be able to compile and run them would also need those products, but from that point, you could potentially option them out to Microsoft for the XBLA (to become an XBLA developer, you have to already have made a game, basically, although it doesn't mean that you have to have made a commercial game, or that you have finished the game you're currently working on).
Is $200 peanuts for that opportunity, or is the $100 TorqueX license plus the $99 annual XNA 360/MSDN license too much?
IIRC, Net Yaroze was $750, and came with jack shit to help you make an actual game. This is light years away from that. I'm excited, which scares me, because typically, I'm pretty much obnoxiously impossible to pump up about anything that involves a verb.
Gerunds are Ok. _________________ Gamertag - FalcomAdol -- Don't Click Here 触手
Playing - Ninety-Nine Nights - Xbox 360 |
|
Back to top |
|
|
|