Page 1 of 1

[DIS] Speech and Narrator functions

Posted: 28 Nov 2016, 03:38
by Reid
We added two functions a year ago that help us to keep our script cleaner, basically it resumes a script code like this :

Code: Select all

mesn; // NPC Name in between square brackets
mesq "string 1"; // Dialog line 1
next;
mesq "string 2"; // Dialog line 2
next;
mesq "string 3"; // Dialog line 3
into a script like this :

Code: Select all

speech "string 1",
       "string 2",
       "string 3";
The narrator() function is the same than speech, but it replaces the NPC name of mesn into [Narrator].

We improved that function with some bit flags to carry some cosmetic settings.
e. g. from the doc:

Code: Select all

If first arg is a number N, then it represents bit flags.
Bit flags :
   0x1 -- blank line at beginning
   0x2 -- blank line at the end
   0x4 -- use last "next;"
   0x8 -- don't use first "mesn;"
We combine a lot of these bit flags in our scripts, and it is sometimes hard to read through it as there are some fancy numbers next to our speech() functions.

IMO it's not easy to learn how to script with all of these bit flags, and I must admit that I sometimes look at our documentation as I forget what some flags mean... So it's why I opened this thread.
What should we do to make it easier for new or casual scripters?
Should we use constant names instead of values?
Should we change these functions?
Something else?

Re: [DIS] Speech and Narrator functions

Posted: 28 Nov 2016, 12:54
by WildX
Reid wrote: Should we use constant names instead of values?
Maybe this.

It seems pretty simplified already. The main thing we need is a detailed tutorial on the wiki with step-by-step instructions on how to get started. It's easier to RTFM if "TFM" is stupid-proof.