Difference between revisions of "Personalities OXP"

From Elite Wiki
(Added note on tweaking via Library.oxp, and on adding oneself as a character)
(Adding yourself as a character: Updated instructions)
Line 24: Line 24:
  
 
=== Adding yourself as a character ===
 
=== Adding yourself as a character ===
How to add personality
+
'''Make an entry about your ship in [[shipdata.plist|shipdata.plist]]'''
 +
#As a base you can take a entry from the game files or OXP or, if your ship is from OXP, from its files.
 +
#Adjust the parameters so that they correspond to the specs of your ship in the game. Pay special attention to:
 +
#* [[shipdata.plist#max_flight_speed|max_flight_speed]],
 +
#* [[shipdata.plist#max_flight_pitch|max_flight_pitch]],
 +
#* [[shipdata.plist#max_flight_roll|max_flight_roll]],
 +
#* [[shipdata.plist#thrust|thrust]],
 +
#* [[shipdata.plist#max_energy|max_energy]],
 +
#* [[shipdata.plist#energy_recharge_rate|energy_recharge_rate]],
 +
#* laser types (only [[shipdata.plist#forward_weapon_type|forward]] and [[shipdata.plist#aft_weapon_type|aft]] laser available),
 +
#* [[shipdata.plist#laser_color|laser_color]],
 +
#* the number of  [[shipdata.plist#missiles|missiles]] you carry and their [[shipdata.plist#missile_role|main type]],
 +
#* [[shipdata.plist#frangible|frangibility]] of your ship (if applicable),
 +
#* installed equipment extras:
 +
#** [[shipdata.plist#has_ecm|ECM]],
 +
#** [[shipdata.plist#has_escape_pod|Escape Capsule]],
 +
#** [[shipdata.plist#has_fuel_injection|Fuel Injectors]],
 +
#** [[shipdata.plist#has_scoop|Fuel Scoops]],
 +
#** [[shipdata.plist#has_shield_booster|Shield Boosters]],
 +
#** [[shipdata.plist#has_shield_enhancer|Shield Enhancers]],
 +
#** an Extra Energy Unit or Naval Energy Unit (will influence the [[shipdata.plist#max_energy|max_energy]]),
 +
#** [[shipdata.plist#heat_insulation|Heat Shields]],
 +
#** [[shipdata.plist#has_cloaking_device|Cloaking Device]],
 +
#** [[shipdata.plist#has_energy_bomb|Q-bomb]]
  
You need to do a couple of things:
+
'''Make sure that models, textures and shaders used be ship will be available not only for you'''
  
* '''Make an entry about your ship in shipdata.plist.''' Among all parameters of the ship (you can take them as a basis from the game files or OXP where the ship is from), special attention should be paid to:
+
# Copy them to the appropriate folder of OXP.
 +
# (Optional) It would be great if you change resource names, both filenames and references inside the models (.dat) and shipdata.plist, as this will help avoid conflicts.
 +
::Model files are just regular text files, same as shipdata.plist, so they can be opened in a any decent text editor. It might be a good idea to use search and replace - one Griff's Cobra model has more than 800 lines with the name of the texture.
  
:'''name''' - "shipname: charactername" goes here
+
'''(Optional) Add a character entry in [[characters.plist|characters.plist]]'''
:'''ai_type''' - "personalitiesCruiserAI.plist" OR "personalitiesHunterAI.plist" OR "personalitiesPrivateerAI.plist" .
 
:''You can also put in your own AI script, but then OXP will only decide when to add your personality, and you have to implement everything else yourself.''
 
:'''script''' - If you use one of the suggested AI types, you need to use "personalities-ship-script.js" here
 
