Old Murgh wrote: ↑Sun Jul 17, 2022 3:19 pm
I do wonder if I've missed how to be able to take a default comms action off the table a bit in. (if one doesn't start with "greeting" but goes down another path, "greeting" will still hang around, when it would be strange to send it) not being able to hide it like one can with the custom messages.
The script_info controls can prevent a particular message option from ever being available. So
Code: Select all
script_info = {
bcc_disable_default = (3);
};
Would mean that you would never see the "Greeting" option on that ship.
However, from the sounds of it, you want to disable the greet option after some other form of communication has taken place (for instance, after a custom conversation has started). At present, the only way to do this is through Javascript. (I might investigate being able to achieve this via script_info in a future release).
To achieve this, in your shipdata.plist file, add these lines to the "level1" custom message
Code: Select all
<key>post_reply_function</key>
<string>$hideGreeting</string>
<key>post_reply_worldscript</key>
<string>xpat_populator</string>
Then, add this function to the xpat_populator.js file
Code: Select all
this.$hideGreeting = function(ship, msgkey)
{
var bcc = worldScripts.BroadcastCommsMFD;
bcc.$addShipToArray(ship, bcc._greeted);
}
Then the greeting option will be removed after the custom conversation is started.
BTW, you don't need to use "level1" and "level2a" as the keys in your conversation. Feel free to use keys that make sense to you. I only used those key names to help illustrate the different conversation levels in the example.
Also, I noticed that you're using the "post_reply_hide_messages" on each message in your custom conversation to hide that message. However, you also have
Code: Select all
<key>delete_on_transmit</key>
<string>yes</string>
which will do the same thing. You only really need to use "post_reply_hide_messages" if you give the player two comms options, but they are mutually exclusive (that is, if the player picks option 1, they can't then choose option 2). So, after sending option 1, the "post_reply_hide_messages" allows you to easily remove option 2. Hope that makes sense. Let me know if you need more details.