Email System (Release)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Email System (Release)

Post 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:
  1. The ability to re-read emails after you receive them
  2. 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:
Image
Image
Image
Image
Image

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!
Last edited by phkb on Fri Nov 04, 2016 2:38 am, edited 16 times in total.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Email System (Beta)

Post 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.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Email System (Beta)

Post 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.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Email System (Beta)

Post 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.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Email System (Beta)

Post 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.
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Email System (Beta)

Post 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? :)
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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.
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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. :wink:
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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!
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Email System (Beta)

Post 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.
Last edited by Wildeblood on Sun Feb 08, 2015 4:48 pm, edited 1 time in total.
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post by phkb »

And spam is good, right? :)
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Email System (Beta)

Post 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.
User avatar
phkb
Impressively Grand Sub-Admiral
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: Email System (Beta)

Post 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.
Post Reply