Author Topic: Creating an invisible object  (Read 486 times)

Is there any way I could create an invisible small object that has no collision and set a shape name to it?
« Last Edit: August 26, 2011, 05:38:07 PM by Scars75 »

Create a static shape datablock using base/data/shapes/empty.dts and spawn it where you need it, then use setShapeName on it.

Create a static shape datablock using base/data/shapes/empty.dts and spawn it where you need it, then use setShapeName on it.
==>function ServerCmdAaaa(%cl, %aa){$poo = new StaticShapeData(MsgThing){position = %cl.player.getPosition();rotation = %cl.player.rotation;};$poo.setShapeName(%aa);}datablock StaticShapeData(MsgThing){shapeFile = "base/data/shapes/empty.dts";};
(I say "/aaaa test")
<input> (0): Unknown command setShapeName.
  Object MsgThing(24841) MsgThing -> StaticShapeData -> ShapeBaseData -> GameBaseData -> SimDataBlock -> SimObject

Code: [Select]
function ServerCmdAaaa(%cl, %aa){
$poo = new StaticShapeData(MsgThing){

position = %cl.player.getPosition();
rotation = %cl.player.rotation;
};
$poo.setShapeName(%aa);
}

datablock StaticShapeData(MsgThing){
shapeFile = "base/data/shapes/empty.dts";
}
« Last Edit: August 26, 2011, 11:15:19 PM by Scars75 »

it's just new StaticShape, and don't forget to specify its datablock

it's just new StaticShape, and don't forget to specify its datablock
Like this?

Code: [Select]
function ServerCmdAaaa(%cl, %aa){
$poo = new StaticShape(){
datablock = MsgThing;
position = %cl.player.getPosition();
rotation = %cl.player.rotation;
};
$poo.setShapeName(%aa);
}

datablock StaticShapeData(MsgThing){
shapeFile = "base/data/shapes/empty.dts";
};

Edit: it works, thanks  :cookieMonster:
« Last Edit: August 27, 2011, 02:33:08 AM by Scars75 »