Friend or Foe

From Elite Wiki
Revision as of 19:01, 21 November 2012 by Tricky (talk | contribs) (Initial stub)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Levelindicator0.png
0-{{{2}}}
Version Released License Features Category Author(s) Feedback
1.0 2012-11-21 CC BY-NC-SA 3.0 Enhances ship group interaction Mechanics OXPs Tricky BB-Link

Friend or Foe
No picture available
Download Link Download Links
Version 1.0 (2012-11-21)
History Version History
Stations None
Ships None
Missions None
Equipment None
Alternative HUD
Available
None
Sound Set
Available
None
Category Mechanics OXPs
Author Tricky

Overview

An OXP that enhances ship group interaction.

Requirements

   Oolite 1.75+

Optional OXPs

   OXPConfig - For log control.

Downloads

   https://www.box.com/s/gxyvr7nlfh9k9kqnxm49 (box.com)
   https://dl.dropbox.com/u/31706855/Oolite/OXPs/Friend_or_Foe.zip (dropbox.com)
   rsync://ebspso.dnsalias.org/friend_or_foe or ebspso.dnsalias.org::friend_or_foe (rsync)

Install

After unzipping, move or copy the folder, "Friend_or_Foe_1.0.oxp", into your AddOns directory.

Uninstall

Delete the directory, "Friend_or_Foe_1.0.oxp", from your AddOns directory.

Ship installation HOWTO

For a basic installation, create a ship script that follows this template, change the standard public variables as needed...

(function () {
    "use strict";

    /* Standard public variables for OXP scripts. */
    this.name = "yourshipscripthere.js";
    this.author = "Your Name";
    this.copyright = "© 2012 Your Name";
    this.license = "CC BY-NC-SA 3.0";
    this.description = "Ship script for your ship.";
    this.version = "1.0";

    /* Identifies this as a friendly to the 'Friend or Foe OXP'.
     * This is needed.
     */
    this.$fof_ship = true;

    /* Group name for your ship.
     * Optional/Not needed.
     */
    this.$fof_groupName = "yourgroupnamehere";

    /* Ship event callbacks. */

    /* Initialise the ship with 'Friend or Foe OXP' on birth. */
    this.shipSpawned = function () {
        /* No longer needed after setting up. */
        delete this.shipSpawned;

        /* Register this ship as a friendly. Delay it to allow the system to do it's stuff. */
        if (worldScripts["Friend or Foe"]) {
            this.$addFriendlyTimerReference = new Timer(this, function () {
                    worldScripts["Friend or Foe"].$addFriendly(this.ship);
                    delete this.$addFriendlyTimerReference;
                }, 2);
        }
    };
}).call(this);

Place the above code in the Scripts directory of your ship OXP. In shipdata.plist add a reference to the script. Rememeber to save the above code with a .js extension.

This OXP does not work for ships with the SCAN_CLASS of police due to hard-coded bounty increments in the Oolite executable. Thargoids and tharglets are also ignored.

Version History

v1.0 (2012-11-21)

   Initial release.

Copyright

Copyright © 2012 Richard Thomas Harrison (Tricky)

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.