Difference between revisions of "Friend or Foe"
m (Updated links) |
Cholmondely (talk | contribs) m (→Downloads: Updated link) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 10: | Line 10: | ||
|feedback = [http://aegidian.org/bb/viewtopic.php?f=4&t=13038 BB-Link] |
|feedback = [http://aegidian.org/bb/viewtopic.php?f=4&t=13038 BB-Link] |
||
}} |
}} |
||
+ | [[Image:OXPConfig_logo.png|100px|right]] |
||
---- |
---- |
||
− | {{Infobox OXP |
||
− | |title = Friend or Foe |
||
− | |download = [[Friend or Foe#Downloads|Download Links]] |
||
− | |version = 1.2 (2012-11-26) |
||
− | |story = [[Friend or Foe#Version History|Version History]] |
||
− | |stations = None |
||
− | |ships = None |
||
− | |mission = None |
||
− | |equipment = None |
||
− | |alternativeHUD = None |
||
− | |soundSet = None |
||
− | |category = Mechanics OXPs |
||
− | |author = [[User:Tricky|Tricky]] |
||
− | }} |
||
== Overview == |
== Overview == |
||
An OXP that enhances ship group interaction. |
An OXP that enhances ship group interaction. |
||
The Friend or Foe system will allow groups of ships to work as a team independently without being setup as escorts. There is no concept of a leader or escorts/wingmen in this system. Each ship has complete autonomy and can call on help from any other team member. Each ship keeps track of who has attacked them and will ignore stray shots, ie friendly fire. Also if an attacker disappears off the scanner and later comes back the team will remember them and restart the attack run. |
The Friend or Foe system will allow groups of ships to work as a team independently without being setup as escorts. There is no concept of a leader or escorts/wingmen in this system. Each ship has complete autonomy and can call on help from any other team member. Each ship keeps track of who has attacked them and will ignore stray shots, ie friendly fire. Also if an attacker disappears off the scanner and later comes back the team will remember them and restart the attack run. |
||
+ | |||
+ | Please note: This OXP does nothing by itself. It will only enhance ships if they register themselves in their ship script. See the script example below in [[Friend or Foe#Ship installation HOWTO|Ship installation HOWTO]]. |
||
== Requirements == |
== Requirements == |
||
Line 34: | Line 23: | ||
== Optional OXPs == |
== Optional OXPs == |
||
− | * OXPConfig - For log control. |
+ | * [[OXPConfig]] - For log control. |
== Downloads == |
== Downloads == |
||
− | * https:// |
+ | * https://app.box.com/s/gxyvr7nlfh9k9kqnxm49 (box.com) |
* https://dl.dropbox.com/u/31706855/Oolite/OXPs/Friend_or_Foe_1.2.zip (dropbox.com) |
* https://dl.dropbox.com/u/31706855/Oolite/OXPs/Friend_or_Foe_1.2.zip (dropbox.com) |
||
* rsync://ebspso.dnsalias.org/friend_or_foe_1.2 or ebspso.dnsalias.org::friend_or_foe_1.2 (rsync) |
* rsync://ebspso.dnsalias.org/friend_or_foe_1.2 or ebspso.dnsalias.org::friend_or_foe_1.2 (rsync) |
||
Line 91: | Line 80: | ||
delete this.$addFriendlyTimerReference; |
delete this.$addFriendlyTimerReference; |
||
}, 2); |
}, 2); |
||
+ | this.$isEscort = true; |
||
} |
} |
||
− | this.$isEscort = true; |
||
}; |
}; |
||
Line 102: | Line 91: | ||
/* No longer needed after setting up. */ |
/* No longer needed after setting up. */ |
||
delete this.shipSpawned; |
delete this.shipSpawned; |
||
− | |||
− | if (this.$isEscort) { |
||
− | /* Already been setup as a friendly. */ |
||
− | return; |
||
− | } |
||
/* Register this ship as a friendly. Delay it to allow the system to do it's stuff. */ |
/* Register this ship as a friendly. Delay it to allow the system to do it's stuff. */ |
||
if (worldScripts["Friend or Foe"]) { |
if (worldScripts["Friend or Foe"]) { |
||
+ | if (this.$isEscort) { |
||
+ | /* Already been setup as a friendly. */ |
||
+ | return; |
||
+ | } |
||
+ | |||
this.$addFriendlyTimerReference = new Timer(this, function () { |
this.$addFriendlyTimerReference = new Timer(this, function () { |
||
worldScripts["Friend or Foe"].$addFriendly(this.ship); |
worldScripts["Friend or Foe"].$addFriendly(this.ship); |
||
Line 129: | Line 118: | ||
This is a list of all the ship script event handlers that a ship registered with the Friend or Foe OXP will respond to. If the ship already has code for these handlers in it's ship script then they will be called afterwards. |
This is a list of all the ship script event handlers that a ship registered with the Friend or Foe OXP will respond to. If the ship already has code for these handlers in it's ship script then they will be called afterwards. |
||
− | * [[ |
+ | * [[Oolite JavaScript Reference: Ship script event handlers#shipAttackedWithMissile|shipAttackedWithMissile]] |
− | * [[ |
+ | * [[Oolite JavaScript Reference: Ship script event handlers#shipBeingAttacked|shipBeingAttacked]] |
− | * [[ |
+ | * [[Oolite JavaScript Reference: Ship script event handlers#shipDied|shipDied]] |
− | * [[ |
+ | * [[Oolite JavaScript Reference: Ship script event handlers#shipTargetDestroyed|shipTargetDestroyed]] |
== Further documentation == |
== Further documentation == |
||
Line 157: | Line 146: | ||
to Creative Commons, 171 Second Street, Suite 300, San Francisco, |
to Creative Commons, 171 Second Street, Suite 300, San Francisco, |
||
California, 94105, USA. |
California, 94105, USA. |
||
+ | |||
+ | == OXP Categories == |
||
+ | [[Category:Oolite]] [[Category:Oolite expansion packs]] {{mechanics-OXP}} [[Category:OXPConfig-compatible OXPs]] |
Latest revision as of 12:49, 12 October 2021
Version | Released | License | Features | Category | Author(s) | Feedback |
---|---|---|---|---|---|---|
1.2 | 2012-11-26 | CC BY-NC-SA 3.0 | Enhances ship group interaction | Mechanics OXPs | Tricky | BB-Link |
Contents
Overview
An OXP that enhances ship group interaction.
The Friend or Foe system will allow groups of ships to work as a team independently without being setup as escorts. There is no concept of a leader or escorts/wingmen in this system. Each ship has complete autonomy and can call on help from any other team member. Each ship keeps track of who has attacked them and will ignore stray shots, ie friendly fire. Also if an attacker disappears off the scanner and later comes back the team will remember them and restart the attack run.
Please note: This OXP does nothing by itself. It will only enhance ships if they register themselves in their ship script. See the script example below in Ship installation HOWTO.
Requirements
- Oolite 1.75+
Optional OXPs
- OXPConfig - For log control.
Downloads
- https://app.box.com/s/gxyvr7nlfh9k9kqnxm49 (box.com)
- https://dl.dropbox.com/u/31706855/Oolite/OXPs/Friend_or_Foe_1.2.zip (dropbox.com)
- rsync://ebspso.dnsalias.org/friend_or_foe_1.2 or ebspso.dnsalias.org::friend_or_foe_1.2 (rsync)
Install
After unzipping, move or copy the folder, "Friend_or_Foe_1.2.oxp", into your AddOns directory.
Uninstall
Delete the directory, "Friend_or_Foe_1.2.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. Remember to set the same group name as the mother for an escort ship. * Optional/Not needed. */ this.$fof_groupName = "yourgroupnamehere"; /* Ship event callbacks. */ /* The spawnedAsEscort handler is called for newly added escort ships. It does trigger on adding the ship and * before the shipSpawned() handlers is activated. It has the mothership as argument. * * INPUT * mother - entity of the mothership. */ this.spawnedAsEscort = function (mother) { /* No longer needed after setting up. */ delete this.spawnedAsEscort; /* Register this escort 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, mother); delete this.$addFriendlyTimerReference; }, 2); this.$isEscort = true; } }; /* The shipSpawned handler is called for newly added ships. It does not trigger on adding but on the first update * after adding. On a witchspace jump it means that first all ships are added to the system, then afterwards all * the shipSpawned() events are triggered. */ 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"]) { if (this.$isEscort) { /* Already been setup as a friendly. */ return; } 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.
The player, thargoids and tharglets are ignored.
Police and Interceptors are also ignored because of the way bounties are hard-coded into the system. When Oolite v1.78 is released, it should be possible to integrate them.
Ship script event handlers
This is a list of all the ship script event handlers that a ship registered with the Friend or Foe OXP will respond to. If the ship already has code for these handlers in it's ship script then they will be called afterwards.
Further documentation
Version History
v1.2 (2012-11-26)
- Escorts or wingman of police and interceptors won't be registered.
- Thargoids and tharglets can not be registered.
- Bug fix for the route2patrolAI.plist switch AI.
v1.1 (2012-11-21)
- Minor bug fix.
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.