BroadcastComms MFD [Release]
Posted: Sat Aug 16, 2014 7:10 am
Zireael and I are excited to announce the release of BroadcastComms MFD expansion pack. For the time being, this is in beta form only. I won't be publishing this in the download manager until we've got some broader comment on the usability and suitability of this pack. We'd like feedback on everything, but if you need a specific list of things we'd like tested, here you go:
To download this as an OXZ, click here. Download and put this file in your AddOns folder to use.
To download this as a OXP inside a ZIP file, click here. You will need to extract the OXP folder to your AddOns folder to use this option.
Below is from the ReadMe.txt file inside the OXP package.
Broadcast Comms MFD - ReadMe
Author: phkb (Nick Rogers) and Zireael
With thanks to: cim, Norby, Wildeblood and marte for their suggestions and fixes
Only works with Oolite 1.79 or greater.
This OXP provides a means by which the player can communicate in a real way with other ships. That is, the types of communications the player transmits will have a bearing on the game in some way, depending on the transmission type
MFD sample display with item selected.
There are 11 types of transmissions:
The BroadcastComms MFD is available for purchase for 200CR at all stations, regardless of techlevel.
After displaying the BroadcastComms MFD and priming it, press the "b" (Mode) key to select a message from the available options.
The selected message is marked with a ">" in the MFD.
You don't need the BroadcastComms MFD to be visible, though. There might be situations where it is not be visible, so changes to the selected message will also be displayed as a console message.
Once the desired message is selected, press the "n" (Activate) key to send the message.
External access:
Provision has been made for other OXP's to access the comms features in this OXP. There are two methods that can be used:Calling this function will add the message to the display that will be displayed when the conditions are met. The passed object can have the following properties:This function will update the settings of a particular message. The passed object can have the following properties:This function returns true if "messageName" exists, otherwise false.Calling this function will remove the message from the list. Only messages created via the "$createMessage" function can be removed.This function disables one or all of the internal messages, preventing it from being displayedThis function enables one of all of the internal messages (if they have been disabled by the $disableMessage function), allow it to be displayedThis function is used to determine if an internal message is enabled or if it has been disabled.
Returns true if message is enabled, otherwise false.Passing msgid value of 0 will check if all messages are enabled. Only returns true if all messages are enabled. Otherwise false.This example adds a broadcast message to the display. It will be removed when transmitted, and it will take 4 seconds for the
callback functionThis example adds a target-specific message to the display, to be shown when the ship object "myShip" is targeted by the player.
It will be not removed when transmitted and the callback functionThis example will remove the message "myMessage2" from the list of external messages.
This example will disable all internal messages, leaving only the external messages to be displayed.
This example will disable the "Send greeting to target" message.
This example will enable all internal messages.
This example will enable the "Send greeting to target" message.
External messages, and the status of internal messages, are cleared each time the player loads from a saved game. If a persistent message needs to be shown, or if the status of internal messages needs to be changed in an ongoing manner, ensure the changes are made after the player loads from a saved game.
- Do the transmissions work as advertised?
- Do any of the transmissions produce weird responses?
- Do any of the transmissions break gameplay in your opinion?
- For those who are happy looking through Javascript, have we done things the right way? Particularly when it comes to npc AI. My experience with this sort of thing is quite limited.
- Suggestions for further comm types, more responses, extra external access functions, different NPC actions in response to communications, that sort of thing.
To download this as an OXZ, click here. Download and put this file in your AddOns folder to use.
To download this as a OXP inside a ZIP file, click here. You will need to extract the OXP folder to your AddOns folder to use this option.
Below is from the ReadMe.txt file inside the OXP package.
Broadcast Comms MFD - ReadMe
Author: phkb (Nick Rogers) and Zireael
With thanks to: cim, Norby, Wildeblood and marte for their suggestions and fixes
Only works with Oolite 1.79 or greater.
This OXP provides a means by which the player can communicate in a real way with other ships. That is, the types of communications the player transmits will have a bearing on the game in some way, depending on the transmission type
MFD sample display with item selected.
There are 11 types of transmissions:
- Requests for wormholes (broadcast ie. to all ships in range)
This transmission asks if anyone is going to your hyperspace destination. The message is only available if a destination has been set.
Ships can respond in three ways: (a) Not at all. (b) By telling the player they are headed somewhere else, or (c) by telling the player they are heading to the players destination.
This message can be sent repeatedly. - Send distress message (broadcast ie. to all ships in range)
This transmission requests immediate assistance against attackers. NPC ships may or may not choose to help.
Only available when the player ship is under attack.
This message can be sent repeatedly. - Send greeting to target
This transmission sends a basic "Hello" message to the ship the player is targeting. The other ship may choose to respond or not. Once a response has been received from the other ship, no further greetings can be sent to that ship. - Send taunt to target
This transmission sends a taunt to the other ship, and the other ship may or may not respond. But regardless of a verbal response, the other ship may do one of the following:- Nothing at all
- If they are currently attacking the player, they might get angry and their accuracy might decrease for a few seconds, or increase for a few seconds.
- If they are not targeting the player at the moment, they might choose to start targeting the player instead.
- Issue threat to target
This transmission issues a threat to the other ship. Depending on who that ship is targeting, the response may be different:- If the other ship is targeting the player, there is a small chance they might choose to flee.
- If the other ship is not targeting the player, they will possibly choose to attack the player.
- Offer bribe to target/Offer bribe to nearest attacker
This transmission offers money to a ship that is attacking the player. That ship can respond in a two ways.- They can reject the offer. The amount the player can offer will then increase by a factor of 2 or 2.5 and the player can then try the bribe again if they wish. If the amount of bribe increase beyond the players current credit balance, the offer to bribe will be removed.
- They can accept the bribe. In this case, the bribe amount is deducted from the player bank account, and the ship targeting the player will break off their attack. If they are part of a pirate band, the pirate who accepted the bribe will share the spoils and they will all break off their attack.
- Demand cargo from target
This transmission sends a demand for cargo to the other ship. They can either accept or reject the demand. If they accept the demand, they will drop some cargo and flee. If this action is performed in sight of a police vessel or the main station, there is a chance the victim will report the crime and the player will receive an increase to their offender status. - Surrender to target/Surrender to nearest attacker
This transmission sends a surrender message to another ship. There is a small chance the attackers might accept the surrender. In that case they will stop attacking the player and wait for the player to dump some cargo. If the player doesn't dump any cargo, the pirates will start attacking the player again.
If the player decides to use the lull in hostilities to start attacking the ships the pirates will get really angry and get a temporary boost in their accuracy. - Offer to rescue escape pod (only if fuel scoop is fitted)
This sends a message to the targeted escape pod, asking the occupant if they would like to be scooped and returned to the main station. Commanders should check that they have available cargo space before scooping escape pods. - Target last comms message
This will switch the players target to the ship that last sent a comms message. - Keep away from my target
This will send a message to all ships in range, telling them to stay away from the players current target. Only ships that aren't fighting against the player will potentially respond. Enemy ships will ignore this message.
The BroadcastComms MFD is available for purchase for 200CR at all stations, regardless of techlevel.
After displaying the BroadcastComms MFD and priming it, press the "b" (Mode) key to select a message from the available options.
The selected message is marked with a ">" in the MFD.
You don't need the BroadcastComms MFD to be visible, though. There might be situations where it is not be visible, so changes to the selected message will also be displayed as a console message.
Once the desired message is selected, press the "n" (Activate) key to send the message.
External access:
Provision has been made for other OXP's to access the comms features in this OXP. There are two methods that can be used:
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$createMessage({messageName : string, callbackFunction : Function, displayText : string, messageText : string, ship : Ship, shipDisplayName : string, transmissionType : string, deleteOnTransmit : Boolean, delayCallback : integer})
- messageName = The name of this message, internally used for identification purposes. Can be any text. It is recommended to prefix the message name with the name of your worldscript to prevent the possibility of duplicate message names. (ie. "myworldscriptname_mymessagename")
- callbackFunction = the function to call when the player transmits the message.
- displayText = The message text to display
- messageText = The message text that will be transmitted, if different to the display text
- ship = reference to a ship object for a ship-to-ship transmission. Player must target the ship for the message to become available.
Can be null, and if transmission type is "target" this will create a message that can be sent to any targeted ship.
Will be ignored if transmission type is "broadcast". - shipDisplayName = display name of a ship for a ship-to-ship transmission. Player must target the ship for the message to become available.
Alternate method of targeting a specific ship, if the ship object is not available.
Will be ignored if transmission type is "broadcast". - transmissionType = transmission type, either "broadcast" (ie. transmitted to all ships) or "target" (the ship targeted by the player)
Including a ship property necessitates a "target" value here. Specifying "broadcast" will over override ship reference. - deleteOnTransmit = boolean value indicating that the message will be removed from the list as soon as the player transmits it
- delayCallback = integer value indicating how long (in seconds) to take before calling the callback function. A value of 0 (zero) means immediately.
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$updateMessage({messageName : string, displayText : string, messageText : string, callbackFunction : Function, deleteOnTransmit : boolean, delayCallback : integer});
- messageName = the name of the message that will be updated
- displayText = The new message text to be displayed, otherwise null if not being changed.
- messageText = The new message text that will be transmitted, otherwise null if not being changed.
- callbackFunction = The new function to call when the player transmits the message, otherwise null if not being changed.
- deleteOnTransmit = boolean value indicating that the message will be removed from the list as soon as the player transmits it.
Null if not being changed. - delayCallback = integer value indicating how long (in seconds) to take before calling the callback function. A value of 0 (zero) means immediately.
Null if not being changed.
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$checkMessageExists(messageName : string);
- messageName = The name of the message that will be searched for.
Code: Select all
$removeMessage(messageName : string);
- messageName = The name of the message that will be removed
Code: Select all
$disableMessage(msgid : int);
- msgid = The ID of the internal message that will be disabled, where
0 - all
1 - request for wormhole
2 - send distress message
3 - send greeting
4 - send taunt
5 - send threat
6 - offer bribe
7 - demand cargo
8 - surrender to target
9 - offer to rescue escape pod
10 - target last comms message
11 - keep away from my target
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$enableMessage(msgid : int);
- msgid = The ID of the internal message that will be enabled, where
0 - all
1 - request for wormhole
2 - send distress message
3 - send greeting
4 - send taunt
5 - send threat
6 - offer bribe
7 - demand cargo
8 - surrender to target
9 - offer to rescue escape pod
10 - target last comms message
11 - keep away from my target
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$isMessageEnabled(msgid : int);
Returns true if message is enabled, otherwise false.Passing msgid value of 0 will check if all messages are enabled. Only returns true if all messages are enabled. Otherwise false.
- msgid = The ID of the internal message that will be evaluated
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$createMessage({messageName:"myMessage1", callbackFunction:this.$broadcastCallback.bind(this), displayText:"Evacuation message", messageText:"Attention all ships. Please evacuate the area and move to a safe distance.", transmissionType:"broadcast", deleteOnTransmit:true, delayCallback:4});
callback function
this.$broadcastCallback.bind(this)
to be executed.
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$createMessage({messageName:"myMessage2", callbackFunction:this.$targetCallback.bind(this), displayText:"Ask native question", messageText:"Are you a native of these parts?", ship:myShip, transmissionType:"target", deleteOnTransmit:false, delayCallback:0});
It will be not removed when transmitted and the callback function
this.$targetCallback.bind(this)
will be executed immediately
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$removeMessage("myMessage2");
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$disableMessage(0);
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$disableMessage(3);
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$enableMessage(0);
Code: Select all
var w = worldScripts.BroadcastCommsMFD;
w.$enableMessage(3);
External messages, and the status of internal messages, are cleared each time the player loads from a saved game. If a persistent message needs to be shown, or if the status of internal messages needs to be changed in an ongoing manner, ensure the changes are made after the player loads from a saved game.