Lay Footprint after Jump
by Chris "C2" Byars · in Torque Game Engine · 06/24/2006 (8:20 pm) · 12 replies
Could anyone toss up some code that modifies the footprint for walking so that when you land a jump, the footprint decal is laid down rather than nothing? My project requires no walking, only hopping. :)
Edit: Also, maybe, the foot sound to be played when landing a jump as well.
Thanks a lot in advance.
Edit: Also, maybe, the foot sound to be played when landing a jump as well.
Thanks a lot in advance.
#2
06/25/2006 (8:05 am)
What is incorrect in making the 'hopping' animation the 'run' sequence/movementAction?? If there is no other 'forward' movementAction, how would this not work? Is there Ground Transforms included with 'jumping'??? I would think that these need to be included...
#3
I could actually just go without the footprint decal. I just need to call a sound effect whenever the player lands, and I think there's something in the engine to do that already. Some after jump sound.
06/25/2006 (9:10 am)
I have a specially made script that offers extremely good control during jumps, and the keys bound to jump certain directions. Since the player is actually jumping, I felt it proper to use jump. I could actually just go without the footprint decal. I just need to call a sound effect whenever the player lands, and I think there's something in the engine to do that already. Some after jump sound.
#4
AudioProfile(ImpactLightSoftSound)?? something like that, perhaps? of the playerClass? I think is in place. Deals with 'beyond' collision callbacks??...I think. Two flavors, soft/hard...if it's still there.
06/25/2006 (10:11 am)
AH, custom code...AudioProfile(ImpactLightSoftSound)?? something like that, perhaps? of the playerClass? I think is in place. Deals with 'beyond' collision callbacks??...I think. Two flavors, soft/hard...if it's still there.
#5
06/25/2006 (10:12 am)
Works great, thanks.
#6
I am not sure what your are talking about.
What works great? How did you accomplish the task?
06/26/2006 (7:10 pm)
Rex,I am not sure what your are talking about.
Quote:C2,
What is incorrect in making the 'hopping' animation the 'run' sequence/movementAction?? If there is no other 'forward' movementAction, how would this not work? Is there Ground Transforms included with 'jumping'??? I would think that these need to be included...
What works great? How did you accomplish the task?
#7
I didn't do anything by way of the footprints, just the sound.
06/26/2006 (7:17 pm)
I just made a "thump" sound effect be the "ImpactLightSoftSound", and uncommented the code that calls it in the player datablock. Then I set minImpactSpeed to 10. So jumping's impact onto the ground makes the thump sound I want when the player hops. It also makes this sound when a collision with an object occurs, but that's perfectly fine.I didn't do anything by way of the footprints, just the sound.
#8
C2 had nice custom jumping code written, so it made my suggestion moot. It would seem the special jumping code may need the footpuff particle systems written in C++ for rendering...??
I'm glad the sound solution was simple enough!
06/27/2006 (6:30 am)
@ Frank: There is already coded the actionMovement events of forward, back, etc...in the engine. That code has the effects tied to it, sounds, particles, etc.... My question was why not make this 'hopping' animation the 'forward' movementAction...??? It's an animated sequence, whether it's moving across the ground while running[the defaut SDK forward action], or slithering, or say hopping...as C2 needed. It seems to me, that as long as the animation sequence has ground transforms included, what difference does it make that it's a 'jumping' type movement action. I am not certain if the 'jump' movementAction with the event it's tied too, would do the same...a quick and dirty hack, perhaps.C2 had nice custom jumping code written, so it made my suggestion moot. It would seem the special jumping code may need the footpuff particle systems written in C++ for rendering...??
I'm glad the sound solution was simple enough!
#9
06/30/2006 (5:51 pm)
Hey, the player object supports decals for foot prints. I was reading about it in The Game Programmers Guide to Torque. I am not sure if this is Torque 1.4 functionality or not.
#10
06/30/2006 (8:48 pm)
Yep, it sure does. But not for jumping. The footprint is only laid down during running.
#11
06/30/2006 (11:29 pm)
Umm, is there going to be any other forward motion? Does it do it when the foot triggers hit the ground? If it is a foot trigger thing then you can do it with any animation. If not I don't know how.
#12
06/30/2006 (11:51 pm)
If all you can do is hop just make it create a footprint decal whenever you hit the ground. Forget all that animation trigger crap and just copy the decal making code to happen when the jumpSurface check returns true when it wasn't the last frame.
Torque Owner Frank Carney
DemolishunConsulting Rocks!
tdn.garagegames.com/wiki/DTS/Blender/Creating_an_Advanced_Character
See section 5.9
You will have to modify the section that causes puffs in the player.cc. This is not necessarily a small task. You could try and fudge by making a particle instead of a foot puff that will lay a smudge or something on the ground. It may take some tweaking to get it to sit there and look like a footprint.