Page 1 of 13
Email System (Release)
Posted: Sun Jan 25, 2015 3:53 am
by phkb
For a long time Oolite players have been receiving mission screens that array themselves as an email message. This makes sense in-game, as you would imagine a lot of communication between the player and NPC's in the game world would take place inside the bounds of an email system. However, while the conceit of an email system has been present, many other aspects of a true email system are lacking. In particular:
- The ability to re-read emails after you receive them
- The ability to analyse the trace of an email (ie, the path the email took to reach the player).
The Email System OXP attempts to address these shortcomings and provide (as much as possible) a true, in-game email system.
You can download version 1.7.1 here:
https://app.box.com/s/jb3rzelnmao1xroh9rb2jhjr8esnhk06
To install, unzip the OXP to your AddOns folder.
You can download an OXZ version here:
https://app.box.com/s/hzzcwz0mzvst41h3p5q90250xihdw3aj
Save this file directly into your AddOns folder.
You can also download this via the Expansion Manager.
Click
here to visit the wiki page.
The readme file in the OXP package has all the details about how to use the system.
As part of the system, the player will start receiving emails from GALCOP and other entities, confirming actions that have taken place.
In 1.80, the player will receive email confirmations for the following events:
- docking without clearance
- bounty payments
- fine payments
In 1.81, the player will also receive email confirmations for the following events:
- starting and completing contracts (cargo, passenger and parcel)
- rescuing escape pods
(If you have any suggestions for other game event that could be covered in the same way, please let me know!)
Here are some screenshots of the system in game:
The OXP has a readme which includes examples on how to make use of the email system in other OXP's. For a simple example:
Code: Select all
w = worldScripts.EmailSystem;
w.$createEmail({sender:"Captain Solo", // senders name or email address
subject:"I've got a bad feeling about this", // subject line
date:global.clock.seconds, // the time the email was sent
message:"I thought they smelled bad on the outside." // body text of the email
);
Included in the OXP package is a simple mission OXP that demonstrates how to make use of the email system for mission OXP's. There are examples of how to ask the player for responses, using the trace system, and forcing the player to response when an email is opened.
Comments welcome!
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 9:07 am
by Wildeblood
I'm hostile to the idea of having to faff about buying what I perceive to be a pointless EQ, rather than download an OXP and have it just work. I feel the same about all the MFD OXPs out there. Is there a technical reason for that choice?
There's some unnecessary bloat in the JS. Which is an opportunity to trim fat without affecting function, so that's good.
The interface functions need a re-think. When adding a message, send the whole message as a single object parameter, rather than individual parameters? Definitely store the galaxy numbers with system IDs - not all players agree with the idea that a galactic jump is a Big Deal that's makes everything reset., and in 1.81 sysInfo from other charts is no longer verboten.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 9:15 am
by spara
Wildeblood wrote:I'm hostile to the idea of having to faff about buying what I perceive to be a pointless EQ, rather than download an OXP and have it just work. I feel the same about all the MFD OXPs out there.
It's more or less a money sink type of design choice.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 9:32 am
by Wildeblood
spara wrote:Wildeblood wrote:I'm hostile to the idea of having to faff about buying what I perceive to be a pointless EQ, rather than download an OXP and have it just work. I feel the same about all the MFD OXPs out there.
It's more or less a money sink type of design choice.
I know, but it doesn't cost enough - and is usually only one off - to accomplish that. Meanwhile the JS functions that use the EQ array are some of the slowest and should be avoided if possible. And in-game it just seems lame, although interstellar email is more believable than MFDs as something that could be charged for, I suppose.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 12:57 pm
by Norby
Nice idea imho, I would like to write emails also.
The textEntry field of
runScreen can get what the player type into a subject and a body line. This would be good for making notes for myself or post my tales to a friend. Moreover with future OXP improvements player could ask for jobs and reply an "ok" when accept an offer, or order something from the customer support of an equipment, etc.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 2:25 pm
by phkb
Wildeblood wrote:Is there a technical reason for that choice?
Not really, other than I had observed many other OXP's doing the same thing and came to the conclusion that this was the way to do it. I wasn't intending it as a money-sink. The purchase cost was a token, because I thought this was the right way of doing it.
Wildeblood wrote:There's some unnecessary bloat in the JS.
OK, I'll take another look.
Wildeblood wrote:Definitely store the galaxy numbers with system IDs
Good point. On the list for the next version.
Wildeblood wrote:send the whole message as a single object parameter, rather than individual parameters
Does sending an object rather than parameters make a difference in performance, or in usability? In my experience I prefer having a defined list of parameters in the function call, but if there is greater preference is for passing objects I can certainly change it.
Norby wrote:The textEntry field of runScreen can get what the player type into a subject and a body line.
I'll have a play around with this and see what I can come up with.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 2:35 pm
by Disembodied
phkb wrote:If you have any suggestions for other game event that could be covered in the same way, please let me know!
Mission text from the built-in missions (Constrictor, Thargoid Plans, etc.)? The occasional piece of Trumble-related spam?
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 2:49 pm
by phkb
Disembodied wrote:Mission text from the built-in missions
I'd like to pick up all the mission screen text, particularly the ones you mentioned, but I'm not sure how to hook into a running mission screen and pull down all the text being displayed. If there is a way to do this, and someone can point me in the right direction, I'll certainly give it a go.
Re: Email System (Beta)
Posted: Sun Jan 25, 2015 2:54 pm
by phkb
Disembodied wrote:The occasional piece of Trumble-related spam
I was actually thinking of adding a "spam" OXP, which would send you emails in each system, based on the economy type/govenment type, but decided against it (for the moment) mainly because I'd expect that by the time the game is set in, there would be no spam! But maybe that's putting too much faith in the ability of software engineers to eradicate the problem, or too little faith in spammers' ability to get around the problem.
Re: Email System (Beta)
Posted: Mon Jan 26, 2015 5:49 am
by phkb
send the whole message as a single object parameter, rather than individual parameters
Actually, on changing the code to use an object I think it actually makes the code more readable. Thanks for the tip, Wildeblood!
Re: Email System (Beta)
Posted: Wed Jan 28, 2015 6:20 am
by phkb
Version 1.0.1 have been released. Download links in the first post.
In this version:
- Changed createEmail function call to use an object, rather than parameters.
- Added galaxy number to stored emails, which will be displayed when the player is in a galaxy other than the one they received the email in.
- fixed bug that was preventing bounty email from being sent
- fixed bug that was sending a docking clearance penalty notice when docking clearance was about to expire
- Spelling fixes
- Code cleanup
Re: Email System (Beta)
Posted: Wed Jan 28, 2015 1:19 pm
by Wildeblood
Spam, spam, spam! I made this version of my Autotrade Report Screen plug-in so Autotrade can send you email reports of its activities:-
Obsolete link removed.
And I left the previous version script inside so you can see exactly how much I added to link with the EmailSystem OXP.
Re: Email System (Beta)
Posted: Wed Jan 28, 2015 1:51 pm
by phkb
And spam is good, right?
Re: Email System (Beta)
Posted: Thu Jan 29, 2015 6:42 am
by Wildeblood
phkb wrote:And spam is good, right?
I thought so.
I want an "expires" property on the email object, so I can set a future date it will be automatically deleted, and some clear instructions for calculating the time. ("I was reading an email when it deleted itself after seven seconds!?" "Sorry, dude, that was meant to be seven days.") There's no need to implement this auto-deletion (yet), just ensure an email object with an expires property won't be rejected by the createEmail function as malformed.
When I used the "Close this email & open the next" option, the next was displayed with headers only, no main body text shown.
Having all those mission variables seems totally bogus. Are you using those directly to create the mission screens, or just to save the database between game sessions? If the former, I'll shut up, because I'm mystified by mission screens. If the latter, that's bodgey as; a single mission variable with the whole database JSON serialized should do.
What happens if I put something long in the sender field? For my spam plug-in I wanted to use "GALClear clearing & settlements" but used "Trading Assistant" instead, because it looked like anything longer would make a mess.
Re: Email System (Beta)
Posted: Thu Jan 29, 2015 8:53 am
by phkb
Expires property: Good idea - I'll look into it.
Close and open next: Smells like a bug to me. On it.
Mission variables: Yeah, I tried the JSON thing but couldn't get it to work, something to do with having sub objects. I'll try again.
Long sender field: It will be truncated on the inbox display, to keep the columns in line. I haven't tried really long senders to see what happens on the message display though. I'll look into it.