Game Development Community

dev|Pro Game Development Curriculum

PathShape

by Stefan Beffy Moises · 12/08/2003 (8:52 am) · 61 comments

Download Code File

**********************************************************
* A modified PathCamera object that enables you to move
* static shapes (DTS files) along (camera) paths
* This will only work in Release 1.2 or HEAD since it is based on
* the new PathCamera stuff!!!
**********************************************************


Here is how to add a pathed shape to your game:

Add the .cc and .h file to engine/game, add them to your project and recompile the engine...
copy pathShape.cs to your "example/demo/server/scripts/" folder e.g.
and exec it in "game.cs" as usually...
then add the path to your shape in that file:
datablock PathShapeData(LoopingShape)
{
   emap = true;
   // put path to your shape here!!
   shapefile = "~/data/shapes/foo/bar.dts";
   mode = "";
};

You can add a PathShape like this from script e.g.:
// --> beffy: create pathed shape start ! :)
%pathshape = new PathShape() {
    dataBlock = LoopingShape;
    // set position to whatever suits your needs...
    position = "102.46 155.34 98.22";
};
// give it a path to follow:
%pathshape.followPath("MissionGroup/Scenes/TerrainEngineScene/Path");
// cleanup
MissionCleanup.add( %pathshape );
// <-- beffy: create pathed shape end ! :)
Page«First 1 2 3 4 Next»
#61
03/18/2010 (8:44 pm)
hi,there is a bug that actor always face a direction(object y-axis) rather than face the path direction. I want know where could add this function.
Page«First 1 2 3 4 Next»