Decals and Nose art.

General discussion for players of Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5394
Joined: Wed Feb 28, 2007 7:54 am

Re: Decals and Nose art.

Post by another_commander » Mon Feb 26, 2018 5:31 pm

Many moons ago, Frame did a Ship Registration ID OXP, which was using shaders for applying decal IDs on ships. It's still here: http://www.aegidian.org/bb/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.

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » Mon Feb 26, 2018 5:51 pm

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.

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » 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);
}

User avatar
BlackWolf
---- E L I T E ----
---- E L I T E ----
Posts: 289
Joined: Thu Feb 15, 2018 9:30 am
Location: Texas

Re: Decals and Nose art.

Post by BlackWolf » Mon Feb 26, 2018 5:57 pm

So jealous of all you script writers and coders. lol
All I can contribute is art.
Creativity is a gift, use it well.

User avatar
DataPacRat
Dangerous
Dangerous
Posts: 73
Joined: Sun Feb 18, 2018 12:21 pm
Location: Niagara, Canada
Contact:

Re: Decals and Nose art.

Post by DataPacRat » 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?
Thank you for your time,
--
DataPacRat
"Does aₘᵢₙ=2c²/Θ ? I don't know, but wouldn't it be fascinating if it were?"

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » 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

Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 269
Joined: Sat Aug 09, 2014 4:16 pm

Re: Decals and Nose art.

Post by Commander_X » Mon Feb 26, 2018 6:30 pm

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.

User avatar
DataPacRat
Dangerous
Dangerous
Posts: 73
Joined: Sun Feb 18, 2018 12:21 pm
Location: Niagara, Canada
Contact:

Re: Decals and Nose art.

Post by DataPacRat » 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
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.)
Thank you for your time,
--
DataPacRat
"Does aₘᵢₙ=2c²/Θ ? I don't know, but wouldn't it be fascinating if it were?"

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » Mon Feb 26, 2018 6:55 pm

Yep, Griff's normalmapped ships are required. At least Cobra III, I suppose.

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13591
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Decals and Nose art.

Post by Cody » Mon Feb 26, 2018 7:39 pm

No decals on Griff's Moray though - that has amazing squid-like hull effects instead. Get up-close to one and annoy it.

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » Mon Feb 26, 2018 7:51 pm

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...

User avatar
DataPacRat
Dangerous
Dangerous
Posts: 73
Joined: Sun Feb 18, 2018 12:21 pm
Location: Niagara, Canada
Contact:

Re: Decals and Nose art.

Post by DataPacRat » Mon Feb 26, 2018 7:57 pm

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.
Thank you for your time,
--
DataPacRat
"Does aₘᵢₙ=2c²/Θ ? I don't know, but wouldn't it be fascinating if it were?"

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13591
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Decals and Nose art.

Post by Cody » Mon Feb 26, 2018 8:16 pm

There's a line in the Latest.log that'll tell you whether shaders are supported.

User avatar
DataPacRat
Dangerous
Dangerous
Posts: 73
Joined: Sun Feb 18, 2018 12:21 pm
Location: Niagara, Canada
Contact:

Re: Decals and Nose art.

Post by DataPacRat » Mon Feb 26, 2018 8:37 pm

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.)
Thank you for your time,
--
DataPacRat
"Does aₘᵢₙ=2c²/Θ ? I don't know, but wouldn't it be fascinating if it were?"

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2550
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Decals and Nose art.

Post by spara » Mon Feb 26, 2018 8:52 pm

After installing Griff's normalmapped ships, does the spinning Cobra at the welcome screen have a decal? The one with the comic style skull.

Post Reply