Randomshipnames.oxp v 1.4 released
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: Randomshipnames.oxp v 1.4 released
I’ll need to do a couple of tests. I’ll be back shortly.
- 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: Randomshipnames.oxp v 1.4 released
Question: When/How are you spawning your "scrub" ships?
Re: Randomshipnames.oxp v 1.4 released
It's a script action (checkForShips->addShipsAtPrecisely) in a planetinfo.plist, my chosen role appears next to the buoy as I eject from Lave.
I was young, I was naïve. Jonny Cuba made me do it!
- 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: Randomshipnames.oxp v 1.4 released
OK, change this:
Code: Select all
this.startUpComplete = function() {
Code: Select all
this.startUp = function() {
Re: Randomshipnames.oxp v 1.4 released
Tried twice, emptied cache. Alas, same result. No effect, no logged error.phkb wrote: ↑Wed Jul 06, 2022 10:41 pmOK, change this:To thisCode: Select all
this.startUpComplete = function() {
And see how that goes.Code: Select all
this.startUp = function() {
I was young, I was naïve. Jonny Cuba made me do it!
- 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: Randomshipnames.oxp v 1.4 released
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");
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]);
Re: Randomshipnames.oxp v 1.4 released
Sorry, I don't have that set up.phkb wrote: ↑Wed Jul 06, 2022 11:06 pmCan you try spawning a ship via the console, after the game is started? egThat 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
worldScripts.scrubNamer._ships = system.addShipsToRoute("scrub", 2, 0.7, "sw");
And see what the output in the log shows.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]);
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?
I was young, I was naïve. Jonny Cuba made me do it!
- 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: Randomshipnames.oxp v 1.4 released
Yep, send me a PM with a link if you like.
- montana05
- ---- E L I T E ----
- Posts: 1166
- Joined: Mon May 30, 2016 3:54 am
- Location: lurking in The Devils Triangle (G1)
Re: Randomshipnames.oxp v 1.4 released
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),
Scars remind us where we've been. They don't have to dictate where we're going.
Re: Randomshipnames.oxp v 1.4 released
t'is sent. Thank you.
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.montana05 wrote: ↑Wed Jul 06, 2022 11:47 pmIf 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),
I was young, I was naïve. Jonny Cuba made me do it!
- 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: Randomshipnames.oxp v 1.4 released
OK, I think I've spotted the problem.
In your planetInfo, your spawning code says this:
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:
to this
And see how that goes.
In your planetInfo, your spawning code says this:
Code: Select all
"addShipsAtPrecisely: junk1 1 pwm 18015 66700 22486"
So, change this line of the script file from this:
Code: Select all
rsn.$externalNameEngine(this.name, "scrub", 1);
Code: Select all
rsn.$externalNameEngine(this.name, "junk1", 1);
Re: Randomshipnames.oxp v 1.4 released
phkb wrote: ↑Thu Jul 07, 2022 12:02 amOK, I think I've spotted the problem.
In your planetInfo, your spawning code says this: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".Code: Select all
"addShipsAtPrecisely: junk1 1 pwm 18015 66700 22486"
So, change this line of the script file from this:to thisCode: Select all
rsn.$externalNameEngine(this.name, "scrub", 1);
And see how that goes.Code: Select all
rsn.$externalNameEngine(this.name, "junk1", 1);
––Or change the role in the planetinfo to "scrub" (it was just an irrelevant leftover from the Lave.oxp)
Thank you . You javascriptgeniuses can do anything!
I was young, I was naïve. Jonny Cuba made me do it!
- 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: Randomshipnames.oxp v 1.4 released
Yay! Another happy customer!
- timer
- ---- E L I T E ----
- Posts: 336
- Joined: Sat Mar 17, 2012 8:26 pm
- Location: Laenin spiv club
- Contact:
Re: Randomshipnames.oxp v 1.4 released
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.
Cobra MK III owner since 1994