:'''roles''' - you can read about it [http://aegidian.org/bb/viewtopic.php?f=4&t=7093&p=94383&hilit=personalities+launcher#p94383 here]
 
:'''script_info''' - you can read about it (and also about standard AI types) [http://aegidian.org/bb/viewtopic.php?p=94924#p94924 here]  
 
:'''pilot''' - if you use escape pod here you need to specify an entry from characters.plist
 
  
*'''Make sure that models, textures and shaders used be ship will be available not only for you.''' I think in most cases this will be to copy them to the appropriate folder of OXP and give them new names, including all references to them in the shipdata and models files.
+
If you're carrying an escape capsule with you, you should create this entry, or one day a complete stranger will escape the ship instead of you!
*'''Add communication messages into description.plist'''.
 
:there must be a record of what types of messages are used, "your name here" here - "name" from script_info :
 
::"personalities-"your name here"-messageTypes" = "attack attacked captured chatter dead flee jump kill launch witchspace";
 
: and the messages themselves:
 
::"personalities-your name here-attack" = ("<Phrase to be sent when attacked>");
 
::"personalities-your name here-attacked" = ("<Either this phrase will be sent..>", "<or this one when ship attacked>");
 
  
If you have any questions, don't hesitate to ask Alnivel. Who would also like to hear if you have any ideas about what else would be nice to add to the functionality of this OXP.  
+
Example of such a entry:
 +
<pre>
 +
"personalities-hesperus" = {
 +
    bounty = 150;
 +
    name = "Captain Jack Hesperus";
 +
    "random_seed" = "0 0 0 0 0 0";
 +
    "short_description" = "a notorious, feline trumble dealer from Orrira";
 +
};
 +
</pre>
 +
 
 +
'''Give your ship a personality (shipdata.plist)'''
 +
:*'''[[shipdata.plist#name|name]]''' - <code>shipname: charactername</code>.
 +
:*'''[[shipdata.plist#pilot|pilot]]''' - key of entry in characters.plist, for example,<code>personalities-hesperus</code>.
 +
:*'''[[shipdata.plist#roles|roles]]''':
 +
::: general role: <code>personalities</code>
 +
::: occupation: <code>personalities_cruiser</code> (trader), <code>personalities_privateer</code> (pirate) or <code>personalities_hunter</code> (bounty hunter)
 +
::: spawn options (several or even none may be specified):
 +
::::<code>personalities_galaxy_any</code> - can appear in space or near main station in any galaxy
 +
::::<code>personalities_launcher_galaxy_any</code> - can apear launching from main station in any galaxy (some ships are too big for that)
 +
::::<code>personalities_galaxy_0</code>, <code>personalities_launcher_galaxy_0</code> - similar to 'any' variant but limited only to the Galaxy '''One'''.
 +
::::<code>personalities_yourCharacterName</code> - opional but useful for testing
 +
::::'''Examples:'''
 +
::::# <code>personalities personalities_privateer personalities_galaxy_any personalities_launcher_galaxy_any personalities_aodhan</code> - pirate by name "Aodhan" that can appear in any galaxy both in space and via launch from main station,
 +
::::# <code>personalities personalities_hunter personalities_galaxy_7 personalities_launcher_galaxy_7 personalities_cwydion</code> - bounty hunter by name "Gwydion" that can appear only in Galaxy Eight both in space and via launch from main station,
 +
::::# <code>personalities personalities_cruiser personalities_galaxy_0 ppersonalities_galaxy_1 personalities_galaxy_2 personalities_jameson</code> - trader by name "Jameson" that can appear only in Galaxy One, Two and Three and only in space
 +
 
 +
:*'''[[shipdata.plist#ai_type|ai_type]]''' and '''[[shipdata.plist#script|script]]''' - there are two options here: plist AI or priority AI
 +
::''Plist AI'' - relatively obsolete, but more straightforward for making your own tweaks:
 +
::: '''ai_type''' - <code>personalitiesCruiserAI.plist</code>, <code>personalitiesHunterAI.plist</code> or <code>personalitiesPrivateerAI.plist</code>
 +
::: '''script''' - <code>personalities-ship-script.js</code>
 +
::''Priority AI'' - more available communications and slightly better interaction with the environment:
 +
::: '''ai_type''' - <code>personalities-cruiserAI.js</code>, <code>personalities-hunterAI.js</code> or <code>personalities-privateerAI.js</code>
 +
::: '''script''' - <code>personalities-priorityai-ship-script.js</code>
 +
::''You can also put in your own AI scripts, but then OXP will only decide when to add your personality, and you have to implement everything else yourself.''
 +
 
 +
'''Customize behavior via [[shipdata.plist#script_info|script_info]] (shipdata.plist)'''
 +
:''Plist AI'':
 +
<table border=1>
 +
  <tr>
 +
    <th>Key</th>
 +
    <th>Value</th>
 +
    <th>Meaning</th>
 +
  </tr>
 +
  <tr>
 +
    <td>name</td>
 +
    <td></td>
 +
    <td>internal identifier for the character's chatter</td>
 +
  </tr>
 +
  <tr>
 +
    <td>displayName</td>
 +
    <td></td>
 +
    <td>the character's human readable name</td>
 +
  </tr>
 +
  <tr>
 +
    <td>attacked</td>
 +
    <td>"flee"</td>
 +
    <td>lets the ship flee with injectors immediatly if attacked</td>
 +
  </tr>
 +
  <tr>
 +
    <td>attackProbability</td>
 +
    <td>number in range [0; 1]</td>
 +
    <td>chance of finding the ship's prey (see below) with each scan</td>
 +
  </tr>
 +
  <tr>
 +
    <td>cargoType</td>
 +
    <td>role</td>
 +
    <td>special cargo carried by the ship (e.g. "missilepod")</td>
 +
  </tr>
 +
  <tr>
 +
    <td rowspan="3">energyDown</td>
 +
    <td>"flee"</td>
 +
    <td>lets the ship flee with injectors, if its energy is down to 1/2 (= shields depleted)</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"jump"</td>
 +
    <td>lets the ship jump out, if its energy is down to 1/2 (= shields depleted)</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"cloak"</td>
 +
    <td>lets the ship only use its cloak if its energy is down to 1/2 (= shields depleted)</td>
 +
  </tr>
 +
  <tr>
 +
    <td rowspan="2">energyLow</td>
 +
    <td>"flee"</td>
 +
    <td>lets the ship flee with injectors, if its energy is down to 1/4</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"jump"</td>
 +
    <td>lets the ship jump out, if its energy is down to 1/4</td>
 +
  </tr>
 +
  <tr>
 +
    <td rowspan="2">launch</td>
 +
    <td>"jump"</td>
 +
    <td>lets the ship jump out of the system, after launching from the main station</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"stay"</td>
 +
    <td>lets the ship set course to the witchpoint, after launching from the main</td>
 +
  </tr>
 +
  <tr>
 +
    <td>maxCargo</td>
 +
    <td>integer</td>
 +
    <td>the maximum number of cargopods spawned if the ship dies</td>
 +
  </tr>
 +
  <tr>
 +
    <td>miningProbability</td>
 +
    <td rowspan="3">number in range [0; 1]</td>
 +
    <td>chance of finding asteroids with each scan (only if no prey found) and mining them</td>
 +
  </tr>
 +
  <tr>
 +
    <td>fuelstationProbability</td>
 +
    <td>chance of using the fuel station (if any), if spawned at witchpoint</td>
 +
  </tr>
 +
  <tr>
 +
    <td>sunskimProbability</td>
 +
    <td>chance of going to the sun first, if spawned at witchpoint</td>
 +
  </tr>
 +
  <tr>
 +
    <td rowspan="4">prey</td>
 +
    <td>"traders"</td>
 +
    <td>(privateers only) will only attack ships which are victims</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"everybody"</td>
 +
    <td>(privateers only) will attack any ship</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"offenders"</td>
 +
    <td>(hunters only) will attack any ship with a bounty above a certain treshold</td>
 +
  </tr>
 +
  <tr>
 +
    <td>"thargoids"</td>
 +
    <td>(hunters only) will only attack Thargoids, not pirates</td>
 +
  </tr>
 +
  <tr>
 +
    <td>preyLimit</td>
 +
    <td>integer</td>
 +
    <td>(hunters only) bounty treshold for offenders (or fugitives) to be attacked</td>
 +
  </tr>
 +
</table>
 +
 
 +
:''Priority AI'':
 +
Coming soon
 +
 
 +
'''Add communication messages into [[Misc_plists#descriptions.plist|description.plist]]'''
 +
# Add entry of what types of messages are used:
 +
::<code>"personalities-''name''-messageTypes" = "attack attacked captured chatter dead flee jump kill launch witchspace"</code> - "name" here must be same as in '''script_info'''
 +
# Add the comms themselves:
 +
::"personalities-''name''-attack" = ("Phrase to be sent when attack");
 +
::"personalities-''name''-attacked" = ("Either this phrase will be sent..", "or this one when ship attacked");
 +
::"personalities-''name''-chatter" = ("Also you can add...{pause: 5} some dramatic pauses!");
 +
List of avalaible comms coming soon
 +
 
 +
If you have any questions, don't hesitate to ask them in [http://oolite.aegidian.org/bb/viewtopic.php?f=4&t=6806 BB thread] or send a PM to Alnivel.
  
And finally, the question: would someone want to limit the appearance of their personality to a single galaxy, or maybe only a certain set of systems?
 
Right now the "personalities" and "personalities_launcher" roles are used to choose personality to appear, but they are also used in the AI. If anyone is interested in the functionality above, it can be changed so that the roles "personalities-galaxy-n" and "personalities_launcher-galaxy-n"(or something similar) will be used to determine if should personality appear in the galaxy sector, but then for those who can appear in any galaxy will have to add 8 or even 16 roles.
 
 
*[http://oolite.aegidian.org/bb/viewtopic.php?p=286858#p286858 Alnivel's 2022 instructions & comments]
 
*[http://oolite.aegidian.org/bb/viewtopic.php?p=286858#p286858 Alnivel's 2022 instructions & comments]
  

Revision as of 15:43, 22 October 2022

Adds Oolite community personalities to your game

Lestradae.png

Overview

This OXP adds characters we all know and love from the Oolite Bulletin Boards to the Ooniverse. Each personality has some specific behaviour and communication patterns.

Notable Features

There is a 65% chance that you will meet one well-known personality when you either jump into a new system or launch from a main station. Some of them are traders or engage in asteroid mining, some of them are bounty hunters and will protect you in case a pirate attacks you—or attack you in case you are the pirate. Some will only engage Thargoids. And some greet you friendly first, but may try to make you one more step on their ELITE ladder if nobody else is looking. Their behaviour in combat varies, but expect all of them to be a little tougher than your average adversary.

A list of the personalities contained in the basic OXP can be found at the very bottom of its ReadMe, separated by enough whitespace. If you like to be surprised, don't scroll down.

Notes on Alnivel's update version 0.91 (2022)

Update of the original 10 personalities to work with newer versions of Oolite. Adds more options.

Notes on original version 0.9 (2009)

DISCLAIMER

Personalities.oxp is a work in progress, and this version 0.9 is meant as a sneak preview, to give you a feeling what it looks like. It works as it is, but the final release may be different. Please help improving it by reporting bugs and strange or unexpected behaviour in its thread on the Oolite Bulletin Boards. Thanks very much!

How do I remove my own character?

1) Open the shipdata.plist inside the "Config" folder.
2) Look for the entry "personalities-<yourname>".
3a) Remove it completely.
or
3b) Go to its "roles" key, and delete the roles "personalities" and "personalities_launcher".

