Extra Rock Hermits

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post by phkb »

Small patch just released, taking this to v1.3. I had the descriptions file named incorrectly.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post by cbr »

Image

Any plans for externally docking ships?

(simulated image)
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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]}});
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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...
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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 :!:
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: Extra Rock Hermits

Post 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 ;)
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Extra Rock Hermits

Post 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?
Post Reply