Using a dropship

Blitz3D Forums/Blitz3D Programming/Using a dropship

Luke.H(Posted 2004) [#1]
I need some help,
I want a player to be able to walk in to a dropship and the dropship be able to take off and rotate with player still able to walk and jump around inside.


I have try Parenting the player to the ship on Collision but if the ship moves up the player still falls down through the ship because of is Gravity.


Rob Farley(Posted 2004) [#2]
Create a pivot and position it at 0,0,0.

Move the drop ship.

Move the pivot the same amount as the drop ship, So the pivot does the same as the drop ship exactly.

Translate you player entityx,y,z of the pivot.

Do you usual player movement.


WolRon(Posted 2004) [#3]
If you PARENT the player to the ship, then it should impossible for them to fall through it.

Are you sure you are doing it correctly.
What Rob Farley wrote shouldn't be necessary.


Luke.H(Posted 2004) [#4]
Yes it is parented correctly, but like I said I want the player to able to move and jump inside so I need to have gravity on the player. On flat surfaces in the dropship it works for X, Z moving of the dropship but on slopping surfaces the player is falling through even when the ship is only moving X, Z. The player always falls through when the ship is moving UP.


Sledge(Posted 2004) [#5]
Can't you just move the scenery instead and leave the ship stationary? Same difference to the player, massively easier to cope with for you and your collision.


Luke.H(Posted 2004) [#6]
No, it is going to be multiplayer and other AIs are in it to.


Who was John Galt?(Posted 2004) [#7]
What you've got is 2 moving bodies you are checking for collision. Blitz can't handle this 'out of the box' so you need to do it yourself. Simplest way to do this is a fudge-

update player position, collision detection stops him moving thru ship (call players new position *A*)
updateworld()
(now to move the ship........)
move player in opposite direction to required ship movement. Blitz collisions will stop him falling through.
updateworld()
measure vector V moved by player and reset his position
to *A*
move ship in direction -V

main Updateworld()

I've probably made a pigs ear of explaining this, but you can probably find code examples if you look around. Basic idea is you are recreating the same relative movements of the 2 bodies you want to check for collision, but always moving the object that has sphere collision.


Who was John Galt?(Posted 2004) [#8]
.....or use a 3rd party collision engine.........


Sledge(Posted 2004) [#9]
Does this help get you going? The shortcuts for the purposes of demonstration are commented, you should be able to see the main cost (multiple updateworld's) immediately...

Slide-response Blitz collision against a rising mesh on an increasing angle.



dmaz(Posted 2004) [#10]
why don't you just use linepick straight down from the players feet? you can get real world coords for that pick and then stop applying gravity when the distance between the 2 fall below a certain point.

this link might help you out.
http://www.blitzbasic.com/Community/posts.php?topic=38752


aab(Posted 2004) [#11]
i had a problem like this with moving platforms rising up: i just a collission box check to see if the char was within the areas to collide, and removed gravity if it reterned true, while simultaneously moving the char the same as the platform:i used this to check the box collission area:



Luke.H(Posted 2004) [#12]
"Sledge" I got your code to work but like you said you need 2 updateworlds a loop but I don't loss too much speed, if you can do it with one I would like to see it (I think I’m being too hopeful)

dmaz and aab the ship also turned and moved in any direction and it was not just the player's gravity that was the problem, the ship was moving forward and the player went though the ship sideways when on sloped surfaces.

Thanks for all the help.