Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Collisions  (Read 3142 times)

0 Members and 1 Guest are viewing this topic.
Collisions
« on: October 07, 2012, 08:53:55 pm »
  • It's the grineer
  • *
  • Reputation: +17/-2
  • Offline Offline
  • Gender: Male
  • Posts: 1083
Okay, so, I'm having problems with this. I can't make Link collide against a wall, or in this case, a furnace. It's  kind of frustrating, as I don't know what should I do. Can someone help me at this?
Logged
Re: Collisions
« Reply #1 on: October 08, 2012, 12:33:33 am »
  • AKA "Micah DS"
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1347
Are you using 4Sword and Niek's MC Engine, or something you made? Can you show your code for collisions?

If you're simply checking for solids, then be sure the furnace is solid. Otherwise you might specifically have to check for the furnace object. Or make a generic solid object and have it be a parent to the furnace (and any other objects you want to collide with) so you only have to check for the one solid object, which saves you a lot of coding in the long run.

Anyway, if you show me some code and/or explain a bit better what it's doing and what you want it to do, I should be able to help (if no one else does first).
Logged
  • My Music
Re: Collisions
« Reply #2 on: October 08, 2012, 01:09:36 am »
  • It's the grineer
  • *
  • Reputation: +17/-2
  • Offline Offline
  • Gender: Male
  • Posts: 1083
I'm using Niek and 4Sword's enginge, and I already made the objects solid, but Link still doesn't collide.
Logged

Zhello

N.A.D.I.
Re: Collisions
« Reply #3 on: October 08, 2012, 01:12:55 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
So when objLink hits the solid object he passes through or you want him to stop completely? Or is objLink pushing when walking into the solid object?  :huh:
Logged
The IT Guy
Intermediate Coder
Linux is a wonderful thing
~Linkwolf48/Gumstone1080~

The Legend of Zelda - New Beginnings

http://zfgc.com/forum/index.php?topic=34986.0
1.6 Demo -
https://www.dropbox.com/s/56km0iadaras56g/LoZNB%20Game%20Folder.rar?dl=0


Side Projects:

Dragon Diary - Cybernetic Threat
Story: http://wiki.zfgc.com/Cybernetic_Threat

Quote
Aero88
ZFGC is like the Hotel California.  You can come in but you can never leave!

devianart: http://linkwolf48.deviantart.com/
Re: Collisions
« Reply #4 on: October 08, 2012, 01:16:34 am »
  • It's the grineer
  • *
  • Reputation: +17/-2
  • Offline Offline
  • Gender: Male
  • Posts: 1083
I want him to completely stop. I also put the parent, but still isn't solid. I'm leaving attached a .rar with the .gmk file, so you can see it and tell me what's wrong.
« Last Edit: October 08, 2012, 01:18:14 am by BlazeBigBang »
Logged
Re: Collisions
« Reply #5 on: October 08, 2012, 01:21:03 am »
  • AKA "Micah DS"
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1347
I want him to completely stop. I also put the parent, but still isn't solid. I'm leaving attached a .rar with the .gmk file, so you can see it and tell me what's wrong.

Not seeing the attachment? :huh:

EDIT: Nvm, I was too quick I guess.
Logged
  • My Music
Re: Collisions
« Reply #6 on: October 08, 2012, 01:39:23 am »
  • AKA "Micah DS"
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1347
Ok, for one thing, practically nothing works correctly, like ledge jumping, any of the solids, etc. Only ice and falling in holes appears to work properly. I think Link's sprites for walking up and down need to have their origin fixed as well or they just need to be centered or something (left and right animations seem fine), but the sprites aren't what is causing the problem.

I think you just messed up some of the original engine somehow. I'm not sure if you did copy and paste and just missed some stuff or what, but it's clear that some key mechanics are screwed up. I'll check it out some more and see if I can figure it out. I'm gonna download the MC Engine again if I can find it, and I should be able to help then. That is, if no one else helps first.

EDIT:
Huh, the search finds nothing??? It didn't even find anything by searching for "engine"... What's up with that? So yeah, I can't find the MC Engine, but Diminish just posted below (as you can see) and he obviously knows more about it than I do, so no worries I guess.
« Last Edit: October 08, 2012, 01:44:53 am by Frozenç‚Ž »
Logged
  • My Music
Re: Collisions
« Reply #7 on: October 08, 2012, 01:39:35 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Ha, some of the old code looks a little bit ridiculous and non-friendly. Anyway I think I figured out what the problems are in that no collisions are happening:
1) the sprite for mskShadow is empty, mskShadow is Link's collision mask. This is used in order to determine what Link is colliding with. Go into the sprite mskShadow and insert a blank, change its size to 14x7, and fill it with a non-transparent color.
2) for the furnace object, you need to change its parent object to parObstacle or parSolid, it shouldn't matter. parObstacle is the parent of all objects that can be run into though. Delete the collision event in the furnace object as well, it isn't needed.
3) change Link's properties so that he starts off as solid (check the solid box). If I remember right, I used Link not being solid to do ledge jumping, and the collision code is set up such that if Link is not solid, he can go through anything.
4) oh, and change the furnace's collision code to non-precise.
« Last Edit: October 08, 2012, 01:43:01 am by Diminish »
Logged
Re: Collisions
« Reply #8 on: October 08, 2012, 01:48:12 am »
  • It's the grineer
  • *
  • Reputation: +17/-2
  • Offline Offline
  • Gender: Male
  • Posts: 1083
There it goes! I downloaded again the engine, added the room and the object and worked. I'm gonna make a new copy, and then test to see if it's working. I'll tell you when I'm done.
Logged
Re: Collisions
« Reply #9 on: October 08, 2012, 03:12:53 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Another thing I failed to mention, while I can understand having the furnace as an object so that its sprite can be the animating flame - if the furnace is never going to move from its current position, it would be best to have the furnace represented with tiles, have an invisible wall placed where you would collide with that furnace, and then possibly have the flame animation be all that consists for the furnace object.

It doesn't matter much now, but if you add objects similarly to how you have, it'll bog down the game eventually. In other implementations of the engine, I used tile collisions for simple walls in order to reduce the number of wall objects (and because the tile-based method works in the free versions of Game Maker). I'll try to adapt that code more so that it works with the many features presented in the other engines.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.155 seconds with 55 queries.

anything