[DIS] Speech and Narrator functions

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
TMW Adviser
TMW Adviser
Posts: 1416
Joined: 15 May 2010, 22:39
Location: Artis

[DIS] Speech and Narrator functions

Post by Reid » 28 Nov 2016, 04:38

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
mesq "string 2"; // Dialog line 2
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?
"Time is an illusion. Lunchtime doubly so."
-- Ford Prefect
User avatar
Development Producer
Development Producer
Posts: 1396
Joined: 07 Aug 2010, 15:13
Location: United Kingdom

Re: [DIS] Speech and Narrator functions

Post by WildX » 28 Nov 2016, 13:54

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