Difference between revisions of "Randomshipnames OXP"
(updated to v 1.1 and added more screen shots) |
Cholmondely (talk | contribs) (Tidied up the page a little) |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | == Introduction == |
||
+ | This [[OXP]] adds randomly generated names to almost all normal ship classes (except Thargoids) in Oolite. |
||
− | |||
− | This OXP adds randomly generated names to almost all normal ship classes (except Thargoids) in Oolite. |
||
== Overview == |
== Overview == |
||
− | |||
Randomshipnames.oxp does exactly what it says on the tin: assigning randomly generated names to the ships you meet in your Ooniverse. A big thank you goes to "Disembodied" for not only coming up with useful naming schemes, but also providing huge word lists as fodder for the random generator. |
Randomshipnames.oxp does exactly what it says on the tin: assigning randomly generated names to the ships you meet in your Ooniverse. A big thank you goes to "Disembodied" for not only coming up with useful naming schemes, but also providing huge word lists as fodder for the random generator. |
||
== Minimum Requirements == |
== Minimum Requirements == |
||
− | |||
+ | Randomshipnames.oxp requires at least Oolite 1.77. |
||
− | Randomshipnames.oxp requires at least Oolite 1.75. |
||
− | |||
− | == Download Location == |
||
− | |||
− | Randomshipnames.oxp v 1.1 is available for download via [http://www.box.com/s/5be5954d4db458422dd9 box.com]. |
||
== Installation == |
== Installation == |
||
+ | *Now downloadable through the in-game [[Expansions Manager]]. |
||
+ | *[[Media:Randomshipnames.1.6.oxz|Randomshipnames.1.6.oxz]] (downloaded {{#downloads:Randomshipnames.1.6.oxz}} times). |
||
+ | *Randomshipnames.oxp v 1.4 is available for download via [https://app.box.com/s/l3xemuvjlii619yy038k box.com]. |
||
− | Move or copy the file randomshipnames1. |
+ | Move or copy the file randomshipnames1.4.oxp from its download folder into your AddOns folder. Where that resides depends on your installation. Make sure to remove any previous versions. Restart Oolite. |
− | |||
− | == Examples == |
||
+ | == Gallery == |
||
<gallery> |
<gallery> |
||
Image:Randomname01.png|A trade ship with a name. |
Image:Randomname01.png|A trade ship with a name. |
||
Line 29: | Line 25: | ||
</gallery> |
</gallery> |
||
+ | == BB Discussion Thread == |
||
+ | *[http://aegidian.org/bb/viewtopic.php?f=4&t=11737 Forum] |
||
+ | |||
+ | ---- |
||
+ | == The Dark Side == |
||
+ | === Disabling/enabling random naming (note to ship designers) === |
||
+ | |||
+ | You can exclude any ship of yours from getting a random name through this OXP. You can do this by using the script_info-key in shipdata.plist. Insert a value named randomshipnames and set it to no. Now your ship won't get a name through this OXP. |
||
+ | |||
+ | If you want to copy and paste, this is what it looks like in OpenStep: |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "no"; |
||
+ | }; |
||
+ | |||
+ | And this is what it looks like in XML: |
||
+ | <key>script_info</key> |
||
+ | <dict> |
||
+ | <key>randomshipnames</key> |
||
+ | <string>no</string> |
||
+ | </dict> |
||
+ | |||
+ | In the same way you can include a ship with a custom role in one of the categories used by this OXP by setting the same script_info-key to one of the following values: |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "trader"; |
||
+ | }; |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "hunter"; |
||
+ | }; |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "pirate"; |
||
+ | }; |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "rockhermit"; |
||
+ | }; |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "police"; |
||
+ | }; |
||
+ | "script_info" = { |
||
+ | "randomshipnames" = "military"; |
||
+ | }; |
||
+ | Then it will get a random name just like the other ships in the same category. |
||
+ | |||
+ | === Using the naming engine for your own ships === |
||
+ | |||
+ | Sometimes you may want to use randomshipnames' naming engine in your own script. This is also possible. You can call the naming functions from any script like this: |
||
+ | worldScripts.randomshipnames.$randomTraderName(ship) // returns a random name for a trader or other civilian ship |
||
+ | worldScripts.randomshipnames.$randomHunterName(ship) // returns a random name for a hunter, escort, or any aggressive, but not malevolent ship |
||
+ | worldScripts.randomshipnames.$randomPirateName(ship) // returns a random name for a pirate, or any aggressive and malevolent ship |
||
+ | worldScripts.randomshipnames.$randomRockhermitName(ship) // returns a random name for a rockhermit, or another stationary object |
||
+ | worldScripts.randomshipnames.$randomPoliceName(ship) // returns a random numbers-and-letter designation for a police or military ship |
||
+ | All naming functions take a ship object as parameter. |
||
+ | |||
+ | === Attaching external name engines === |
||
+ | |||
+ | Following a [http://aegidian.org/bb/viewtopic.php?f=4&t=11737&start=120#p224942 request] you can define your own ship names based on [http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#primaryRole primaryRole]. An example: |
||
+ | |||
+ | 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); |
||
+ | } |
||
+ | The first parameter of $externalNameEngine is the name of your worldScript, second is the primary role of the ships you rename in your $randomName function. Third is the probability of the callback between 0 and 1 where 1 mean always, 0.1 mean only the 10% of ships with the given primaryRole will be named by your function, others will get names from randomshipnames. |
||
{{ambience-OXP}} |
{{ambience-OXP}} |
Latest revision as of 00:17, 18 June 2021
This OXP adds randomly generated names to almost all normal ship classes (except Thargoids) in Oolite.
Contents
Overview
Randomshipnames.oxp does exactly what it says on the tin: assigning randomly generated names to the ships you meet in your Ooniverse. A big thank you goes to "Disembodied" for not only coming up with useful naming schemes, but also providing huge word lists as fodder for the random generator.
Minimum Requirements
Randomshipnames.oxp requires at least Oolite 1.77.
Installation
- Now downloadable through the in-game Expansions Manager.
- Randomshipnames.1.6.oxz (downloaded 10560 times).
- Randomshipnames.oxp v 1.4 is available for download via box.com.
Move or copy the file randomshipnames1.4.oxp from its download folder into your AddOns folder. Where that resides depends on your installation. Make sure to remove any previous versions. Restart Oolite.
Gallery
BB Discussion Thread
The Dark Side
Disabling/enabling random naming (note to ship designers)
You can exclude any ship of yours from getting a random name through this OXP. You can do this by using the script_info-key in shipdata.plist. Insert a value named randomshipnames and set it to no. Now your ship won't get a name through this OXP.
If you want to copy and paste, this is what it looks like in OpenStep:
"script_info" = { "randomshipnames" = "no"; };
And this is what it looks like in XML:
<key>script_info</key> <dict> <key>randomshipnames</key> <string>no</string> </dict>
In the same way you can include a ship with a custom role in one of the categories used by this OXP by setting the same script_info-key to one of the following values:
"script_info" = { "randomshipnames" = "trader"; }; "script_info" = { "randomshipnames" = "hunter"; }; "script_info" = { "randomshipnames" = "pirate"; }; "script_info" = { "randomshipnames" = "rockhermit"; }; "script_info" = { "randomshipnames" = "police"; }; "script_info" = { "randomshipnames" = "military"; };
Then it will get a random name just like the other ships in the same category.
Using the naming engine for your own ships
Sometimes you may want to use randomshipnames' naming engine in your own script. This is also possible. You can call the naming functions from any script like this:
worldScripts.randomshipnames.$randomTraderName(ship) // returns a random name for a trader or other civilian ship worldScripts.randomshipnames.$randomHunterName(ship) // returns a random name for a hunter, escort, or any aggressive, but not malevolent ship worldScripts.randomshipnames.$randomPirateName(ship) // returns a random name for a pirate, or any aggressive and malevolent ship worldScripts.randomshipnames.$randomRockhermitName(ship) // returns a random name for a rockhermit, or another stationary object worldScripts.randomshipnames.$randomPoliceName(ship) // returns a random numbers-and-letter designation for a police or military ship
All naming functions take a ship object as parameter.
Attaching external name engines
Following a request you can define your own ship names based on primaryRole. An example:
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); }
The first parameter of $externalNameEngine is the name of your worldScript, second is the primary role of the ships you rename in your $randomName function. Third is the probability of the callback between 0 and 1 where 1 mean always, 0.1 mean only the 10% of ships with the given primaryRole will be named by your function, others will get names from randomshipnames.