phkb wrote: ↑Mon Jul 11, 2022 2:03 amCode: Select all
{ "myship" = { ... ... various shipdata entries ... script_info = { "bcc_disable_defaults = (2,3,4); // this will disable message types 2, 3 and 4 for this ship type. "bcc_custom_defaults = { "1" = { transmit = "[my_custom_greeting]"; // instead of using the default greeting descriptions.plist lookup, use "[my_custom_greeting]" reply = "[my_custom_reply]"; }; }; }; }; }
BroadcastComms MFD [Release]
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
Small tweak to spec:
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
Ok v1.3 is now available, which includes all the script_info integration. Rather than explain everything here, if you want to make use of it, head over to the wiki page here, and scroll down to External Access subsection, click the link to expand the dark side, and look for the script_info details.
There is also a small test OXP where you can see all the techniques in play. It’s in the main BCC OXP, in the Resources folder, but you can download it independently here: BCC_Testbed.zip.
Let me know if you think anything is missing.
There is also a small test OXP where you can see all the techniques in play. It’s in the main BCC OXP, in the Resources folder, but you can download it independently here: BCC_Testbed.zip.
Let me know if you think anything is missing.
- Cholmondely
- Archivist
- Posts: 5364
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: BroadcastComms MFD [Release]
Nice....phkb wrote: ↑Sun Jul 17, 2022 3:31 amOk v1.3 is now available, which includes all the script_info integration. Rather than explain everything here, if you want to make use of it, head over to the wiki page here, and scroll down to External Access subsection, click the link to expand the dark side, and look for the script_info details.
There is also a small test OXP where you can see all the techniques in play. It’s in the main BCC OXP, in the Resources folder, but you can download it independently here: BCC_Testbed.zip.
Let me know if you think anything is missing.
Now to see what his Magnificent Munificence does with it....
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Re: BroadcastComms MFD [Release]
Looks at the outset like a superb, thorough package. Very excited to dive in.
More like Larkish Luddite. It feels great to be so thoughtfully enabled.Cholmondely wrote: ↑Sun Jul 17, 2022 4:30 amNow to see what his Magnificent Munificence does with it....
I was young, I was naïve. Jonny Cuba made me do it!
Re: BroadcastComms MFD [Release]
Just to report that is a lot of fun to play with. Really well-considered in its layout and logic.
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.
Other than that it opens the door to the mysteries of post_reply_function and post_reply_worldscript, and how I would go about donating a cargo to another ship, or make it follow me blindly..
For anyone curious, here is a WIP of an Xpat (or 3) appearing (mostly) at Lave which can hold a conversation for a bit. prohipXatWIP.oxp (not to be combined IA4 and IALave).
I was young, I was naïve. Jonny Cuba made me do it!
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
The script_info controls can prevent a particular message option from ever being available. SoOld Murgh wrote: ↑Sun Jul 17, 2022 3:19 pmI 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.
Code: Select all
script_info = {
bcc_disable_default = (3);
};
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>
Code: Select all
this.$hideGreeting = function(ship, msgkey)
{
var bcc = worldScripts.BroadcastCommsMFD;
bcc.$addShipToArray(ship, bcc._greeted);
}
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>
Last edited by phkb on Sun Jul 17, 2022 10:51 pm, edited 1 time in total.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
For the first one, it depends on how "visual" you want to make it. You can just run functions to subtract cargo from your manifest, and then add the same amount to the manifest of the other ship. Nice and easy - although you are essentially using a matter transmat control, which theoretically doesn't exist in the game. Magic would also explain it!
The other way to achieve this is to eject the cargo from your ship, then switch the AI on your target to scavenger, which should then make them try to scoop any visible cargo containers. I did this in GalCop Missions, mission type 40, in the galcopbb_delivery.js script file. It's complicated though. Have a look at that as an example (although there is a lot of other stuff in and around the type 40 mission, so it might be hard to discern).
For the second one, that might be easier: I haven't looked at this myself, but it should be possible to make the target an escort of the player ship. If I get some time I'll look into how to make this happen.
Re: BroadcastComms MFD [Release]
Yes, exactly. But all right, this should do the trick for now then.phkb wrote: ↑Sun Jul 17, 2022 10:07 pmHowever, 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).
Good to know, but that system does make it clear and easy to keep track of the dialogue steps and paths.
Ah yes, I didn't realise. I thought I was obliged to tidy up the path not taken, but that's even more convenient then.
I guess if the transfer demanded that the ships be close enough, one could excuse skipping the visuals.phkb wrote: ↑Sun Jul 17, 2022 10:18 pmFor the first one, it depends on how "visual" you want to make it. You can just run functions to subtract cargo from your manifest, and then add the same amount to the manifest of the other ship. Nice and easy - although you are essentially using a matter transmat control, which theoretically doesn't exist in the game. Magic would also explain it!
Could I force interject direct AI commands like performIdle and pauseAI through the post_reply_function/post_reply_worldscript, or would the solution be to temporarily switch to a simple custom made "standByToReceiveAI"?
That sounds great. I think there are a couple of situations I've wished for the opportunity to command an NPC to do a "duckling follow".
I was young, I was naïve. Jonny Cuba made me do it!
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
There are probably ways you could send those specific commands to the AI, I think the easiest way would be to switch the AI, and then switch it back afterwards.
Again in GalCop Missions, mission type 43, in that same script file, you have to deliver 1t of machinery to a damaged ship, which requires you to get close to it and eject the cargo. I then use some JS methods to act as a tractor beam to pull the cargo into the target ship. But the method you suggest would be much simpler.
Re: BroadcastComms MFD [Release]
I am no enemy of "easiest". Especially if I persuade myself it is also "most elegant".
Cool, I'll see what I can identify.phkb wrote: ↑Sun Jul 17, 2022 11:01 pmAgain in GalCop Missions, mission type 43, in that same script file, you have to deliver 1t of machinery to a damaged ship, which requires you to get close to it and eject the cargo. I then use some JS methods to act as a tractor beam to pull the cargo into the target ship. But the method you suggest would be much simpler.
Two ships lining up belly to belly for direct cargo transfer ought to be a more common sight in the Oolite universe. Which would call for a David Attenborough-style soft-voice commentary.
I was young, I was naïve. Jonny Cuba made me do it!
Re: BroadcastComms MFD [Release]
It would make sense to me to have the possibility of postponing the revelation of unique message until after the generic Greeting has been selected and replied to. So only then would custom message level1 be unhidden..
This way, a player wouldn't be able to see at first glance on the menu if there was a special reason to communicate to a ship, and only after the greeting does an unusual Comms entry pop up on the menu. To give the option of withholding that clue..
Did I manage to explain that understandably?
Do you see the value in it? Is that something you could envision squeezed in there?
It might revitalise that ancient custom of saying hello to everyone.
I was young, I was naïve. Jonny Cuba made me do it!
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
It's achievable now, in a way.
1. Disable the default "Greeting"
2. Make your conversation tree start with a greeting. You could even use the existing descriptions.plist entries for the transmission and replies.
Re: BroadcastComms MFD [Release]
Hey that's clever. I didn't think of that, that's just as good.
I was young, I was naïve. Jonny Cuba made me do it!
Re: BroadcastComms MFD [Release]
So this one was frustrating me.
I went forth trying to disguise my conversation start after the replaced greeting, and I thought I was doing everything by the book, but the desired Comms wasn't happening, and I every time I got this error:
Code: Select all
[script.javaScript.exception.uncaughtException]: ***** JavaScript exception (BroadcastCommsMFD 1.3): uncaught exception: Invalid settings: Cannot use comm system message types.
Until I finally tried changing the display heading "Send greeting to target" to simply "Send greeting", which indeed turned out to have been the showstopper.
So, this it will not allow..
I was young, I was naïve. Jonny Cuba made me do it!
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: BroadcastComms MFD [Release]
Ah, yes! That was a bit of a "gotcha" moment waiting in the code. I'll have another look at what I'm doing there to make it at least more transparent, but hopefully more flexible as well.