Swimming in water help
by Tom Biagioni · in Torque Game Engine · 01/24/2009 (5:47 pm) · 6 replies
I need some help implementing the ability to swim under water a FPS im doing. I searched the site for solutions but everything i found wouldnt let me view it because it was a private forum.
I messed around with the density and viscosity of the water but that only made the water bouncy, and i couldnt move at all while i was in it.
I messed around with the density and viscosity of the water but that only made the water bouncy, and i couldnt move at all while i was in it.
#2
This resource: Swimming in one step -- standard FPS swimming physics, is rather simple to add. Keep in mind that this is just the swimming physics only, you would still need to add the animations for swimming but there are several resources that show how to do that, such as this one, but the additional animation(s) is a more sweeping and difficult modification. The swimming code will work in both TGE and TGEa, although there is a water coverage calculation addition that will also have to be made in order for it to work in TGEa.
That should cover swimming physics/movement and the possible animation(s) if you want them. Do you want to be able to drown a player also?
01/27/2009 (8:37 am)
It's a GarageGames preference that source code changes/additions all be kept in private forums so that we would have to be valid owners in order to view them. It shows you as a Torque Owner so you should be able to view the relevant resources. This resource: Swimming in one step -- standard FPS swimming physics, is rather simple to add. Keep in mind that this is just the swimming physics only, you would still need to add the animations for swimming but there are several resources that show how to do that, such as this one, but the additional animation(s) is a more sweeping and difficult modification. The swimming code will work in both TGE and TGEa, although there is a water coverage calculation addition that will also have to be made in order for it to work in TGEa.
That should cover swimming physics/movement and the possible animation(s) if you want them. Do you want to be able to drown a player also?
#3
I really appreciate you helping me out here too. Im working on a couple games for school, and ive been wanting to impliment this.
01/27/2009 (9:02 am)
Thanks Michael:) Where exactly do i find player.cpp (Or .cc?) All i can find is player.cs. THis is the problem ive been running into, i havent been able to find that player file.I really appreciate you helping me out here too. Im working on a couple games for school, and ive been wanting to impliment this.
#4
* player.cs is a script file. Torque scripts are compiled in-game at run-time.
01/27/2009 (5:24 pm)
* player.cpp (engine/source/T3D) and/or player.cc (engine/game) are source code files. CPP files are for TGEa and CC files are for TGE. Once you apply the swimming (and/or animations) resources to the source code and recompile to produce a new executable then you will be able to swim. * player.cs is a script file. Torque scripts are compiled in-game at run-time.
#6
01/27/2009 (11:13 pm)
ah thanks
Torque Owner Tom Biagioni