# Request for Comments: S^2 Language

This topic is 4711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

This is an introduction and invitation for criticism for a scripting language I've been working on, designed to write, well, scripts. Hence the name: ScriptScipt, or simply S^2. The objective of S^2 is to create a language that resembles regular screenplay format, but allows dynamic flow of dialouge in an easy and maintainable way. I've already have a good chunk of the interpreter written, but syntax isn't written in stone. I'm looking for any comments. How the syntax can be improved or simplified? Would you ever considered using the language? etc. This is the standard example I give.
character WIFE;
character HUSBAND;

WIFE: DoILookFat{
line=
"Does this blouse make my hips look big?";

nextline=
HUSBAND: Yes or HUSBAND: No;
}

HUSBAND: Yes{
line=
“Uhh, I guess";

nextline=
WIFE: Pissed;
}

HUSBAND: No{
line=
"No way honey!  You look fantastic!.";

nextline=
WIFE: Thankful;
}


This gives good feeling for the syntax. Whitespace is ignored and the character names are only capitalized by convention. I think its pretty simple to figure out. Blocks of dialogue are named to allow jumping from one block to another (eg. "WIFE: DoILookFat"). At the line: "nextline = HUSBAND: Yes or HUSBAND: No;" The player is prompted with a choice. Comments are the same as C++ ('//' for line comments, '/*' and '*/' for block comments). There are also dynamically typed variables. Which can come in handy for more complex dialogue (expecially booleans). There are also control statements "if", "while", and "else".
var WIFE: HavingAGoodDay;

//...

WIFE: Respond{
if( HavingAGoodDay ){
nextline = WIFE: ForgiveHim;
}
else{
nextline = WIFE: ScoldHim;
}
}


Thats the basics, thanks for reading.

##### Share on other sites
For your

nextline=
HUSBAND: Yes or HUSBAND: No;

What determines which path is chosen? If the HUSBAND is the PC, what are displayed as the actual choices?

How do you insert variables in the "line"? For example:
var WIFE: visitor_name;WIFE: Greet_Gr1{  line=  "%s is looking for you." visitor_name;}

If you are displaying the scripts in real time, delays can be important. How do you handle the pausing points? In what ways does your script support simultaneous actions?

Is there any higher level organization in terms of a conversation? (instead of the characters?)

What kind of interactions have you chosen to describe using this script system? Are you aware of any interactions that are unsupport by this system that you have considered and decided to not provide any support?

[Edited by - Estok on January 17, 2005 1:27:02 AM]

##### Share on other sites
I think that variable naming could become a problem with this system. e.g. "HUSBAND: Yes" in a longer conversation (although apart from this problem, which may not even be a problem for people who are willing to be careful with naming, it looks ok).

One solution could be to have lines marked as responses to other lines to make the flow of dialogue clear and to get rid of the naming problem.

p.s. I may be wrong here but isn't Scripting Languages and Game Mods the place for this thread? I mean, it may be a dialogue scripting system but it's still scripting.

 and how is HUSBAND marked as the PC?

##### Share on other sites
I don't see the need to state explicitly the logic associated with a conversation. Unless you're invisioning a system where any script can pull from large library and synthesize it, it seems like a hassle to use.

##### Share on other sites
Thanks for the replies.

Quote:
 What determines which path is chosen? If the HUSBAND is the PC, what are displayed as the actual choices?

A mistake on my part. The PC should be declared with "player" instead of "character". Then the player is presented with a choice.

Quote:
 How do you insert variables in the "line"? For example:

The addition operate concatenates strings. So it would look like this:
line =
visitor_name + " is looking for you.";

Quote:
 If you are displaying the scripts in real time, delays can be important. How do you handle the pausing points? In what ways does your script support simultaneous actions?

Thats a good questions. I have thought of that, but have not implemented anything specific. What I'm thinking is having a "delay" that can be set.

As far as simultaneus, the easiest solution would be syntax like this:

Char1: foo{
...
nextline=
NPC1: bar and NPC2: bar;
}

"or" and "and" are both the same as a comma.

Quote:
 Is there any higher level organization in terms of a conversation? (instead of the characters?)

I put each conversation in a seperate file (.ssconv). All the characters in a level are declared in (.sslvl) file that gets included in the ssconv files. And it obey scoping rules, so to call some dialogue from another level, you have to go:

nexline = AnotherLevel: Alan: Hello;

Quote:
 What kind of interactions have you chosen to describe using this script system? Are you aware of any interactions that are unsupport by this system that you have considered and decided to not provide any support?

Let me get back to you on that. [wink]

Quote:
 I think that variable naming could become a problem with this system. e.g. "HUSBAND: Yes" in a longer conversation

It can potentially be a problem. The blocks all exist in the scope of the level though. Besides that, you just have to be careful. I've already written a fair ammount of a script with it and its not too hard.

Quote:
 One solution could be to have lines marked as responses to other lines to make the flow of dialogue clear and to get rid of the naming problem.

I'm really sure what you mean. Can you give me an example?

Quote:
 p.s. I may be wrong here but isn't Scripting Languages and Game Mods the place for this thread? I mean, it may be a dialogue scripting system but it's still scripting.

I wasn't really sure where to put this, so if any mods want to move it, go right ahead.

Quote:
  and how is HUSBAND marked as the PC?

Mistake. He should be declared with "player" instead of "character".

Quote:
 I don't see the need to state explicitly the logic associated with a conversation. Unless you're invisioning a system where any script can pull from large library and synthesize it, it seems like a hassle to use.

I'm not sure I understand. How else do I dynamic dialogue without stating the logic explicitly?

Thanks a lot for the help guys. Rating++ all arround.

##### Share on other sites
i have also thought about whether this thread is misplaced. But this is not really about compiling or the technical structure of the scripting language, and the scripting language described is for presenting a story (Not for describing game mechanics). In order to answer the questions, the designer would need to know what a story writer would want the script to support (or what the script needs in order to support the type of stories written). In this sense I think this post is appropriate to be here.

* I think a variable system is necessary because one difference between scripts for a book and those for a game story is that game story supports variables and states. In general a conversation in a game is interactive, therefore flow control is also necessary. Derakon has not specified how the variables get their values however (This mechanics is off topic for this forum).

##### Share on other sites
Quote:
Original post by Rayno
Quote:
 One solution could be to have lines marked as responses to other lines to make the flow of dialogue clear and to get rid of the naming problem.

I'm really sure what you mean. Can you give me an example?
At the time I was thinking that you could have a "previousline: x" field, like the nextline field, and this could be used to work out naming collisions. It's not really a very good idea though.

One other idea I've come up with is to write the scene out like a script but with placeholder names instead of dialogue. Son instead of having a nextline field you would have
WIFE: DoILookFatHUSBAND: Responseif ( WifeLooksFat )  WIFE: Pissedelse  WIFE: ThankfulWIFE: DoILookFat {  line: "Does this blouse make my hips look big?"}HUSBAND: Response {  option: "Uhh, I guess"  result: WifeLooksFat = true  option: "No way honey!  You look fantastic!"  result: WifeLooksFat = false}

##### Share on other sites

This topic is 4711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628642
• Total Posts
2983992

• 9
• 10
• 20
• 20
• 13