There are two ways we can add models in to the game
As tsStatic shapes which inherits from sceneobject class or/and
As stacicShape which inherits from ShapeBase class
putting the models as tsStatic shape is an easy job. All we need to do is put the models in to the data folder and engine will recognise these models for us.
For static shapes its a bit more work. We need to make sure that each model has a static shape data block. Hence every object created from this datablock becomes a staticshape and inherites everything from its parent classes.
I put the all static shape data folders in to the staticShapes.cs folder, located at server/scritps.
// celtic building (not an interior)
datablock StaticShapeData(celticBuilding)
{
category = "Celticbuildings";
shapeFile = "~/data/shapes/buildings/hut.dts";
};
datablock StaticShapeData(romanBuilding1)
{
category = "romanBuildings";
shapeFile = "~/data/shapes/buildings/Building1.dts";
};
datablock StaticShapeData(romanBuilding2)
{
category = "romanBuilding";
shapeFile = "~/data/shapes/buildings/Building2.dts";
};
datablock StaticShapeData(romanBuildingData)
{
category = "romanBuilding";
shapeFile = "~/data/shapes/buildings/Building1.dts";
};
datablock StaticShapeData(romanBuildingData2)
{
category = "romanBuilding";
shapeFile = "~/data/shapes/buildings/romanbuild1.dts";
};
//torch for building shapes
datablock StaticShapeData(torchStaticShape)
{
category = "torch";
shapeFile = "~/data/shapes/lightHolder/torch.dts";
scale = "5 5 5";
};
// light holder shape used for mounting to player
datablock StaticShapeData(playerLightHolder)
{
category = "lightHolder";
shapeFile = "~/data/shapes/lightHolder/lightHolder.dts";
};
datablock StaticShapeData(fortressWall)
{
category = "fortress";
shapeFile = "~/data/shapes/buildings/fort.dts";
};
datablock StaticShapeData(marketTent)
{
category = "market";
shapeFile = "~/data/shapes/buildings/markettent.dts";
};
datablock StaticShapeData(seat)
{
category = "seat";
shapeFile = "~/data/shapes/otherModels/seat1.dts";
};
datablock StaticShapeData(table)
{
category = "table";
shapeFile = "~/data/shapes/otherModels/table1.dts";
};
datablock StaticShapeData(cart)
{
category = "cart";
shapeFile = "~/data/shapes/otherModels/cart.dts";
};
datablock StaticShapeData(stable)
{
category = "stable";
shapeFile = "~/data/shapes/buildings/stable.dts";
};
datablock StaticShapeData(fence)
{
category = "cart";
shapeFile = "~/data/shapes/otherModels/fence.dts";
};
datablock StaticShapeData(temple)
{
category = "stable";
shapeFile = "~/data/shapes/buildings/temple2.dts";
};
datablock StaticShapeData(amphi)
{
category = "stable";
shapeFile = "~/data/shapes/buildings/colis.dts";
};
our work with the staticShapes.cs is done. Now we need to execute this script to compile.
In order to do that all we need is add a single line of code in game.cs file located at server/scripts
exec("./staticShapes.cs");
Now we can see these data blocks in world editor creator and create static shapes.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment