Page 2 of 5

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 5:31 pm
by another_commander
Many moons ago, Frame did a Ship Registration ID OXP, which was using shaders for applying decal IDs on ships. It's still here: https://bb.oolite.space/viewtopic.php?t=7579 and here: http://wiki.alioth.net/index.php/RegistrationID

However, this was done using the pre-1.80 ship set, so it probably won't work with the newer versions. It could still give an idea of how something like custom decals could be done, though.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 5:51 pm
by spara
Well. It is possible to change Griff's decals on the fly via script... 8)

Image

Could not get the spinning ship in the station interface to change decal though. It's probably handled some how differently.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 5:54 pm
by spara
And if some one is interested in exploring this further, this is the script I used:

Code: Select all

this._changeDecal = function() {
  var shader = player.ship.getShaders();
  shader.Hull.textures[3] = "spara_decal.png";
  player.ship.setShaders(shader);
}

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 5:57 pm
by BlackWolf
So jealous of all you script writers and coders. lol
All I can contribute is art.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 6:08 pm
by DataPacRat
spara wrote: Mon Feb 26, 2018 5:54 pm
And if some one is interested in exploring this further, this is the script I used:

Code: Select all

this._changeDecal = function() {
  var shader = player.ship.getShaders();
  shader.Hull.textures[3] = "spara_decal.png";
  player.ship.setShaders(shader);
}
I'm just starting to experiment with Griff's models (my memory is that my laptop can't handle them, but I've got Griff's Cobra3 installed, and the spinning startup model seems to be working); but I'm getting them through the Expansions Manager, which installs them into the software directory, which I need to start fiddling with root access to modify.

How much more than this script would be required to make a quickie OXP, in the ~/.Oolite/Addons directory, where I can toss my preferred image into?

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 6:19 pm
by spara
DataPacRat wrote: Mon Feb 26, 2018 6:08 pm
spara wrote: Mon Feb 26, 2018 5:54 pm
And if some one is interested in exploring this further, this is the script I used:

Code: Select all

this._changeDecal = function() {
  var shader = player.ship.getShaders();
  shader.Hull.textures[3] = "spara_decal.png";
  player.ship.setShaders(shader);
}
I'm just starting to experiment with Griff's models (my memory is that my laptop can't handle them, but I've got Griff's Cobra3 installed, and the spinning startup model seems to be working); but I'm getting them through the Expansions Manager, which installs them into the software directory, which I need to start fiddling with root access to modify.

How much more than this script would be required to make a quickie OXP, in the ~/.Oolite/Addons directory, where I can toss my preferred image into?
Here's my quick test-oxp. Uncompress to AddOns, start the Debug console and Oolite, start a game with Griff's normal mapped Cobra, launch and execute worldScripts["change_decal"]._changeDecal(); in the console.

https://app.box.com/s/rmhvgrsvdvarh6snupitda5eer6utdva

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 6:30 pm
by Commander_X
DataPacRat wrote: Mon Feb 26, 2018 6:08 pm
How much more than this script would be required to make a quickie OXP, in the ~/.Oolite/Addons directory, where I can toss my preferred image into?
You can always make an OXP out of an OXZ by:
1. move the OXZ away from the ManagedAddOns folder
2. Expand (extract, unzip) the OXZ in an corresponding named folder with the extension oxp under ~/.Oolite/AddOns (e.g. MyMod.oxz will be dumped in ~/.Oolite/AddOns/MyMod.oxp)
3. Tweak the content under the oxp folder
These steps must be taken without having Oolite started.
Various tweaks at 3. might require you to restart Oolite with Shift key pressed, to regenerate the cache file, and enjoy (YMMV ;) ) the changes.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 6:36 pm
by DataPacRat
spara wrote: Mon Feb 26, 2018 6:19 pm
DataPacRat wrote: Mon Feb 26, 2018 6:08 pm
spara wrote: Mon Feb 26, 2018 5:54 pm
And if some one is interested in exploring this further, this is the script I used:

Code: Select all

this._changeDecal = function() {
  var shader = player.ship.getShaders();
  shader.Hull.textures[3] = "spara_decal.png";
  player.ship.setShaders(shader);
}
I'm just starting to experiment with Griff's models (my memory is that my laptop can't handle them, but I've got Griff's Cobra3 installed, and the spinning startup model seems to be working); but I'm getting them through the Expansions Manager, which installs them into the software directory, which I need to start fiddling with root access to modify.

How much more than this script would be required to make a quickie OXP, in the ~/.Oolite/Addons directory, where I can toss my preferred image into?
Here's my quick test-oxp. Uncompress to AddOns, start the Debug console and Oolite, start a game with Griff's normal mapped Cobra, launch and execute worldScripts["change_decal"]._changeDecal(); in the console.

https://app.box.com/s/rmhvgrsvdvarh6snupitda5eer6utdva
Welp, looks like I've got more fiddling to do to get it to work:

Code: Select all

Exception: TypeError: shader.Hull is undefined
    Active script: oolite-debug-console 1.86
    script.js, line 6:
      log("test", shader.Hull.textures);
(For the moment, I think I'll just spend some time downloading all the rest of the Griff retextures while reading some fiction.)

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 6:55 pm
by spara
Yep, Griff's normalmapped ships are required. At least Cobra III, I suppose.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 7:39 pm
by Cody
No decals on Griff's Moray though - that has amazing squid-like hull effects instead. Get up-close to one and annoy it.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 7:51 pm
by spara
The thing that does not work with this method, are mission screens that show player ship as well as the spinning ship on status screen. In theory by jumping tricky hoops, one might be able to catch mission screens that show player ship and manipulate that, but I have no idea how to script the spinning ship on status screen.

In short, this method would need some core changes to catch those manifestations of the player ship.

As far as I can seen, the only all around solution currently would be defining as many different player ships as there are decals and instead of changing the decal, one changes the ship. That would be overkill for such a small feature though.

If only there was a way to access some missionvariable or worldscript from a shader...

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 7:57 pm
by DataPacRat
DataPacRat wrote: Mon Feb 26, 2018 6:36 pm
spara wrote: Mon Feb 26, 2018 6:19 pm
DataPacRat wrote: Mon Feb 26, 2018 6:08 pm


I'm just starting to experiment with Griff's models (my memory is that my laptop can't handle them, but I've got Griff's Cobra3 installed, and the spinning startup model seems to be working); but I'm getting them through the Expansions Manager, which installs them into the software directory, which I need to start fiddling with root access to modify.

How much more than this script would be required to make a quickie OXP, in the ~/.Oolite/Addons directory, where I can toss my preferred image into?
Here's my quick test-oxp. Uncompress to AddOns, start the Debug console and Oolite, start a game with Griff's normal mapped Cobra, launch and execute worldScripts["change_decal"]._changeDecal(); in the console.

https://app.box.com/s/rmhvgrsvdvarh6snupitda5eer6utdva
Welp, looks like I've got more fiddling to do to get it to work:

Code: Select all

Exception: TypeError: shader.Hull is undefined
    Active script: oolite-debug-console 1.86
    script.js, line 6:
      log("test", shader.Hull.textures);
(For the moment, I think I'll just spend some time downloading all the rest of the Griff retextures while reading some fiction.)
And I've now got the full set of Griff's textures, have gotten a Cobra 3 with one of the gs resprays, launched, ran worldScripts["change_decal"]._changeDecal(); in the debug console... and got the exact same error message in the debug console.

For all I know, it might be a video-hardware thing; I'm running on a Thinkpad T410 with a NVIDIA Quadro NVS 3100M, if that means anything to anyone here.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 8:16 pm
by Cody
There's a line in the Latest.log that'll tell you whether shaders are supported.

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 8:37 pm
by DataPacRat
Cody wrote: Mon Feb 26, 2018 8:16 pm
There's a line in the Latest.log that'll tell you whether shaders are supported.
Do you mean 02:07:27.329 [rendering.opengl.shader.support]: Shaders are supported.? (Via.)

Re: Decals and Nose art.

Posted: Mon Feb 26, 2018 8:52 pm
by spara
After installing Griff's normalmapped ships, does the spinning Cobra at the welcome screen have a decal? The one with the comic style skull.