ZygoUgo's OXPs!
Moderators: winston, another_commander
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Downloaded - I'll give it a go. This quirk catches people all the time. I did correct my version, so have been enjoying these for a few days now. I can't run shaders but they are still lovely.
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Yep, that works nicely...
Looks like it's covered in space-Lichen - weird but nice.
By the way the .png extension can be upper or lower-case as long as they are the same. Lower-case is probably more conventional.
Looks like it's covered in space-Lichen - weird but nice.
By the way the .png extension can be upper or lower-case as long as they are the same. Lower-case is probably more conventional.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Nonono!
The craters are revealing brigher material underneath the much darker surface layer... As per the dirty snoball concept adopted for most comet nuclei!
The craters are revealing brigher material underneath the much darker surface layer... As per the dirty snoball concept adopted for most comet nuclei!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- maik
- Wiki Wizard
- Posts: 2028
- Joined: Wed Mar 10, 2010 12:30 pm
- Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)
I linked to this thread in the new work in progress list in the Wiki. Hope that's ok.
Thanks everyone
Erm, bit of a muddle at the mo as I'm trying to grasp basic scripting/plist interaction.
The script probably doesn't even function, but until I can get the Ship data to read it I can't test it.. Help!!
Here's the first entry in ship data, followed by the script. I'm guessing I just can't do it this way, but why? I need to understand, thanks for any help!
And the script..
EDIT.. Ooh yeah, the values reading 0.1.. of Math.random are only where they are to allow strong colours for testing, the 0.1's will be replaced by 0.9's and are weighted towards the brown range, but should allow for other subtle colours too.
Erm, bit of a muddle at the mo as I'm trying to grasp basic scripting/plist interaction.
The script probably doesn't even function, but until I can get the Ship data to read it I can't test it.. Help!!
Here's the first entry in ship data, followed by the script. I'm guessing I just can't do it this way, but why? I need to understand, thanks for any help!
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;
}
}
- Cmd. Cheyd
- ---- E L I T E ----
- Posts: 934
- Joined: Tue Dec 16, 2008 2:52 pm
- Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...
Wait for someone more knowledgeable than I to wander by, but I think you'll find the stuff you're doing in a script actually needs to be done in a shader.
Find my OXP's at:
Deep Horizon Industries - Your Planet Our Design
Deep Horizon Industries - Your Planet Our Design
Ah, well, my thinking is that the 'diffuse' calling is already inbuilt without shaders which is why I'm trying to bend it to mix colours, in order for it to still work with shaders turned off, my logic being that the military manta ray is still coloured in this mode as I have re-painted it a bright green in my version.
However I have little knowledge on the details of this myself either
However I have little knowledge on the details of this myself either
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Hi! The problem is I want this to still work with shaders turned off, any advice from Griff is more than welcome. The script is only there to act as a DLL to spit out the variable that should be at that particular line in the ship-data, it shouldn't necessarily have anything to do with ship colours.
It would be the same thing if I wanted gun co-ordinates in the shipdata to vary randomly by being read from a script instead.
No idea I'm probably being nieve so as I said, any help is more than welcome.
It would be the same thing if I wanted gun co-ordinates in the shipdata to vary randomly by being read from a script instead.
No idea I'm probably being nieve so as I said, any help is more than welcome.
By the way, you can change the material of a ship/entity (ie its texture) using javascript now.
If the player isn't using shaders (yep, detectable via js! ), you could switch between 2 (or 3, etc) slightly different non-shader textures...
If the player isn't using shaders (yep, detectable via js! ), you could switch between 2 (or 3, etc) slightly different non-shader textures...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Erk! RTFM Griff!
Last edited by Griff on Mon Nov 01, 2010 9:44 pm, edited 3 times in total.
That's not what Kaks is saying - you can apply tints to textures via js using the setMaterials property.
It's not quite as powerful as using a different texture (although that is also possible by js), but you can use it to dye a texture a different colour, or to change some of the other attributes.
One of my recent OXPs uses this technique - I don't remember offhand which one I did it in though.
It's not quite as powerful as using a different texture (although that is also possible by js), but you can use it to dye a texture a different colour, or to change some of the other attributes.
One of my recent OXPs uses this technique - I don't remember offhand which one I did it in though.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Well i never, i didn't realise all that stuff was possible! So can the 'Materials' access the randomUnitVector stuff that the shaders can, eg would this work?
Code: Select all
materials =
{
"myasteroidtexture.png" =
{
diffuse_color = {type = "randomUnitVector"; scale = 0.25;};
};
};