setRandomSeed(); //设置随机种子
%x = getRandom(6, -4); //在指定范围获取随机数
%y = getRandom(6, -4);
%z = getRandom(1, 25);
//%cube.position = "%x %y %z";
%cube = new TSStatic()
{
shapeName = "art/shapes/cube/cube.cached.dts";
playAmbient = "1";
receiveSunLight = "1";
receiveLMLighting = "1";
useCustomAmbientLighting = "0";
customAmbientLighting = "0 0 0 1";
collisionType = "Visible Mesh";
decalType = "Collision Mesh";
allowPlayerStep = "1";
renderNormals = "0";
forceDetail = "-1";
position = %x SPC %y SPC %z;
rotation = "0 0 1 195.952";
scale = "1 1 1";
isRenderEnabled = "true";
canSaveDynamicFields = "1";
};
echo(%cube.position);
MissionCleanup.add(%cube);
为了连接变量使用SPC就可以将N个变量连接。