Adding yourself as a character

Make an entry about your ship in shipdata.plist

  1. As a base you can take a entry from the game files or OXP or, if your ship is from OXP, from its files.
  2. Adjust the parameters so that they correspond to the specs of your ship in the game. Pay special attention to:

Make sure that models, textures and shaders used be ship will be available not only for you

  1. Copy them to the appropriate folder of OXP.
  2. (Optional) It would be great if you change resource names, both filenames and references inside the models (.dat) and shipdata.plist, as this will help avoid conflicts.
Model files are just regular text files, same as shipdata.plist, so they can be opened in a any decent text editor. It might be a good idea to use search and replace - one Griff's Cobra model has more than 800 lines with the name of the texture.

(Optional) Add a character entry in characters.plist

If you're carrying an escape capsule with you, you should create this entry, or one day a complete stranger will escape the ship instead of you!

Example of such a entry:

"personalities-hesperus" = {
    bounty = 150; 
    name = "Captain Jack Hesperus"; 
    "random_seed" = "0 0 0 0 0 0"; 
    "short_description" = "a notorious, feline trumble dealer from Orrira"; 
}; 

Give your ship a personality (shipdata.plist)

  • name - shipname: charactername.
  • pilot - key of entry in characters.plist, for example,personalities-hesperus.
  • roles:
