Author Topic: Question about expoted levels and globaldata files  (Read 137 times)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Question about expoted levels and globaldata files
« on: August 14, 2017, 05:23:53 PM »
For the exported level and globaldata files, are we able to put comments in them? If so, what characters do we use at the start of the line?

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #1 on: August 14, 2017, 06:41:12 PM »
Hang in there.  I am investigating possibilities.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #2 on: August 14, 2017, 07:23:00 PM »
Here is the start of a level007.txt file that I created:

Code: [Select]
{

"AnyUnusedName":"Unused tags are ignored",
"So use them freely":"",
"And whitespace is ignored, too":"",
   
   
   "levelInfo":{
      "Comment":"This is the best level ever says Homer Simpson",
      "height":"35",
      "width":"35",

Any place a tag and value are legal, you can
insert unused tags along with their values.
Of course, they will not survive an 'import/export"
cycle.  Because they are ignored.

Unfortunately, the current editor does not like
the carriage returns that most windows editors
insert.  So, if you have problems with "Missing colon"
errors, wait for the next version of the editor.
Available within hours if all goes well here.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: Question about expoted levels and globaldata files
« Reply #3 on: August 14, 2017, 07:34:43 PM »
thank you, Paul. :)

Windows carriage return has been an annnoyance for a while - it always gives you a line in between.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #4 on: August 14, 2017, 07:45:00 PM »
Things have gone very well.  The dishes have been
washed, dried, and put away.  The family is settled
for the evening.  Editor version 3.07 has been posted.
It treats carriage returns in json files as whitespace.

Do you have other instances where carriage returns
have been an annoyance?

By-the-way....I think this might even be legal

Code: [Select]
    "Comment":"start of a long comment
and the continuation of a long comment
and the end of a long comment",
But I did not try it.
« Last Edit: August 14, 2017, 07:48:44 PM by Paul R. Stevens »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: Question about expoted levels and globaldata files
« Reply #5 on: August 15, 2017, 01:03:04 PM »
this is great.. I have some texxts, and I bet Dinonykos does too, that are long enough to be wrapped around in my texxt editor, and it will be nice to insert a carriage return so i can more easily read them. :D

The only other issues I have with carriae returns are in event texts - a carriage return returns two lines instead of just one.
So,...
Code: [Select]
The big fish
The little fish

...comes out looking like...

Code: [Select]
The big fish

The little fish

I have in my notes that we can use "/n" instead of a carriage return, but I believe that was only a proposal, since I don't see it having ever been implemented.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #6 on: August 15, 2017, 02:19:17 PM »
That's not good.  I will look into it while
waiting for Dinonykos' MIDI report.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: Question about expoted levels and globaldata files
« Reply #7 on: August 15, 2017, 02:58:33 PM »
That's not good.  I will look into it while
waiting for Dinonykos' MIDI report.

Thanks, Paul.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #8 on: August 15, 2017, 08:08:33 PM »
Engine version 3.08 (not posted because of the following
concerns) does not insert this extra line.

But it used to be very careful to insert that blank line.
I fear we have broken backward compatibility.  The
'newline' must have been intended as a 'new paragraph'.
Some people may have taken advantage of this.

I'll post version 3.08 if that is what you want.  I do not see
any clean way of solving your problem.  A dozen different
events have text.  The only thing I can think of to maintain
backward compatibility and make you happy is to add a
global checkbox that says "Treat Carriage-return/Backspace
sequence as a paragraph separator by inserting a blank line"
and having that check box selected by default.  Other options
would require you to go through your design and fiddle with
each and every multiple-line text.

A big advantage of releasing a version that breaks backward
compatibility is that it would provide a more nearly what-you-
see-is-what-you-get experience.
« Last Edit: August 15, 2017, 08:10:53 PM by Paul R. Stevens »

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1945
Re: Question about expoted levels and globaldata files
« Reply #9 on: August 16, 2017, 04:20:53 AM »
I definitely favour breaking backwards compatibility on this one feature. In fact, I had always regarded this as a bug (and had previously reported it, I'm pretty sure) that would be fixed some day, and had used carriage returns in text events on that assumption.

Offline Dinonykos

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2312
    • Dinonykos Dungeon Craft
Re: Question about expoted levels and globaldata files
« Reply #10 on: August 16, 2017, 01:18:08 PM »
I was always confused by this (that a new line was separated via a blank line). I agree with Steve. I am quite sure that in my designs it would not cause a problem (I mean when converting the old designs to newer DC versions).

Of course, the global checkbox idea is good in case that somebody really wanted new paragraphs when using carriage return in his/her text events.
Find four contributions to the Pre-Generated Character Mini-Module Design Contest on my homepage.
New: THE AMBASSADOR'S LETTER, my contribution to the 7-day-challenge.
DINONYKOS DUNGEON CRAFT DESIGN HOMEPAGE

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9763
Re: Question about expoted levels and globaldata files
« Reply #11 on: August 16, 2017, 01:20:09 PM »
I am with Steve on this. I use lots of line breaks, and have always intended them to not have an extra line, thinking that someday we would get this resolved.

Why did it take so long? The last time I brought this up, Richard was still around sometimes and he told me that this was a windows thing, not a DC thing. It could be fixed, but it would take a lot of work to figure out how, and so it was punted down the road.
At some point, nologgie in discussioin with someone that wasn't me, came up with '/n' to indicate a line break because it was thought that this could be done in a way that Windows did not see see as a carriage retrun giving the extra line. This was never imlemented. And since nologgie is no longer around, there was no proponent for this feature.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #12 on: August 16, 2017, 05:19:35 PM »
OK.  Engine version 3.08 will be posted
in about five minutes.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2157
    • Nol Drek's Web Site
Re: Question about expoted levels and globaldata files
« Reply #13 on: August 16, 2017, 07:28:36 PM »
The current design I'm working on uses /n in many places. This causes the subsequent text to be displayed in a new text box after the user presses "Enter". I also use /h to highlight text and /w, /y, etc. to set the text color

Will the new version continue to support the use of "/n"?
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2220
Re: Question about expoted levels and globaldata files
« Reply #14 on: August 16, 2017, 08:13:36 PM »
Quote
Will the new version continue to support the use of "/n"

If it does not, you have every right to complain.
I hope that it does but did not test it.

 

anything