Page 2 of 3

Re: Extra Rock Hermits

Posted: Sun Feb 04, 2024 8:10 am
by phkb
Small patch just released, taking this to v1.3. I had the descriptions file named incorrectly.

Re: Extra Rock Hermits

Posted: Sun Feb 04, 2024 1:23 pm
by cbr
Image

Any plans for externally docking ships?

(simulated image)

Re: Extra Rock Hermits

Posted: Sun Feb 04, 2024 1:29 pm
by phkb
Not at present. When I look at the extra dock, it looks like a landing pad, next to a small runway in front of a door. My imagination says any ships that use this pad are automatically drawn inside using automation, which is why you don't see ships docked externally, and why the player will launch from the main dock, not the external one, when they depart the Rock Hermit.

Re: Extra Rock Hermits

Posted: Wed Feb 07, 2024 6:21 pm
by cbr
Image

I may be wrong but I believe the rocks normalmaps do not contain complete normalmap data,
here an example with a normalmap(rgb) used with the current materials setting.

Re: Extra Rock Hermits

Posted: Sun Feb 11, 2024 4:17 am
by phkb
cbr wrote: Wed Feb 07, 2024 6:21 pm
I may be wrong but I believe the rocks normalmaps do not contain complete normalmap data,
OK, I've redone the normal maps - hopefully they'll look better now. v1.4 available in the manager.

Re: Extra Rock Hermits

Posted: Fri Feb 16, 2024 8:36 pm
by cbr

Code: Select all

    if (!num) num = 0;
    
    var textures1 = ["griff_cbr_main1", "griff_cbr_main2", "griff_cbr_main3", "griff_cbr_main4"];
    var seed1 = (system.ID + this.ship.primaryRole.length) * 2;
    var maintype = (parseInt(system.scrambledPseudoRandomNumber(seed1) * 4) + num) % 4;
    var diff1 = textures1[maintype] + ".png";
    this.ship.setMaterials({"griff_erh_mainhull.png":{diffuse_map:diff1,gloss:0.4,specular_color:[0.1, 0.1, 0.1, 1.0]}});

    // pick from our available rock textures
    var textures = ["griff_erh_rock1", "griff_erh_rock2", "griff_erh_rock3", "griff_erh_rock4"];
    var seed = (system.ID + this.ship.primaryRole.length) * 2;
    var rocktype = (parseInt(system.scrambledPseudoRandomNumber(seed) * 4) + num) % 4;
    var diff = textures[rocktype] + ".png";
    var norm = textures[rocktype] + "_normal.png";
    var spec = textures[rocktype] + "_specular.png";

    this.ship.setMaterials({"griff_spacebar_rock.png":{
        diffuse_map:diff,
        normal_map:norm,
        specular_map:spec,
        gloss:0.4,
        specular_color:[0.1, 0.1, 0.1, 1.0]}
    });

    var subents = this.ship.subEntities;
Is this a correct way to add variations?

Re: Extra Rock Hermits

Posted: Fri Feb 16, 2024 10:07 pm
by phkb
cbr wrote: Fri Feb 16, 2024 8:36 pm
Is this a correct way to add variations?
I'm not sure. If the base model (what "this.ship" is referring to) is the same as what's in my original, then no, that won't work. All the buildings and docks are subentities. You seem to be trying to set the materials of the base model twice, once for "griff_erh_mainhull.png", and then once for "griff_spacebar_rock". If you have created variations on the main buildings, you'd need to apply it to subentity 3 (which is index 2).

Code: Select all

 this.ship.subEntities[2].setMaterials({"griff_erh_mainhull.png":{diffuse_map:diff1,gloss:0.4,specular_color:[0.1, 0.1, 0.1, 1.0]}});

Re: Extra Rock Hermits

Posted: Sat Feb 17, 2024 2:24 pm
by cbr
phkb wrote: Fri Feb 16, 2024 10:07 pm
All the buildings and docks are subentities. You seem to be trying to set the materials of the base model twice, once for "griff_erh_mainhull.png", and then once for "griff_spacebar_rock". If you have created variations on the main buildings, you'd need to apply it to subentity 3 (which is index 2).
Ah thanks! Well that explained the missing rock texture as i was setting the mainhull texture for it. :roll:

So the this.ship refers to the shipdata.plist entry with in this case
script = "erh_spawn.js" in it.

In the script:
this.ship.subEntities[X] on the subentities ( 0 - X )of the referred ship

Re: Extra Rock Hermits

Posted: Sat Feb 17, 2024 8:37 pm
by cbr

Code: Select all

21:28:27.450 [script.javaScript.exception.uncaughtException]: ***** JavaScript exception (ExtraRockHermit_Spawn 1.4): uncaught exception: Invalid settings: target entity is not a station.
After Unzipping a new erh 1.4 I encountered this error.
I use a vintage systemaddships script to add test objects in this case extrarockhermits in the area, but they are all the same?

Re: Extra Rock Hermits

Posted: Sun Feb 18, 2024 3:00 am
by phkb
cbr wrote: Sat Feb 17, 2024 8:37 pm
After Unzipping a new erh 1.4 I encountered this error.
I use a vintage systemaddships script to add test objects in this case extrarockhermits in the area, but they are all the same?
That's weird. I'd need to see your script to work out what might be happening in this case.

Re: Extra Rock Hermits

Posted: Sun Feb 18, 2024 11:09 am
by cbr
Config script.s contains only this

Code: Select all

this.shipWillLaunchFromStation = function(station)
	{
    system.addShips("extrarockhermit", 40, player.ship.position, 9999);
	}
had to change a value in the condition.js 0.35 => 0.99

& changed this in erh_spawn.js

Code: Select all

    //eds.$addExternalDock({station:this.ship, position:[-550, 0, 22], scale:0.5, preDockCallback:this.$preDockSetup.bind(this)});
    eds.$addExternalDock(this.ship, [-550, 0, 22], 0.5, this.$preDockSetup.bind(this));
to have them show up without error...

Re: Extra Rock Hermits

Posted: Sun Feb 18, 2024 11:45 am
by phkb
That's still strange. I just made the change to 0.35 value in the condition script, and with no other changes, was able to spawn 40 rock hermits using your spawning code. I didn't need to change the EDS code. Do you have the latest version of that? 1.3 is the latest release.

Re: Extra Rock Hermits

Posted: Sun Feb 18, 2024 12:26 pm
by cbr
phkb wrote: Sun Feb 18, 2024 11:45 am
Do you have the latest version of that? 1.3 is the latest release.
Duh, had 1.1, all is well for now :!:

Re: Extra Rock Hermits

Posted: Mon May 06, 2024 5:17 pm
by cbr
Image

Image

Drop in dome, could be used for erh variants, astrofarms or biodomes.
Current screenshots uses a gray diffusemap and the normal/spec map from erh, hence the industrial look ;)

Re: Extra Rock Hermits

Posted: Mon May 06, 2024 11:04 pm
by phkb
cbr wrote: Mon May 06, 2024 5:17 pm
Drop in dome, could be used for erh variants, astrofarms or biodomes.
Current screenshots uses a gray diffusemap and the normal/spec map from erh, hence the industrial look ;)
That's so cool! Can you send me the dat/plist files?