general role: personalities
occupation: personalities_cruiser (trader), personalities_privateer (pirate) or personalities_hunter (bounty hunter)
spawn options (several or even none may be specified):
personalities_galaxy_any - can appear in space or near main station in any galaxy
personalities_launcher_galaxy_any - can apear launching from main station in any galaxy (some ships are too big for that)
personalities_galaxy_0, personalities_launcher_galaxy_0 - similar to 'any' variant but limited only to the Galaxy One.
personalities_yourCharacterName - opional but useful for testing
Examples:
  1. personalities personalities_privateer personalities_galaxy_any personalities_launcher_galaxy_any personalities_aodhan - pirate by name "Aodhan" that can appear in any galaxy both in space and via launch from main station,
  2. personalities personalities_hunter personalities_galaxy_7 personalities_launcher_galaxy_7 personalities_cwydion - bounty hunter by name "Gwydion" that can appear only in Galaxy Eight both in space and via launch from main station,
  3. personalities personalities_cruiser personalities_galaxy_0 ppersonalities_galaxy_1 personalities_galaxy_2 personalities_jameson - trader by name "Jameson" that can appear only in Galaxy One, Two and Three and only in space
  • ai_type and script - there are two options here: plist AI or priority AI
Plist AI - relatively obsolete, but more straightforward for making your own tweaks:
ai_type - personalitiesCruiserAI.plist, personalitiesHunterAI.plist or personalitiesPrivateerAI.plist
script - personalities-ship-script.js
Priority AI - more available communications and slightly better interaction with the environment:
ai_type - personalities-cruiserAI.js, personalities-hunterAI.js or personalities-privateerAI.js
script - personalities-priorityai-ship-script.js
You can also put in your own AI scripts, but then OXP will only decide when to add your personality, and you have to implement everything else yourself.

