[DIS] Speech and Narrator functions

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
Reid
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 1549
Joined: 15 May 2010, 21:39
Location: Artis
Contact:

[DIS] Speech and Narrator functions

Post 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?
"Time is an illusion. Lunchtime doubly so."
-- Ford Prefect
User avatar
WildX
Source of Mana
Source of Mana
Posts: 2084
Joined: 07 Aug 2010, 14:13
Location: United Kingdom
Contact:

Re: [DIS] Speech and Narrator functions

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

TMW Team member

Post Reply