Comms log MFD
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.
Comms log MFD
Link to download: https://app.box.com/s/rhhtuldcnuubz05ep40h
Link to wiki: http://wiki.alioth.net/index.php/CommsLogMFD
Also available via the Expansions pack list in the game itself.
Version 1.4 now available.
- Comms messages are now viewable in the dockside F4 Communications log, even if the scroller hasn't been purchased.
- Fixed bug where clearing the log while docked would hide the HUD.
- Fixed JS bug when clearing the log in flight.
- F4 comms log options will now show all options, with various items disabled based on the log viewing position and content.
- Code refactoring and cleanup.
Okay, here's what I have so far.
Comms log with a few messages in it. New messages are added to the bottom.
Comms log which has been scrolled back 2 messages
Scroller shown as available for purchase
Showing as primable equipment
Showing on ships interfaces
When ship interface active
Link to wiki: http://wiki.alioth.net/index.php/CommsLogMFD
Also available via the Expansions pack list in the game itself.
Version 1.4 now available.
- Comms messages are now viewable in the dockside F4 Communications log, even if the scroller hasn't been purchased.
- Fixed bug where clearing the log while docked would hide the HUD.
- Fixed JS bug when clearing the log in flight.
- F4 comms log options will now show all options, with various items disabled based on the log viewing position and content.
- Code refactoring and cleanup.
Okay, here's what I have so far.
Comms log with a few messages in it. New messages are added to the bottom.
Comms log which has been scrolled back 2 messages
Scroller shown as available for purchase
Showing as primable equipment
Showing on ships interfaces
When ship interface active
Last edited by phkb on Sat Jan 10, 2015 1:20 am, edited 5 times in total.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Comms log MFD
I like your solution to the problem of how to get it to scroll.. good idea.
The only thing I'd critique so far:
The only thing I'd critique so far:
"COMM LOG" really ought to be changed to COMMS LOG".phkb wrote:
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Comms log MFD
Is the MFD part of the scroller equipment, or does the MFD still work without the scroller installed, just with no scrolling facility?
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- 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: Comms log MFD
The MFD will work without the scroller. It would always display "Current" at the top, and new messages would keep getting appended to the bottom of the list. You'd only need the scroller to, you know, scroll.
And "COMMS LOG" now fixed.
And "COMMS LOG" now fixed.
- 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: Comms log MFD
So I now have a working OXZ ready for testing. What's the approved method for distributing these sort of things?
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Comms log MFD
If you're just wanting to test at this stage, uploading it to a file hosting site, such as box.com, then posting the link is easiest and quickest.
To have it available via the Expansion Manager will require you to obtain an OXZ account for oolite.org from cim, and a wiki account from Maik, after which you can go through the process which has been posted here somewhere, and I'll find in a minute for you.
Edit: See this post and the three that follow it:
https://bb.oolite.space/viewtopic.php?p=217518#p217518
To have it available via the Expansion Manager will require you to obtain an OXZ account for oolite.org from cim, and a wiki account from Maik, after which you can go through the process which has been posted here somewhere, and I'll find in a minute for you.
Edit: See this post and the three that follow it:
https://bb.oolite.space/viewtopic.php?p=217518#p217518
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- 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: Comms log MFD
OK, here's a Box.com download for the Comms Log MFD.oxz!
https://app.box.com/s/rhhtuldcnuubz05ep40h
I'd appreciate any feedback and comments, bug reports, anything really. And please let me know if I've done things the wrong way internally!
Edit: I did alter the final version of the OXZ. I decided the "Current" header was redundant and just cluttered the display. Now, when the Comms log is unscrolled it just reads "COMMS LOG:" in the header.
https://app.box.com/s/rhhtuldcnuubz05ep40h
I'd appreciate any feedback and comments, bug reports, anything really. And please let me know if I've done things the wrong way internally!
Edit: I did alter the final version of the OXZ. I decided the "Current" header was redundant and just cluttered the display. Now, when the Comms log is unscrolled it just reads "COMMS LOG:" in the header.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Comms log MFD
Very nice first addon, grats.
My notes:
-There is a 4.0 version from CC-BY-NC-SA license what you can consider.
-I suggest to name your MFD in setMultiFunctionText to "CommsLogMFD" exactly as your worldScript's name. In NumericHUD I use worldScript names to bring up MFDs and must handle separatedly if different.
-In the manifest description you can write "communications" and not "comms" due to the goal of this field is to explain for newbies what is "comms". MFD also.
-In the readme commsMFD.oxp should be CommsLogMFD.oxz .
-In equipment description the B and N key is better in lowercase to avoid pressing these with shift.
-You can use this.$commsMFD_log and similar variables and save to missionVariables in playerWillSaveGame and load in startUp for 60 times better performance. In this case you must use worldScripts.CommsLogMFD.$commsMFD_scroll in activated() and mode() and not this.$commsMFD_scroll due to these are not called within your worldScript but in an equipment script.
-I would like to read my comms from the previous flights also so I do not think you should reset it at every launch, I think a huge max. length is better. Strings in Oolite can grow up to 256MBytes (I measured in a stress-test) which is enough for a while.
My notes:
-There is a 4.0 version from CC-BY-NC-SA license what you can consider.
-I suggest to name your MFD in setMultiFunctionText to "CommsLogMFD" exactly as your worldScript's name. In NumericHUD I use worldScript names to bring up MFDs and must handle separatedly if different.
-In the manifest description you can write "communications" and not "comms" due to the goal of this field is to explain for newbies what is "comms". MFD also.
-In the readme commsMFD.oxp should be CommsLogMFD.oxz .
-In equipment description the B and N key is better in lowercase to avoid pressing these with shift.
-You can use this.$commsMFD_log and similar variables and save to missionVariables in playerWillSaveGame and load in startUp for 60 times better performance. In this case you must use worldScripts.CommsLogMFD.$commsMFD_scroll in activated() and mode() and not this.$commsMFD_scroll due to these are not called within your worldScript but in an equipment script.
-I would like to read my comms from the previous flights also so I do not think you should reset it at every launch, I think a huge max. length is better. Strings in Oolite can grow up to 256MBytes (I measured in a stress-test) which is enough for a while.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Comms log MFD
Except that many low-end computers (and consoles such as Pandora*) running Oolite only have 1GB of RAM. They'd choke to death, long before it got to that point. Better to make it a configurable option, I would suggest.Norby wrote:Strings in Oolite can grow up to 256MBytes (I measured in a stress-test) which is enough for a while.
* RAM-wise, the Pandora only just copes with Oolite as it is..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Comms log MFD
Ok, but I do not think a string with max. 32kByte length can cause any problems in 1GB.
I suggest to handle the comms not line but message based: count how many messages stored and display in the first line the total messages and the number of lastly displayed one. In this way a keypress can step up a whole message (sometimes 5 lines at once) which help a lot in long scrolls due to no repeat if you hold down the key.
If you comment out not only the whole shipWillLaunchFromStation but the _log and _maxscroll lines from the startUp then the content of comms remain after save and load game.
I suggest to handle the comms not line but message based: count how many messages stored and display in the first line the total messages and the number of lastly displayed one. In this way a keypress can step up a whole message (sometimes 5 lines at once) which help a lot in long scrolls due to no repeat if you hold down the key.
If you comment out not only the whole shipWillLaunchFromStation but the _log and _maxscroll lines from the startUp then the content of comms remain after save and load game.
Re: Comms log MFD
32kb should be fine - but remember that the Javascript engine does not have access to the full system memory: it gets 32Mb and that's it - and most of that should be kept empty for best performance and to avoid too many inconvenient pauses for garbage collection.
In practice you have to be doing something large to use a significant amount of it, because a lot of the things you're reading and writing (e.g. ships, systems, mission variables) don't permanently count towards that limit: they're just interfaces to data in the main Oolite memory space.
A permanent log of every message ever received probably would cause problems however...
In practice you have to be doing something large to use a significant amount of it, because a lot of the things you're reading and writing (e.g. ships, systems, mission variables) don't permanently count towards that limit: they're just interfaces to data in the main Oolite memory space.
A permanent log of every message ever received probably would cause problems however...
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Comms log MFD
Maybe a limit in stored messages is better than the total length. I suggest the last 1000 comms which is the same order of magnitude than 32kb.
- 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: Comms log MFD
If the log keeps growing, would it be useful to include some form of separator? For instance, each time the player docks and launches, include
That way, when you're scroll back through pages of messages, it's clearer where you were when you received those messages.
Code: Select all
Docked with Lave station.
Launch clearance received from Lave station.
- pagroove
- ---- E L I T E ----
- Posts: 3035
- Joined: Wed Feb 21, 2007 11:52 pm
- Location: On a famous planet
Re: Comms log MFD
phkb wrote:If the log keeps growing, would it be useful to include some form of separator? For instance, each time the player docks and launches, includeThat way, when you're scroll back through pages of messages, it's clearer where you were when you received those messages.Code: Select all
Docked with Lave station. Launch clearance received from Lave station.
That is a good idea methinks .
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
https://bb.oolite.space/viewtopic.php?f=4&t=13709
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
https://bb.oolite.space/viewtopic.php?f=4&t=13709
- 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: Comms log MFD
If the log keeps growing, it might be useful to offer the option of clearing the log manually. Ideally this would be available in-flight as well as docked. Any suggestions on the best way of achieving this?