Customize behavior via script_info (shipdata.plist)

Plist AI:
Key Value Meaning
name internal identifier for the character's chatter
displayName the character's human readable name
attacked "flee" lets the ship flee with injectors immediatly if attacked
attackProbability number in range [0; 1] chance of finding the ship's prey (see below) with each scan
cargoType role special cargo carried by the ship (e.g. "missilepod")
energyDown "flee" lets the ship flee with injectors, if its energy is down to 1/2 (= shields depleted)
"jump" lets the ship jump out, if its energy is down to 1/2 (= shields depleted)
"cloak" lets the ship only use its cloak if its energy is down to 1/2 (= shields depleted)
energyLow "flee" lets the ship flee with injectors, if its energy is down to 1/4
"jump" lets the ship jump out, if its energy is down to 1/4
launch "jump" lets the ship jump out of the system, after launching from the main station
"stay" lets the ship set course to the witchpoint, after launching from the main
maxCargo integer the maximum number of cargopods spawned if the ship dies
miningProbability number in range [0; 1] chance of finding asteroids with each scan (only if no prey found) and mining them
fuelstationProbability chance of using the fuel station (if any), if spawned at witchpoint
sunskimProbability chance of going to the sun first, if spawned at witchpoint
prey "traders" (privateers only) will only attack ships which are victims
"everybody" (privateers only) will attack any ship
"offenders" (hunters only) will attack any ship with a bounty above a certain treshold
"thargoids" (hunters only) will only attack Thargoids, not pirates
preyLimit integer (hunters only) bounty treshold for offenders (or fugitives) to be attacked
Priority AI:
Coming soon

Add communication messages into description.plist

  1. Add entry of what types of messages are used:
"personalities-name-messageTypes" = "attack attacked captured chatter dead flee jump kill launch witchspace" - "name" here must be same as in script_info
  1. Add the comms themselves:
"personalities-name-attack" = ("Phrase to be sent when attack");
"personalities-name-attacked" = ("Either this phrase will be sent..", "or this one when ship attacked");
"personalities-name-chatter" = ("Also you can add...{pause: 5} some dramatic pauses!");
List of avalaible comms coming soon

If you have any questions, don't hesitate to ask them in BB thread or send a PM to Alnivel.

Minimum Requirements

Personalities 0.95 was updated for Oolite 1.90. The AI's are still in .plist form, but can now be located in a specific system/galaxy. Personalities 0.9 was written and tested on Oolite 1.73.4. It should run on Oolite 1.73 and above. Some of its features will only be available and enabled from Oolite 1.74 onwards.

Download Location

Personalities.oxp v 0.91 (2022) Personalities.oxp v 0.9 (2009) is available for download via Box.com.

Installation

Move or copy the file Personalities.oxp from the main download folder into your AddOns folder. Where this resides, depends on your OS and your personal preferences. Restart Oolite.

IconLib.png

Tweaking

This oxp is customisable through Library OXP - via the Config for AddOns option on the docked F4 screen

Version History

  • version 0.9.1 (September, 2022) by Alnivel
requires Oolite 1.9 (probably can work even on versions 1.82+, but not tested)
fixed several broken function calls
changed names of internal variables and resources to avoid conflicts
changed comms message using method, it now requires a description.plist entry to be defined in this format:
"personalities-<personality name>-messageTypes" = "<list of space separated message types>";
rewritten methods for the spawn of special ships, changing a probability of this spawns now easier
added method for adding role to appear on a specified condition, such as system id, after some event etc
  • version 0.9 (November 5th, 2009) by Commander McLane
functional version for testing and feedback purposes
script may still get worked over
requires Oolite 1.73

Links