Game Development Community

dev|Pro Game Development Curriculum

Door Resource Version 1.0

by Tom Feni · 04/14/2006 (9:32 am) · 43 comments

Door resource version 1.0

scripts written by : Ramen Sama

dts shapes/difs created by TomFeni

textures from varios sources, ie golgatha pack.

* no engine changes required

File - Door Resource

There are various door types and movement for two types, up and side movement.
the door that slides will move in the direction of the hinges.
the up and down doors will be created in the proper direction.

add scripts and other files in apropiate folders or just drop the data and server folder in the starter.fps folder and it should place them in the right spots.

doors can be scaled to whatever you need and still work.

I will include the milkshape files for those with milkshape.

// creating doors for use in scripts //

* make your door (can be various shapes or sizes)
* texture the shape
* create 2 joints one as the base and one as the slider, assign the door to the slider joint( I named mine "open" for easy use:)
* create your animation. I used 1-30 and created first key at 1 and second key at 30
* now create a duplicate of your door( best for doors of basic shape, since I could only get one collision to work. Maybe someone else could figure out how Ramen did the doors, I couldnt ), name this as collision-1.

now your collision should move with the door in animation mode.

if your using the dts plus then create a new animation in the export screen and name it "open" to coincide with the script( you can name it whatever you wish but be sure to change it in script also ).

in game.cs add

exec("./doors/door.cs");
exec("./doors/doorMetal.cs");
exec("./doors/doorgrey1.cs");
exec("./doors/doorWood.cs");
exec("./doors/doorMetalMove.cs");

now fix the script and go in game. When you run up to the door it should open on collision.


Issues I have seen :

- only able to have one collision
- thrown objects will open the door.. :)
- rotating doors will pass thru the player model when opened.


I hope this is useful for others as it was for me.
most of the credit goes to Ramen for figuring out the code part and how to get dts shapes to work with out engine changes.. :)

TomFeni
Page«First 1 2 3 Next»
#41
04/25/2009 (2:22 pm)
if you use this line in interaction // with %distance set to 4, we can activate things that are 4m away.
%distance = 8;
you should be able to change it to find things closer or farther. I have mine set up around 8 so it can get quite close. if you change it 16 it will open further away.

and for making a new class you will need to add it in thru the engine.
then you can define your own shape class.
#42
04/28/2009 (5:51 pm)
Thanks for the resource Tom. Anyone had any luck with creating doors in Houdini? I set my objects as children and parent but it seems the exporter ignores these relations. Thanks for any help.
#43
12/26/2009 (11:11 pm)
Posted here, because I couldn't find a post with similar information anywhere....

Just in case anyone was still trying to figure out how to animate collision meshes in Blender (like I have been) After some experimentation, I have discovered the latest exporter for Blender now supports animated collision meshes! (For DTS objects at least - haven't tried with Collada export yet) Which makes things alot easier.

Seems to be because the latest DTS exporter does not require the use of empties. Just create your collision mesh in the layer you choose for Collision-1, animate it along with the visible mesh, add your animation sequence as normal in the exporter's Sequence menus (remembering to enable both Vis Anim animations, ie both visible mesh and collision mesh anims), export and Bob's your uncle - hey presto animated collision meshes. Couldn't be easier ;)
Page«First 1 2 3 Next»