Blockland Forums > Modification Help
Creating an invisible object
Pages: (1/1)
Scars75:
Is there any way I could create an invisible small object that has no collision and set a shape name to it?
Amade:
Create a static shape datablock using base/data/shapes/empty.dts and spawn it where you need it, then use setShapeName on it.
Scars75:
--- Quote from: Amade on August 26, 2011, 07:02:04 PM ---Create a static shape datablock using base/data/shapes/empty.dts and spawn it where you need it, then use setShapeName on it.
--- End quote ---
==>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: ---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";
}
--- End code ---
Amade:
it's just new StaticShape, and don't forget to specify its datablock
Scars75:
--- Quote from: Amade on August 27, 2011, 01:50:37 AM ---it's just new StaticShape, and don't forget to specify its datablock
--- End quote ---
Like this?
--- Code: ---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";
};
--- End code ---
Edit: it works, thanks :cookieMonster:
Pages: (1/1)