Page 9 of 12

Re: Randomshipnames.oxp v 1.4 released

Posted: Sun Nov 24, 2013 3:22 pm
by Cody
Eh? What was that about random huts?

Re: Randomshipnames.oxp v 1.4 released

Posted: Thu Jul 10, 2014 9:20 pm
by Cody
Would a kindly boffin care to tell me where, and how, to add this to Randomshipnames.oxp so as to include all the new primary roles (if it's possible, of course)?

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 3:34 am
by Diziet Sma
Thanks for the reminder.. been meaning to get around to that myself.

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 4:14 am
by Diziet Sma
Having taken a look, I get the feeling the entire this.shipSpawned = function(ship) function may need a substantial re-write to utilise cim's suggested change. Best left to Commander McLane, I think.

In the meantime, I'd suggest going with the additions to the script, as posted by Commander McLane a few posts earlier. That's what I plan to do whilst waiting for the next release of RSN.

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 10:07 am
by Diziet Sma
Cody wrote:
Would a kindly boffin care to tell me where, and how, to add this to Randomshipnames.oxp so as to include all the new primary roles (if it's possible, of course)?
A howto and patch, until Commander McLane has the chance to upgrade RSN, can be found here:
https://bb.oolite.space/viewtopic.php?p=221904#p221904

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 12:26 pm
by Cody
Thanks, Diz - I'll compare that to my hacked version. No doubt, it will be an improvement!
I thought that might be one for your 'tweaks' thread.

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 1:40 pm
by Diziet Sma
Cody wrote:
No doubt, it will be an improvement!
You should have seen the first attempt.. I had a brain-fart, and ended up with Vipers with Hunter names, and Rock Hermits getting saddled with Trader ship names, and couldn't work out what I was doing wrong.. eventually the penny dropped.

Re: Randomshipnames.oxp v 1.4 released

Posted: Fri Jul 11, 2014 2:01 pm
by Cody
Diziet Sma wrote:
You should have seen the first attempt..
<chortles> You should have seen my attempt to incorporate cim's code into the OXP - oh dear!

Re: Randomshipnames.oxp v 1.4 released

Posted: Tue Aug 05, 2014 8:35 am
by spara
I have a request for a future version. Would it be possible to attach external name engines to this oxp?

And here's the actual case I'm thinking. RandomHits uses it's own naming engine producing names that differ from RandomShipnames. For ambiance I want to occasionally see ships with RandomHits names. For now I've been assigning core roles to RandomHits ships to achieve that. The downside is that some of the RandomHits ships are quite tough and just for ambiance meeting a four laser Imperial Trader as a pirate might not be seen as fun. What I would really want to do is just name some of the ordinary ships with RandomHits names rather than RandomShipnames.

Here's a proposition. At startup I would like to report to RandomShipnames an external engine with a call like this:

Code: Select all

worldScripts.randomshipnames.externalNameEngine(this.name, role, probability)
The actual external name generator could have a standard public function to call to. Something like

Code: Select all

this.randomName(role)

Re: Randomshipnames.oxp v 1.4 released

Posted: Tue Aug 05, 2014 8:48 am
by Zireael
That's a very good idea.

Randomshipnames.oxp v 1.5

Posted: Fri Oct 03, 2014 7:28 pm
by Norby
Randomshipnames v1.5:
-converted to OXZ format and uploaded to the in-game manager,
-contain Dizzy's patch with the new ship roles,
-externalNameEngine is implemented. An example of usage:

Code: Select all

this.name="numberedcoriolis";

this.startUp = function() {
	var w = worldScripts.randomshipnames;
	if( w ) w.$externalNameEngine(this.name, "coriolis", 1);
}

this.$randomName = function(ship) {
	return(ship.displayName+": "+ship.entityPersonality);
}

Re: Randomshipnames.oxp v 1.5

Posted: Fri Oct 03, 2014 7:34 pm
by cim
Norby wrote:
-contain Dizzy's patch with the new ship roles,
It might be worth adjusting this further, if you're maintaining the OXP, to make use of the data in [wiki]Role-categories.plist[/wiki] with Ship.roleIsInCategory(). That way it won't need updating (as much) if core adds any more roles, and it'll make those giant if() statements considerably shorter.

Re: Randomshipnames.oxp v 1.5

Posted: Fri Oct 03, 2014 8:19 pm
by Norby
Thanks cim for the tip, now I inserted this small future-proof fix into the same version (due to no downloads yet), but I do not want to make an overhaul like assigning different name styles to the subcategories or so.

Re: Randomshipnames.oxp v 1.4 released

Posted: Sat Oct 04, 2014 9:34 am
by onno256
Yep, this is what I was waiting for, keep up the good work!

Re: Randomshipnames.oxp v 1.5

Posted: Sun Oct 12, 2014 9:49 pm
by Cody
Norby wrote:
... contain Dizzy's patch with the new ship roles
Can the trunk rock hermit roles be easily added (by a dumb pilot such as myself, that is)?

Edit to add: have you just done exactly that, Norby? <grins>