GameMaker: Studio

GameMaker: Studio

Zobacz statystyki:
KannaCrossing 4 października 2012 o 19:45
Edit: Problem Fixed!
I am testing out bits and pieces and for some reason when i enable physics i cant move the player.

All the collision's are fine they colide fine.
when the room is not a physics world i can move my character fine, but of course if i wanted to make a platformer (wich i do) then that is not very helpfull considering its plays like a top view game. when physics world is enabled on the room the sprite (ATM is just a ball considering i only testing out stuff) just sits there and dosnt move, i have tried making it drop a little higher than the floor and i have made it start off on the flor, none of these ways help its move, its just dosnt respond to the key press function.

Any help is apreciated!

(FYI I have the profesinal version if that makes any difrence)
Ostatnio edytowany przez: KannaCrossing; 5 października 2012 o 0:07
< >
Wyświetlanie 1-15 z 26 komentarzy
Kudzu 4 października 2012 o 19:56 
Hello! I've been having similar problems (my stuff isn't colliding correctly at all, haha). But, I've come across some tips that might be useful for you at least. First, make sure that physics is enabled both for each object and for the room itself - if physics isn't enabled for the room, it won't work. Secondly, I believe that some of the fundamental movement commands differ between using physics or not using physics; for instance, instead of saying "move at this speed when I press the right arrow key", it would be more like "apply this amount of force in this direction when I press the right arrow key" (phsyics_apply_force is one such function I think).
KannaCrossing 4 października 2012 o 20:03 
Początkowo opublikowane przez Shannon:
instead of saying "move at this speed when I press the right arrow key", it would be more like "apply this amount of force in this direction when I press the right arrow key" (phsyics_apply_force is one such function I think).
Im not quite sure I understand it fully but, the physics is enabled on both the objects adn the room so it cant be that but..
Im using the events and actions part of the objects and when i use for example, "Press right" and then add to that "start moving in direction" and set it to right, do you mean leave the speed 0 and get another action that uses force not speed?
Ostatnio edytowany przez: KannaCrossing; 4 października 2012 o 20:03
Kudzu 4 października 2012 o 20:30 
I'm new to this software myself so I'm not entirely sure, but that's what I've gleaned from examining the help resource. I could be entirely wrong but it seems like Box2D wants to calculate everything in terms of physics if physics are enabled. So, instead of telling something to just move to the right, you would instead tell the object to apply a degree of force, which would propel it in a certain direction until friction (if friction is set) caused it to slow down and stop, or until it crashed into something, thereby mimicking physics in reality (we don't move without applying force and propelling ourselves in some direction). You would probably use the same events but yeah, the actions would differ and might require some code.

Like I said though, I could be way off. Since you've lifted your object off the floor I'm guessing there's nothing around that it could be getting stuck on? Does it fall to the floor when you lift it up or does it fail to move at all?
KannaCrossing 4 października 2012 o 20:36 
Początkowo opublikowane przez Shannon:
since you've lifted your object off the floor I'm guessing there's nothing around that it could be getting stuck on? Does it fall to the floor when you lift it up or does it fail to move at all?
It falls it the floor yes, but i have also made it start on the floor.
no mater what i do when the room is a "physics world" the controlls just dont work, only thing that works is collision (the only thing i have set other than Physics and the key bindings)
_____
it might be best to mention that I actully dont know how to program or anything of simularity.
i bought this program for insperation and eventully go to a tafe/university course for programing/game deign.
I will leave with saying that I Have been diagonosed with a disability that effects me emotionly.
(in other words I need to be Inspired/Helped to continue with somthing)
Ostatnio edytowany przez: KannaCrossing; 4 października 2012 o 20:40
Kudzu 4 października 2012 o 20:41 
Unfortunately I can't get my game to stop things from falling through the floor so I can't replicate your settings, but try this and see if it works.

Add a keyboard event, let's say keyboard event <Right>. Now in the actions, go to control tab, code category, and add the "execute code" option. Double click that to open it up. Now inside of there type the following:

physics_apply_force(x, y, 0, 15);

Click all the checkboxes and test it. I can't try this myself so I could be completely off, but see if that makes the ball move at all when you press the right arrow key.

EDIT: I chose the number 15 arbitrarily, it has no special meaning and may need to be tweaked to fit your needs if this even works.
Ostatnio edytowany przez: Kudzu; 4 października 2012 o 20:43
Fable Orchid 4 października 2012 o 20:41 
I think, like Shannon said, you have to use apply force. Go into the help file and read up on the function, and if you have issues, I'll try and throw something together to help out.
KannaCrossing 4 października 2012 o 20:47 
Początkowo opublikowane przez Shannon:
Unfortunately I can't get my game to stop things from falling through the floor so I can't replicate your settings
this is what I did to stop them from falling through the floor.


For the floor I added Collision event with the player then added a comment (i just put in colision, but you can put in "i like cupcakes" if you want)
then the saem for the character/player in the sense of collision with the floor)

