Collisions with DnD

D

Dannyinformal

Guest
Hey lads,

I'm developing a basic DnD platform tutorial and I was wondering if there was a clean way to handle collisions without using the SOLID option in DnD.

With script, it's much cleaner with if (place_meeting...), but I have no idea how to do this in DnD.

Also, how would you guys handle melee attacks in DnD? Again, in script it's pretty straight foward, but when it comes to DnD the only solution I've been able to come up with is to change to an attacking object and back at the end of the animation. But this is quite buggy and resultions in sometimes losing frames or even worse; losing the complete animation.

Thanks for your help!
 

FrostyCat

Redemption Seeker
The equivalent of that in D&D is If Object At Place.

Also, whether it's done in D&D or GML, melee attacks are best handled like a ranged attack with an invisible self-destructing bullet that doesn't move. Then you check for collisions against that hitbox object for damage, and not involve the actual player object in that.
 
D

Dannyinformal

Guest
The equivalent of that in D&D is If Object At Place.

Also, whether it's done in D&D or GML, melee attacks are best handled like a ranged attack with an invisible self-destructing bullet that doesn't move. Then you check for collisions against that hitbox object for damage, and not involve the actual player object in that.
Good point; that's how I handled it in GML. I can figure out how to make a hit object spawn and make the sprite animation change to an attack sprite, but I can't figure out how to change it back to the sprite it was using before (idle or walking). Is that done through a timer?
 
R

robproctor83

Guest
I'm not sure how you handle it exactly with d&d, but ya you swap it back to the default state using a timer and a variable like can_hit that gets set to false on collision and set to true with the alarm, then when you have a collision you see if can_hit is true.
 
D

Dannyinformal

Guest
Aye, I worked out the timer with dnd, but now I can't manage to have the hitbox spawn on the correct subimage. I would normally just write an if statemen like if image_index = 3 {spawn hitbox} but with DND it just doesn't work. Very strange.
 
Top