JasonLautzenheiser / trizbort

Trizbort, the Interactive Fiction Mapper
http://www.trizbort.com
Other
130 stars 35 forks source link

Allow for creation of people, supporters and containers #65

Closed JasonLautzenheiser closed 8 years ago

JasonLautzenheiser commented 9 years ago

I've seen a few suggestions fly on this:

Statue
Table -
     Flowerpot o
          Bouquet

Platform -
     Chair -
          Santa Claus +

Large nesting doll o
     Medium nesting doll o
          Small nesting doll

Charles +
     Wallet o
          Money
          Credit card

where,

+ is a person
o is a container
- is a supporter. 
No symbol is a thing.
JasonLautzenheiser commented 9 years ago

If you knew the syntax, this would work great, another option would be a more object oriented way with separate sections for objects and people, and give the ability to add properties to individual objects.

JasonLautzenheiser commented 9 years ago

Both have their pro's and con's.

The text only way, gives ease of entry....if you know the syntax

The separate section way, gives plenty of flexibility and it's obvious what and how you are putting items in, but makes it slower and more difficult to enter things especially for experienced users.

JasonLautzenheiser commented 9 years ago

I'm inclined to do the textual syntax way first and then give it a GUI if needed and requested.

andrewschultz commented 9 years ago

That feels right to me, too. I like the idea of keeping it simple. It might be useful to have a popup if the user pushes F1 with the room properties dialog up, so they can refresh what the syntax means.

andrewschultz commented 8 years ago

https://github.com/genstein/trizbort/issues/3 has a few other interesting features. It would be neat to have, say,

(m) to force male (f) to force female (n) to force neuter

(s) to force singular (p) to force plural

I don't know if people would have to know the syntax. Maybe a tooltip if the user hovered over the "&Objects" tab?

andrewschultz commented 8 years ago

I had some luck getting things to work as follows. I don't see us using brackets that much, so they may do for meta-information.

[m] = male person [f] = female person [n] = neuter person [p] = proper-named (if Inform can't detect it) [s] = scenery [u] = supporter [c] = container (already done with spaces but potentially a bit awkward) [2] = plural-named

You can combine these, too, but at your own risk e.g. [fn] would maybe throw a warning.

I'm not sure where it would be best to add this. I would think that, if we had ObjectName, we could have ObjectScreenName (ObjectName without []) and ObjectProperties (what's in the []) so that we could have things sorted right away.

So somewhere we'd have

      Regex regex = new Regex(@"\[[a-z]+\]");
      Match match = regex.Match(name);
      name = Regex.Replace(name, @"\[[a-z0-9]+\]", "");

private bool printThisLoc would have (note--this has bugs with format, etc. but is an example)

        foreach (var thing in location.Things)
        {
          var whatsit = "";
          exportedThings = true;

          if (thing.plural) { whatsit = whatsit + " a plural-named"; }
          if (thing.proper) { whatsit = whatsit + " a proper-named"; }
          if (thing.scenery) { whatsit = whatsit + " scenery"; }
          if (thing.person)
          {
            if (thing.male) { whatsit = whatsit + " male"; }
            if (thing.female) { whatsit = whatsit + " female"; }
            whatsit = whatsit + " person";
          }
          if (thing.Container == null)
          {
            writer.Write("{0}{1} {2}{3} in {4}.", thing.proper ? "" : getArticle(thing.ExportName), thing.ExportName, isAre(thing.ExportName), whatsit, thing.Location.ExportName);
          }
          else
          {
            writer.Write("{0}{1} {2}{3} in the {4}.", getArticle(thing.ExportName), thing.ExportName, isAre(thing.ExportName), whatsit, thing.Container.ExportName);
          }
          if (thing.DisplayName != thing.ExportName)
          {
            writer.Write(" It is privately-named. The printed name of it is {0}{1} Understand {2} as {3}.", toInform7PrintableString(thing.DisplayName), thing.DisplayName.EndsWith(".") ? string.Empty : ".", toInform7UnderstandWords(thing.DisplayName), thing.ExportName);

protected class Thing, in CodeExporter.cs, would contain public bool female {get; private set;} = false, public bool male = false, etc.

andrewschultz commented 8 years ago

I'd like to send in a pull request for this as sort of the last feature I want to do this year. Do you think that what I have is worth making into a feature, or should it be designed a different way? From a practical perspective, this is the one really big change that would help Trizbort export nice sample code and look nice. Maybe it could put people in bold or scenery in italics in the main map, too.

JasonLautzenheiser commented 8 years ago

I like this as a start. Once someone knows the syntax it will allow for some pretty quick creation of game objects. Go ahead and implement if you'd like and then like you say, maybe this will be the last major feature this year. We can do some testing and fix any bugs that appear, but we can plan a release for sometime after Christmas.