Fixed bug in story editor
As I had mentioned yesterday at late night, there was a small but highly annoying bug in the Story Editor, which I have now fixed.
You can download a new version here: Story Editor V0.0.0.2
Next week I will add reordering in it. If anyone comes across a bug, feel free to reply on this post.
Releasing first version of Story Editor
As you can read from the title, I'm releasing the very first version of story editor. If it's not working please let me know.
You can download Story Editor for free from here.
Just extract it where you want it and run StoryEditor. The application should explain itself but if you really need some guidance, just press ctrl+O and open "tutorial story" and if you wonder if you should open the zip file or not, then yes, it is the zip file. If have not yet decided on a extension, so until then it will remain to be zip file. Anyway the tutorial should explain a few things.
For now I'm going to bed and get some of those fairly rare Zzz's.
UPDATE: There has already been a bug found. If you remove anything but the last scene then the scene that is selected after that will contain what was in the old scene. So don't press remove: I will have this fixed tomorrow.
Story Editor template system
OK, I have done some thinking about where I want to go with Story Editor when I have finished the outline (chapters & scenes) section. What you see in most editors is that at one point you can create items, characters, locations and maybe a few other things.
However I recall that at one time I was writing a fantasy story which was a bit heavy with spells and frankly I needed that to have that information to be written down as well. Now let's say you are working on a story that involves all kind of politics and parties. You can shove those under items, characters or locations. In fact you want to have the rightwing party to be seen as a completly different group.
So this night I was thinking about how to address this issue and finally I figured out that I will drop all support for items, characters and locations. The tabs with those really nice looking icons will thus be dropped.
Wait? What? You drop something because you need more of it?
Yes, because I don't know what you (or me in the far future) wants or expects from the project and a smart programmer is a lazy programmer.
However that doesn't mean that those features are lost. No, they don't exist yet but if you want them you can create them yourself.
It's going to be part of my CustomData system which I originally only wanted to use to give extra properties to characters. Now I'm going to give the user the control to fully create their own templates.
I look at the above idea what quite a bit of reservation, but I think that users, once they understand the system, are really going to like it. And for those who have difficulty understanding, I can always generate a few basic templates like characters, items and locations so that they can start working with the program to begin with it.
For now however I'm finishing the outline of the story and making certain that it works so that hopefully I can release the very first demo this week.
Story editor
The Story Editor is slowly but steady making progress. The reason why it goes so slow is because I'm trying to ensure that the GUI will be of high quality. So I take special care and you might have done one thing fairly different that most text editors or story writers: There is only a little bit of text.
The reason why I want so little text is because Dutch is my native language although the majority of the time I working in English. From time to time I also try to write English stories and I have noticed that when I see something in a foreign language I also start thinking in that language. That is cool except the fact that I'm trying to write a story in another language. "It's a huge pain in the ass wanneer je opeens in het Nederlands ga schrijven" (translated: It's a pain in the ass when you suddenly start to write in Dutch). So I take special care of that. I'm still not certain what to do with words like "Chapter" or "Scene", or even "File" but for some reason I don't find those not that intrusive. At the same time however I think that localization (L10n) will be implemented as soon as I'm able.
The other thing I take special care of is the outline editor (what you see on the right). I have experimented with various forms (Tree Lists, zooming in and out) but I found out that this method is most likely the best way to do it. Tree Lists didn't format nicely and zooming in and out would have mean you could only see one chapter at the time.
Also I have finally implemented the ability to load and save. I mean I can understand that you don't want to write your story completely in one go. Saving is also cool. For starters there are multiple files (each scene, chapter, character, location, item et cetera) is put in a different file. However I don't like multiple files. I like one file so what it does is combine everything in one zip archive. This is cool, because if you have a custom tool (spell checker for example) you can just extract the file and run the tool. No need for a propriety format. Although zipping things in can be rather slow. Microsoft Office 2007 docx files have that problem as well, although now that I think about, it remains fast enough and if need be I can always move it to a thread or allow it to be saved without zipping it in (thus a collection of folders and files).
The last thing I want to mention is skinning. Personally I don't really care about it, but I know people who like it, so I have added that as well. Thanks to DevExpress there are already 31 skins in it. And here are a few examples:
So what is left?
Well first of all the Outline (chapters and scenes) needs to be finished. I want to be able to add chapters and scenes, remove them as well. And the last thing is actually being able to write. Oh before I forget it again: I want to be able to output the entire story in one document.
Extending exceptions
Sometimes you have a function which needs to communicate back on failure through special exceptions as you want to program have the option to fix certain functions. For example a formula whose input parameter is bad (example: begin date is after the end date) or when the database throws up or anything.
Now you could do the following:
public class EndDateBeforeBeginDateException : Exception { }
class example
{
void SomethingWithTime(DateTime begin, DateTime end)
{
if (begin > end) throw new EndDateBeforeBeginDateException();
// ... do something with time ....
}
void DemonstrateFunctionTriesToCorrectInsteadOfFail()
{
DateTime input_begin = new DateTime();
DateTime input_end = input_begin.AddDays(-1); // WRONG DATE ON PURPOSE!
do
{
try
{
SomethingWithTime(input_begin, input_end);
}
catch (EndDateBeforeBeginDateException)
{
// Date was most likely wrong ask user
var r = MessageBox.Show("The end date was before the begin date."
+ "Do you want to switch them and try again?",
"Switch dates?",
MessageBoxButtons.YesNo);
if (r != DialogResult.No) { return; } // quit function
var temp = input_begin;
input_begin = input_end;
input_end = temp;
continue; // Try again now
}
} while (false);
}
}
But what if you have a lot of parameters. You don't want to create thousands of exceptions. Well, you can try using tagged exceptions which looks like this.
public class TaggedException<T> : Exception { }
struct _EndDateBeforeBeginDateTag{}
struct _SameDateTag {}
struct _TimeDoesNotExistTag {}
struct _ThinkOfATagOnYourOwn {}
class example
{
void SomethingWithTime(DateTime begin, DateTime end)
{
if (begin > end) throw new TaggedException<_EndDateBeforeBeginDateTag>();
if (begin == end) throw new TaggedException<_SameDateTag>();
// ... do something with time ....
}
void DemonstrateFunctionTriesToCorrectInsteadOfFail()
{
DateTime input_begin = new DateTime();
DateTime input_end = input_begin.AddDays(-1); // WRONG DATE ON PURPOSE!
do
{
try
{
SomethingWithTime(input_begin, input_end);
}
catch (TaggedException<_EndDateBeforeBeginDateTag>)
{
// Date was most likely wrong ask user
var r = MessageBox.Show("The end date was before the begin date."
+ "Do you want to switch them and try again?",
"Switch dates?",
MessageBoxButtons.YesNo);
if (r != DialogResult.No) { return; } // quit function
var temp = input_begin;
input_begin = input_end;
input_end = temp;
continue; // Try again now
}catch (TaggedException<_SameDateTag>)
{
// Force the user to change one date
}catch (TaggedException<_ThinkOfATagOnYourOwn>)
{
// Tag seems obvious enough *wink*
}
} while (false);
}
}
Now you only have one Exception in your code though you can quickly and without having to write much code.
(And if you are smart you store extra info the tag which is stored in the exception).
The same trick also works in C++ using templates.
I’m born in 1910
Yes, it's true I'm a hundred years old, now please move over and let me read what I came to read.
Of course, I'm not that old, but I have always wondered about the need for an age check. In the past I always filled them in correctly (2 years in the past) but now I see no need for it. The reason for an age check was because content distributors could keep someone away from certain content unless they were old enough. As if physical age should have been a determining factor.
Besides that it easy to work around (see screenshot, it's called lying, just so you know) couldn't they have just asked in what age group I fall? Am I or am I older than 21/18/15/13 et cetera. It would be one click instead of four clicks. And if they could also allow me to change my age after a wrong input, that would be nice. I once was 5 years old and could not correct it to 24, the solution was to delete the cookies and try again.
Please drop this system and use something more mature...
But the problem is that they use that information as marketing material to answer the question "What should be our focus group?". Since I'm not the only one who 'cheats' his way around I guess that some people are still wondering what a bunch of 100 year old guys and girls are interested in games (and various other age limited stuff).
Story editor
I like writing stories. They are a form of entertainment to me and as such I enjoy spending my time in writing something else then code. However I have never found a tool that met my requirements. In my opinion an application for creative story writing should be focused on allowing you to write as comfortable as possible without any distraction, which often means you turn off the automatic spell-checker and more.
Now Microsoft Word would have been a great tool were it not that I need to keep track of all kinds of things in my story. I used to do this with an Excel file but that didn't work. I have tried some of the creative story writing software out there (open-source, free and commercial) but they either provided too much, miss certain features or required me to work in a way I thought was cumbersome (I don't want a pop-up when I look at details of a person).
So I have decided to write my very own story editor.
A key feature will be that it uses a dynamic data format. In most applications you can add and edit your characters but then you only a few predefined fields available, like name, birthday, bio and notes. If you are writing a deep space story which involves many alien races you would need to define that for each character in the bio. In my story editor I want to be able to just add an extra field.
Another feature I'm going to put in for certain is that everything can have transient properties, which is fancy way of saying that some properties might not last forever. In the Lord of the Rings we see that the one ring switches quite a bit from owner. Having one field to track information about the owner would be insufficient as I want to know the owner of the ring at a certain point in time. Of course, this system is a bit cumbersome when you want to keep track of the owner of the a ball in a football match.
The first release will be when the editing of files and the outline editor fully works.
Driving in foreign country
Yesterday I drove back from Belgium and I was surprised about the amount of cars overtaking me from the wrong side (some people were actually zigzagging through the traffic!), the amount of people who kept driving in the fast lane (rule is that you use the fast lane when overtaking) and speeding (I have seen Ferrari and Porsches passing me in an instant while was I was already at (and a bit over) the speed limit) .
In the Netherlands we sometimes joke that the 'belgen' (Belgians) get their drivers license with a pack of coffee, but with what I have seen yesterday I can only hope that those people (excluding all normal, correct, driving Belgians) got their license with a pack of coffee.
Two weeks earlier I was on vacation in Ireland on a car vacation. There they don't have a formal institution for driving licenses (at least that is what I thought I heard on the radio) but in that week that I was driving there it didn't even come close to the number of traffic violations that I saw on a single day in Belgium.
I'm curious about what others think about drivers from other countries.



