Extra Rock Hermits
Moderators: winston, another_commander
- phkb
- 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
Small patch just released, taking this to v1.3. I had the descriptions file named incorrectly.
Re: Extra Rock Hermits
Any plans for externally docking ships?
(simulated image)
- phkb
- 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
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
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.
- phkb
- 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
OK, I've redone the normal maps - hopefully they'll look better now. v1.4 available in the manager.
Re: Extra Rock Hermits
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;
- phkb
- 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
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
Ah thanks! Well that explained the missing rock texture as i was setting the mainhull texture for it.phkb wrote: ↑Fri Feb 16, 2024 10:07 pmAll 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).
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
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.
I use a vintage systemaddships script to add test objects in this case extrarockhermits in the area, but they are all the same?
- phkb
- 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
That's weird. I'd need to see your script to work out what might be happening in this case.
Re: Extra Rock Hermits
Config script.s contains only this
had to change a value in the condition.js 0.35 => 0.99
& changed this in erh_spawn.js
to have them show up without error...
Code: Select all
this.shipWillLaunchFromStation = function(station)
{
system.addShips("extrarockhermit", 40, player.ship.position, 9999);
}
& 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));
- phkb
- 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
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
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
- phkb
- 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
That's so cool! Can you send me the dat/plist files?