Page 12 of 12

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 9:18 pm
by phkb
I’ll need to do a couple of tests. I’ll be back shortly.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 10:30 pm
by phkb
Old Murgh wrote: Wed Jul 06, 2022 9:12 pm
No added RandomShipName given to my Scrub in space. Just plain Scrub.
Question: When/How are you spawning your "scrub" ships?

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 10:37 pm
by Old Murgh
phkb wrote: Wed Jul 06, 2022 10:30 pm
Question: When/How are you spawning your "scrub" ships?
It's a script action (checkForShips->addShipsAtPrecisely) in a planetinfo.plist, my chosen role appears next to the buoy as I eject from Lave.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 10:41 pm
by phkb
Old Murgh wrote: Wed Jul 06, 2022 10:37 pm
It's a script action (checkForShips->addShipsAtPrecisely) in a planetinfo.plist, my chosen role appears next to the buoy as I eject from Lave.
OK, change this:

Code: Select all

this.startUpComplete = function() {
To this

Code: Select all

this.startUp = function() {
And see how that goes.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 10:50 pm
by Old Murgh
phkb wrote: Wed Jul 06, 2022 10:41 pm
OK, change this:

Code: Select all

this.startUpComplete = function() {
To this

Code: Select all

this.startUp = function() {
And see how that goes.
Tried twice, emptied cache. Alas, same result. No effect, no logged error.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 11:06 pm
by phkb
Old Murgh wrote: Wed Jul 06, 2022 10:50 pm
Tried twice, emptied cache. Alas, same result. No effect, no logged error.
Can you try spawning a ship via the console, after the game is started? eg

Code: Select all

worldScripts.scrubNamer._ships = system.addShipsToRoute("scrub", 2, 0.7, "sw");
That should create a couple of scrub ships on the sun-witchpoint route, and store a reference to them in your script. Then, after a second or two, run this command:

Code: Select all

var ships = worldScripts.scrubNamer._ships; for (var i = 0; i < ships.length; i++) log("testing", ships[i].primaryRole + " -- " + ships[i].displayName + " -- " + ships[i]);
And see what the output in the log shows.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 11:27 pm
by Old Murgh
phkb wrote: Wed Jul 06, 2022 11:06 pm
Can you try spawning a ship via the console, after the game is started? eg

Code: Select all

worldScripts.scrubNamer._ships = system.addShipsToRoute("scrub", 2, 0.7, "sw");
That should create a couple of scrub ships on the sun-witchpoint route, and store a reference to them in your script. Then, after a second or two, run this command:

Code: Select all

var ships = worldScripts.scrubNamer._ships; for (var i = 0; i < ships.length; i++) log("testing", ships[i].primaryRole + " -- " + ships[i].displayName + " -- " + ships[i]);
And see what the output in the log shows.
Sorry, I don't have that set up.
My OSX console simply outputs logs. I suspect there is a way for me to use the terminal window (as a javascript console?, I imagine older OS supplied us with one) but I don't see how I get to it. Searching for available options now doesn't make it apparent for me . I'm too much of a novice! :(

Could I bother you to look at it if I made the files available?

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 11:43 pm
by phkb
Yep, send me a PM with a link if you like.

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 11:47 pm
by montana05
If you want to be independent of random ship names you can simply build your own selection by either use arrays or the descriptions.plist. An example could be found in ADCK Imperial Trader OXP worldscript. Please note that you need to switch random ship names off as well (shipdata.plist),

Re: Randomshipnames.oxp v 1.4 released

Posted: Wed Jul 06, 2022 11:57 pm
by Old Murgh
phkb wrote: Wed Jul 06, 2022 11:43 pm
Yep, send me a PM with a link if you like.
t'is sent. Thank you.
montana05 wrote: Wed Jul 06, 2022 11:47 pm
If you want to be independent of random ship names you can simply build your own selection by either use arrays or the descriptions.plist. An example could be found in ADCK Imperial Trader OXP worldscript. Please note that you need to switch random ship names off as well (shipdata.plist),
That does sound smart, I'll look at that example, but it would have been so cool to figure a way to expand on RSN's role and name pool setup.

Re: Randomshipnames.oxp v 1.4 released

Posted: Thu Jul 07, 2022 12:02 am
by phkb
OK, I think I've spotted the problem.
In your planetInfo, your spawning code says this:

Code: Select all

"addShipsAtPrecisely: junk1 1 pwm 18015 66700 22486"
But, I assumed you would be spawning ships with primaryRole of "scrub". The code you have would make the primaryRole of the ship "junk1", not "scrub".

So, change this line of the script file from this:

Code: Select all

rsn.$externalNameEngine(this.name, "scrub", 1);
to this

Code: Select all

rsn.$externalNameEngine(this.name, "junk1", 1);
And see how that goes.

Re: Randomshipnames.oxp v 1.4 released

Posted: Thu Jul 07, 2022 12:11 am
by Old Murgh
phkb wrote: Thu Jul 07, 2022 12:02 am
OK, I think I've spotted the problem.
In your planetInfo, your spawning code says this:

Code: Select all

"addShipsAtPrecisely: junk1 1 pwm 18015 66700 22486"
But, I assumed you would be spawning ships with primaryRole of "scrub". The code you have would make the primaryRole of the ship "junk1", not "scrub".

So, change this line of the script file from this:

Code: Select all

rsn.$externalNameEngine(this.name, "scrub", 1);
to this

Code: Select all

rsn.$externalNameEngine(this.name, "junk1", 1);
And see how that goes.
:D :D :D
––Or change the role in the planetinfo to "scrub" (it was just an irrelevant leftover from the Lave.oxp)

Image

Thank you . You javascriptgeniuses can do anything!

Re: Randomshipnames.oxp v 1.4 released

Posted: Thu Jul 07, 2022 12:14 am
by phkb
Old Murgh wrote: Thu Jul 07, 2022 12:11 am
Thank you . You javascriptgeniuses can do anything!
Yay! Another happy customer!

Re: Randomshipnames.oxp v 1.4 released

Posted: Tue Feb 28, 2023 9:25 am
by timer
Fritz wrote: Tue Oct 27, 2015 10:29 pm
The bounty part should go into the part of the display with the legal status, e.g. "Fugitive, Bounty 98 Cr", but I don't know if this would be possible.
I tried to do it. Now ship names are not touched.
v2.0 uploaded, but now it requires Oolite 1.81
Any wishes and comments are welcome.
Image