@Smiv's.. You learn something new every day

Moderators: winston, another_commander
Code: Select all
{
"asteroid-alternative" =
{
roles = "asteroid oolite-asteroid asteroid-alternative zygoroid zygosparkle";
name = "Asteroid";
scanClass = "CLASS_ROCK";
max_flight_pitch = 0.1;
max_flight_roll = 0.1;
max_flight_speed = 5;
smooth = yes; // Set to yes if using a normal-smoothed target mesh in Blender.
model = "ZygoUgo-asteroid1.dat";
materials =
{
"ZygoUgo-asteroid1" =
{
diffuse_map = "ASTaDIFFUSE.png";
//diffuse = "1 0.9 0.7 1";
script = "ColouroidsB.js";
normal_and_parallax_map = "ZygoUgo-asteroid1-normal.png";
parallax_scale = 0.02;
parallax_bias = -0.01;
//specular_modulate_color
specular_map = "ZygoUgo-asteroid1-specularSparkles.png";
shininess = 127; // Maximum specularity - this is modulated by alpha channel of specular_map
// Originally specular = (0.8, 0.8, 0.85, 1);
specular = (0, 0, 0, 0); // Maximum intensity (and colouring) of specular effect - specular_map RGB
// is modulated by this.
};
};
};
Code: Select all
this.name = "ColouroidsB";
this.author = "ZygoUgo";
this.copyright = "Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses"
this.description = "Random tints to asteroids without external shaders";
this.version = "1.0";
function zygodiffuse(xr,xg,xb)
{
if(this.ship.hasRole("zygoroid"))
{
xr = parseInt (Math.random() * 1 + 0.15 (num.toFixed(4)+"xr"));
xg = parseInt (Math.random() * 1 + 0.13 (num.toFixed(4)+"xg"));
xb = parseInt (Math.random() * 1 + 0.1 (num.toFixed(4)+"xb"));
RGBvalues = (diffuse = "xr xg xb 1");
return RGBvalues;
}
}
Code: Select all
materials =
{
"myasteroidtexture.png" =
{
diffuse_color = {type = "randomUnitVector"; scale = 0.25;};
};
};