The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: Snailer on July 30, 2007, 02:04:16 PM

Title: [GM] Need help moving
Post by: Snailer on July 30, 2007, 02:04:16 PM
Well i have made a character now and have some sprites.
Yes it does move.
No, not how i want it  ;9

It moves but the sprite ain't and i try'd changing it but all i can get to work a bit is him to duck,
the moving looks like a piece of crap and everything.

I just need a good tutorial on this but all that stuff that are "Tutorials/Examples" use strange codes i dont understand.
Can anyone explain this to me :( ?
Title: Re: Need help moving
Post by: iceflame1019 on July 30, 2007, 02:50:29 PM
Hmmm...well, if you can wait a day I can make you an example when I get back home.  Very little code involved, mostly D&D.  You are trying to get the sprites to go along with the movements, right?

Hint: sprite changes for the keyboard and key release events. 
Title: Re: Need help moving
Post by: Snailer on July 30, 2007, 04:21:46 PM
ye i'm trying to make him walk when i press right or left,
And make a jumping sprite while jumping but not change the sprite till you fall down again.
Im a reall noob at this  :(
But im getting it i think.
Title: Re: Need help moving
Post by: iceflame1019 on July 30, 2007, 05:35:47 PM
It's fine.  All this can be easily shown in the demo I can put together.  The falling stuff, though, will take a bit of coding, but I'll explain it in the code window (when leaving comments in GML coding, comments are preceded by a // and the words are italicized, so the comments will look something like this:

//this code checks to see if blahblahblah)

I have...what...five hours left til I leave work.  It'll take me a bit to make the demo but I should have it ready by 10 at most if I'm not delayed by dishes waiting to be washed...(dirty dishes are pure evil cuz I get stuck with them all the time...)

After a while Game Maker gets pretty easy...you just gotta find out what the functions do in different cases.  Took me a while, though, and I'm still learning.  My current game is chock full of coding and it's all the simple stuff...you'll soon get the hang of it, though.


EDIT:  I'm terribly sorry to say this but GM's giving me issues...I hate this computer.  Also I thought it'd be easy to do with D&D but in order to get around some spritechange difficulties there's coding.  I'm explaining it though...

Man I hate this...if it gets here late, I'm very sorry...didn't expect my computer to not be able to handle various programs tonight of all nights...  :mad: I've made some progress though, so don't worry.  Biggest issue here is that the jumping sprite won't change into the falling sprite unless a key is held, I'm working on fixing that.  Or would you want to use just one sprite for both jumping/falling?  That clears a lot of trouble there. 
Title: Re: Need help moving
Post by: iceflame1019 on July 31, 2007, 01:59:20 AM
Well sorry for the double-post but after wrestling with GM I've managed this. 
 It's not perfect, since GM is acting stupid tonight, but it should give you a basic understanding.  If you're confused I'll explain, to the best of my ability.
Title: Re: Need help moving
Post by: Snailer on July 31, 2007, 02:09:41 PM
GREAT
Im sure this will help me :D
Thank you !
Title: Re: Need help moving
Post by: iceflame1019 on July 31, 2007, 04:33:22 PM
np. ;D
Title: Re: Need help moving
Post by: Snailer on July 31, 2007, 05:27:56 PM
Great my character moves now :D

But still have a couple of questions :P

1. How can i make his jumping limit to 2, so it can jump twice only because now i can jump infinite times.

2. My character gets stuck into the wall sometimes, i think the sprite is colliding with the wall or floor can i makes sure it wont collide with them but also not fall trough it.

3.Can i make him look like he is walking, like his legs will move because they are kinda stuck now.

Sorry if i'm a pain in the ass.   
Title: Re: Need help moving
Post by: &&&&&&&&&&&&& on July 31, 2007, 05:31:26 PM
3.Can i make him look like he is walking, like his legs will move because they are kinda stuck now.

You could use a gif.
Title: Re: Need help moving
Post by: Snailer on July 31, 2007, 06:09:58 PM
That doesn't really work :(
Title: Re: Need help moving
Post by: iceflame1019 on July 31, 2007, 07:20:24 PM
ooooo...that's right...ummmmmmmm...

*thinking*

Well, I'm not much of an expert on these problems...but for the double-jump you can set a variable that it checks before the jump is initiated

Post the code from the game involving the jumping and I'll reformat it for double-jumping. 
Title: Re: Need help moving
Post by: Snailer on July 31, 2007, 09:42:17 PM
I think this is my jumping code

Code: [Select]
//This sets the sprite at the beginning of the jump

if direction<90
  sprite_index=jump_right
else if direction>90
  sprite_index=jump_left
 
//This makes him actually jump
vspeed-=20

The jumping itself is an event thing
Title: Re: Need help moving
Post by: iceflame1019 on August 01, 2007, 12:34:58 AM
Okay... 
In the character's creation code, D&D the Variable button, label the variable jump_limit, and set it to 0.

Now change the jumping code in the Press Up event to this
Code: [Select]
//This makes him actually jump
if var.jump_limit<2
{
vspeed-=20
jump_limit+=1
}

Mess around with it til it works.  It should.  What it does is check if the variable is up to a limit.  If it isn't, he jumps and increases the variable so he can't jump again after two jumps.

Title: Re: Need help moving
Post by: Snailer on August 01, 2007, 01:51:29 PM
ARgh !
It keeps saying there is an error with the variable line. drives me nuts   ;9
Title: Re: Need help moving
Post by: iceflame1019 on August 01, 2007, 03:06:31 PM
oooh...ummmm...well, change the D&D variable title and the var.jump_limit to global.jump_limit.  If that doesn't work I'll ask someone cuz that's a problem.

I think the issue is that even though you create the variable and label it in the code it still doesn't find the variable.  If it doesn't work I dunno what to say, other than I can ask one of the GM mentors what the issue is.

Srry if I'm not helping... :(
Title: Re: Need help moving
Post by: Snailer on August 02, 2007, 02:47:54 PM
AH crap, my moving is all messed up now :(
I'm sorry Iceflame but it didnt really help me much.
Can maybe someone re-explain it to me ?
Title: Re: Need help moving
Post by: Arrow on August 02, 2007, 03:26:07 PM
Upload your project, and I will fix it, with lots of comments for each line of code. ;8
Title: Re: Need help moving
Post by: Snailer on August 02, 2007, 04:06:16 PM
Ok but don't laugh xD

And its danny phantom because i took the first random thing that i thought was cool to me so i could only use it to learn the program.
But if it is gonna work i will make it a reall platformer :D

I appreciate you want to help me :D

Title: Re: Need help moving
Post by: iceflame1019 on August 02, 2007, 04:07:04 PM
man, if GM had worked better...sorry I wasn't much of a help.  Oh well.
Title: Re: Need help moving
Post by: Snailer on August 02, 2007, 04:08:30 PM
Its ok Iceflame you also thought me stuff of GM i wouldnt noticed otherwise
Title: Re: Need help moving
Post by: iceflame1019 on August 02, 2007, 04:18:59 PM
yay...

As fighter from Nuklear Power says, "I'm a helper!"

yeah I think I need to get a little better with coding once I can get my personal computer to runs properly.  But at least someone benefitted...I have some purpose... ;D
Title: Re: Need help moving
Post by: Arrow on August 02, 2007, 06:25:50 PM
I'm almost done Snailer. I installed a camera system, commented each code I used, explained a few concepts, and organized your stuff. :D

*tip*: When naming objects, sprites, and sounds, do not uses spaces, and use capitalized letters sparingly. GML cannot handle spaces in names, (skips them) and capitalized letters can easily lead to user error.
Title: Re: Need help moving
Post by: iceflame1019 on August 02, 2007, 06:37:29 PM
yeah...I found that out the hard way.  If you want to use a space use a _ dash.  Always use lowercase letters, and keep the names memorable and non-confusing, and never have any two resources have the same name.
Title: Re: Need help moving
Post by: Arrow on August 02, 2007, 07:48:28 PM
Okay Snailer, here you go! For some reason, the monster won't animate. I check over all of it's code, and logically there's nothing stopping it from doing so... :-\

Everything else works really well now though. Hope you like! If you have any questions, feel free to ask.
Title: Re: Need help moving
Post by: Snailer on August 02, 2007, 08:22:43 PM
SWEEEEEEEEEEET
THANK YOU THANK YOU THANK YOOUU

And i think the camera IS working because its kinda zoomed in :P
Title: Re: Need help moving
Post by: Arrow on August 02, 2007, 08:24:18 PM
Oh yes, the camera works absolutely, its the monster though, its sprite refuses to animate.

EDIT: And you're totally welcome. ;8 Make sure to check all of the stuff in the player object section, loads of comments to teach you cool stuff, even in the code events!
Title: Re: Need help moving
Post by: Snailer on August 02, 2007, 08:25:55 PM
Yes I will
You dont even know how happy i am right now :D


THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
Title: Re: Need help moving
Post by: Arrow on August 02, 2007, 09:09:33 PM
:tpg:
Title: Re: Need help moving
Post by: Arrow on August 06, 2007, 02:29:29 AM
How goes this project? :D
Title: Re: Need help moving
Post by: Snailer on August 06, 2007, 08:36:07 AM
I've been busy for the last couple of days so I havent had too much time to work on it but i have plenty of time this week so i'll get to it ;)

:P funny you asked