I then set (for the controlls)
the player/character with
Press left, right, up, down and with the coropsonding directiongs with "relitive" checked
then for the release notes i made them
"star moving in direction" set it to the middle square, set speed to -2 and checked "relitive"

hope that helps with both our problems.



Początkowo opublikowane przez MattchuDeePorkupineh:
I think, like Shannon said, you have to use apply force. Go into the help file and read up on the function, and if you have issues, I'll try and throw something together to help out.

Ill read a bit more into the Help Section on the program, so far having found much but i guess it just needs more concentration and Patince.
Ostatnio edytowany przez: KannaCrossing; 4 października 2012 o 20:48
Fable Orchid 4 października 2012 o 20:53 
Początkowo opublikowane przez TheRealTEPL:
Ill read a bit more into the Help Section on the program, so far having found much but i guess it just needs more concentration and Patince.
Being able to code a full, working game is the definition of concentration and patience. :)
Kudzu 4 października 2012 o 20:57 
Początkowo opublikowane przez TheRealTEPL:
this is what I did to stop them from falling through the floor.


For the floor I added Collision event with the player then added a comment (i just put in colision, but you can put in "i like cupcakes" if you want)
then the saem for the character/player in the sense of collision with the floor)

I then set (for the controlls)
the player/character with
Press left, right, up, down and with the coropsonding directiongs with "relitive" checked
then for the release notes i made them
"star moving in direction" set it to the middle square, set speed to -2 and checked "relitive"

hope that helps with both our problems.

Thank you for that. Unfortunately, for whatever reason, it isn't working on mine... it detects the collision, but the physics system does not seem to react to it. Gravity works fine, though. I appreciate the post in any case!
Ostatnio edytowany przez: Kudzu; 4 października 2012 o 20:57
Fable Orchid 4 października 2012 o 20:59 
Hmm..

I don't have any experience with physics at all, but I think I'm going to sit down and try to get a working example going, with a moving player.

Really curious to know what's going wrong.
Ostatnio edytowany przez: Fable Orchid; 4 października 2012 o 20:59
KannaCrossing 4 października 2012 o 21:00 
Początkowo opublikowane przez MattchuDeePorkupineh:
Hmm..

I don't have any experience with physics at all, but I think I'm going to sit down and try to get a working example going, with a moving player.

Really curious to know what's going wrong.

Alrighty, thanks a bunch, we both apriciate it!
Kudzu 4 października 2012 o 21:10 
I'm beginning to think my version is bugged and needs to be reinstalled, haha! In the middle of testing the run button just... stopped working. It compiles but it doesn't actually open the game anymore - and I didn't make any major changes that would have broken it that badly. Debug does the same thing. My problems might be related to that.
KannaCrossing 4 października 2012 o 21:11 
Początkowo opublikowane przez Shannon:
I'm beginning to think my version is bugged and needs to be reinstalled, haha! In the middle of testing the run button just... stopped working. It compiles but it doesn't actually open the game anymore - and I didn't make any major changes that would have broken it that badly. Debug does the same thing. My problems might be related to that.
Very strange, due to the fact it is such a small file size, maybe i should reinstall it as well, just in case. (we could be COMPLETLY wrong but never hurts to try XD)
Kudzu 4 października 2012 o 21:18 
BWAHAHAHA! My object now hits the ground and stops like it is supposed to! Haha. XD

I verified the file integrity through properties and that seemed to solve my problem of the game preview/debugger not running correctly. The collision problem turned out to be due to something silly and overlooked like I thought... "Sensor" somehow got ticked on one of the objects (I think one of the tutorials I was looking for told me to do it) and that stopped it from colliding properly. My issue is solved, I will try to help with yours.
KannaCrossing 4 października 2012 o 21:19 
Początkowo opublikowane przez Shannon:
BWAHAHAHA! My object now hits the ground and stops like it is supposed to! Haha. XD

I verified the file integrity through properties and that seemed to solve my problem of the game preview/debugger not running correctly. The collision problem turned out to be due to something silly and overlooked like I thought... "Sensor" somehow got ticked on one of the objects (I think one of the tutorials I was looking for told me to do it) and that stopped it from colliding properly. My issue is solved, I will try to help with yours.
LOL alrighty then XD
Yea im re downloading it anyway x3
it only take 8 mins to download so, its all good.
< >
Wyświetlanie 1-15 z 26 komentarzy
Na stronę: 1530 50

Data napisania: 4 października 2012 o 19:45
Posty: 26