The language now features player choices and some smaller features like smart modifiers and wildcards. Everything is documented in the PDF file available in the archive.
I also implemented some examples which are available in the content assist feature, but I also provide them here, to give you an idea of how the new language design works:
#############################################################################
Example 1: Scout and
Skull
#############################################################################
characters: Scout, Skull
// switches
replace the former conditions and are either on or off (off by default!)
// I wanted to
find a simple metaphor for boolean variables everyone can relate to
switches: talked_Skull is off, name, blinky_Nigel, skull_Nigel, pole,
skull_Rock,
skull_Moved
// conditions
allow to concatenate switches with 'and' operator
// this might
seem like an unnecessary intermediate step compared to boolean logic,
// but I want
to see if it proofs useful in practice to separate boolean logic that way
conditions
HasTalkedSkull when talked_Skull is off
HasTalkedPole when pole is off
HasTalkedSkullRock when skull_Rock is off
HasNotTalkedJake when name is off
KnowsNameIsNigel when blinky_Nigel is on and skull_Nigel is off
IsSkullMoved when skull_Moved is on
end
// scene names
are now also in quotation marks, they are referable now
scene "Larger Scene Sample"
// default lines now
feature a 'defaults'...'end' structure
// inside, you can
also use conditional dialog,
// just as in 'first time' or 'parting' cases
defaults
Skull: "Hey!"
end
// the 'first time'
and 'other times' conditionals are now merged together...
// seems to me to be
more homogenous
first time
Skull: "What are you doing here?"
Scout: "Huh!?"
else
Skull: "You again."
// as mentioned, you
can also nest conditionals here
// they feature the
more common and shorter 'if'-'else if'-'else' keywords now
if (HasNotTalkedJake)
Scout: "Hi Jake!"
else if (KnowsNameIsNigel)
Scout: "Nigel, how's it hangin'?"
end
end
// hubs are meant to
be loops which contain player choices
// hence, hub's need
to be explicitly left using an 'exit'-statement or
// by invoking another
scene or hub (yes, hubs can be called :))
hub "Main Hub"
// by default, choices
are offered to the player every time a hub (loop)
// is executed. The
modifier 'single' allows to mark a choice as 'only available once'.
// Thought of it as
nice abbreviation instead of creating a switch/condition pair for every 'single
choice'
// The name of the
choice (e.g. "Talking Skull") can be used as a preview text for the
player on screen.
single choice "Talking
Skull"
Scout: "I never expected you to talk."
Skull: "Why not? You seem to be doing remarkably
well for a pussy-cat."
Scout: "But you're just a skull."
Skull: "So, you've got something against
skulls have you?"
Scout: "No, I..."
Skull: "It's always the same - prejudice just
follows me around."
Scout: "Really?"
Skull: "Well, not that I actually go
anywhere..."
Skull: "I blame Ray Harryhausen for
stereotyping the whole subject of skeletons."
switch on talked_Skull // at the end of a choice or block, you can change the value of switches
and/or leave the hub
end
// Writing the
examples proofed to me that it is useful to make choices optional
// hence, inside hubs,
you can use the special conditional statement 'choices if'
// Note that it is not
possible to nest these kind of choices to avoid too complex structures
// but I'm sure that this isn't
necessary
// Conditions can be
chained with the 'or' operator.
// That way, you can
create 'chunks' of booleans that need to apply together at the
//
'conditions'-statement above, and chain them here as alternatives
choices if (HasNotTalkedJake or KnowsNameIsNigel)
choice "Name"
// inside choices, you can use "standard" conditions (can also be
nested just as outside of hubs)
if (HasNotTalkedJake)
Scout: "What's your name?"
Skull: "I'm not in the habit of giving my
name out to just anyone, you know."
Scout: "It's something embarrassing, isn't
it?"
Skull: "Not at all! It's, er... Cutthroat
Jake! Yes."
Scout: "You just made that up."
Skull: "No I didn’t!"
Skull: "You can call me Jake if you
like."
switch on name
else if (KnowsNameIsNigel)
Scout: "That mouse over there..."
Skull: "I hate that mouse. Do you have any idea what he did to me?"
Scout: "I..."
Skull: "He had the audacity to build a nest
in my eye socket."
Skull: "I was only able to drive him out by
whistling for six hours straight."
Skull: "Do you realise how difficult that is
when you don’t have any lips...?"
Scout: "The mouse told me your real name is
Nigel."
Skull: "Well..."
Scout: "What sort of a name is Nigel for a
skull?"
Skull: "I know, I know..."
switch on skull_Nigel
end
end
end
single choice "Pole"
if (IsSkullMoved)
Scout: "Why were you stuck on that
pole?"
Skull: "I was placed there as a warning to
intruders."
else
Scout: "Why are you stuck on that pole?"
Skull: "I've been placed here as a warning to
intruders."
end
Scout: "Intruders?"
Skull: "People like yourself, who come here
looking for the treasure hidden in Skull
Rock."
Skull: "Oops!
Forget I ever said that."
Scout: "Not very good at your job are
you?"
Skull: "You call this a job? It’s certainly
not one I would have chosen myself, if I’d
had any say in the matter."
Skull: "It's not as if I can just walk away
and get another job."
Skull: "When a skull doesn't even have the
rest of his skeleton with him, career
options are severely limited."
Scout: "Talk a lot, don't you?"
Skull: "It's the sheer and utter boredom – I haven't
had a decent conversation in
forty three years."
Skull: "Listen, you won't tell anyone that I
mentioned the treasure, will you?"
switch on pole
end
single choice "Skull Rock"
Scout: "What can you tell me about Skull
Rock?"
Skull: "Not very much, I'm afraid. I’ve never even seen it."
Scout: "Why, because you don’t have any
eyes?"
Skull: "No, I can see you just fine."
Scout: "Weird, that..."
Skull: "Ever since I was placed here I’ve
been facing in the same direction."
Skull: "And the local monkeys are really
awful – telling me how beautiful the view is
and how wonderful the sun looks as
it sets over the sea."
Scout: "Now, don’t get upset."
Skull: "I’d weep if I had any tear
ducts..."
switch on skull_Rock
end
choice "Exit"
Scout: "I’ll be seeing you."
Skull: "Okay, bye. Don't forget to come back soon."
exit scene // at least one of these 'jumps' is mandatory, since the
hub could never be left otherwise
end
end
end scene
Example 2: Risen
#############################################################################
characters: PROTAGONIST, JAN
switches: place, foodOrGold, safe, offer,
harbourTownQuest, followJanToTheWest
conditions
AskedAboutPlace when place is on
AskedAboutFoodOrGold when foodOrGold is on
AskedAboutSafety when safe is on
TalkedOffer when offer is on
end
scene "BANDIT OUTPOST"
first time
PROTAGONIST: "I found this sword."
JAN: "Good! I hope you know how to use it."
end
hub "Main"
single choice "place"
PROTAGONIST: "What can you
tell me about this place?"
JAN: "What do want to know?"
switch on place
end
single choice "girl"
PROTAGONIST: "There’s a girl
came ashore with me, she’s in an abandoned house to the
South."
JAN: "South... Must be the old ship
wrecker's house."
JAN: "I’ll head that way later."
JAN: "If she’s there."
JAN: "I’ll take her somewhere safe."
end
single choice "help"
PROTAGONIST: "I could do with
some help before I go. I’m injured."
JAN: "Hmm, so you are."
JAN: "There’s a water barrel in the corner. Take a good drink and freshen up.
You stink of sea water."
JAN: "If you’re planning on getting hurt
again, you should get your hands on a few
healing potions."
PROTAGONIST: "Where can I find
some?"
JAN: "Well, they don’t grow on trees.
You’ll have to find a trader for those.
There are a few traders still around."
end
choices if (AskedAboutPlace)
single choice "FoodOrGold"
PROTAGONIST: "Looks like I’m
going to be stuck here for a while. Anywhere I can get
some food or pick up some
gold?"
JAN: "Ha! Not round here at any rate!"
JAN: "I just asked for this post so I can
watch the storms. Amazing things when they
blow past."
JAN: "Strange how they never come
inland."
JAN: "Two weeks ago I would have sent you
straight to Harbour Town. But not anymore."
PROTAGONIST: "Why not?"
JAN: "It’s full of inquisition. Protecting
those ruins and recruiting for the damn
white robed cult at the
Monestary."
JAN: "I’m with the Don myself. We’re the
ones who’re still free. Living in a camp in
the middle of a swamp.
But freedom’s freedom."
JAN: "I’d head to the swamp, see if the
Don’ll take you in, or try your luck in
Harbour Town. Just stay
away from the Monestary."
switch on foodOrGold
end
single choice "monestary"
PROTAGONIST: "You mentioned a
Monestary. What happens there?"
JAN: "The last place you wanna be!"
JAN: "It’s where the Inquisition train
their recruits. Brain wash’em!"
JAN: "Stay well away from there."
end
end
choices if (AskedAboutFoodOrGold)
single choice "Safe"
PROTAGONIST: "So, is Harbour
Town safe? What are the Inquisition doing there?"
JAN: "Not much at the moment. There are
still some of our boys in there. They might
help you out."
JAN: "And that white robed lot probably
won’t bother you too much."
JAN: "I can show you the way, but believe me,
you’d be better off at our camp."
switch on safe
end
single choice "Offer"
PROTAGONIST: "What’s the Don
got to offer me?"
JAN: "Meat, bear, a job? They might even
train you as a fighter. You got a sword,
after all. Most they’ll let you have up at the Monestary
is a staff! Just a
big stick! That’s not a real weapon!"
switch on offer
end
end
choices if (AskedAboutSafety)
single choice "Harbour Town"
PROTAGONIST: "Can you show me
the way to Harbour Town?"
JAN: "Sure. Follow me."
switch on harbourTownQuest
exit scene
end
end
choices if (TalkedOffer)
single choice "Camp"
PROTAGONIST: "All right, show
me the way to your camp."
JAN: "Good man! Follow me."
switch on followJanToTheWest
exit scene
end
end
choice "End"
exit scene
end
end
end scene
#############################################################################
Example 3: Heavy Rain
#############################################################################
characters: LAUREN, SCOTT
switches: convince, compassionate, persist, trick,
buy, disappearance, johnny, johnnysHome, suspect, inRoomCenter is on, offerCigarette, police,
johnnysFather, leads
conditions
UnlockPhase2A when convince is on and compassionate is on
UnlockPhase2B when convince is on and persist is on
UnlockPhase2C when compassionate is on and persist is on
TriedToBuy when buy
is on
HasTalkedDisappearance when disappearance is on
HasTalkedJohnny when johnny is on
HasTalkedJohnnysHome when johnnysHome is on
HasTalkedSuspect when suspect is on
HasntOfferedCigarette when inRoomCenter is on and offerCigarette is off
TimesUpA when police is on and johnnysFather is on
TimesUpB when police is on and leads is on
TimesUpC when leads is on and johnnysFather is on
TimesUpD when leads is on and johnnysFather is on and police is on
end
scene "LAUREN’S MOTEL ROOM. EVENING"
first time
SCOTT: "My name is Scott Shelby. I’m a private detective.
The families of the
victims of the Origami Killer
asked me to
investigate the murders. I came here
just to ask you some
questions about Johnny."
LAUREN: "I already told the police all I know and have
nothing
to add. Leave me
alone."
end
if (TriedToBuy)
LAUREN: "Leave me alone."
exit scene // exiting a scene is
now possible
end
hub "Phase 1"
single choice "Convince"
SCOTT: "The killer is walking around free as
we speak.
He’ll kill
again if he’s not arrested."
LAUREN: "My Johnny’s dead, so what difference
does it make?"
switch on convince
end
single choice
"Compassionate"
SCOTT: "I understand, Lauren. I know what
you’re going through."
LAUREN: "Oh, yeah? You know what it feels like
to find your own
son’s body on
a wasteland? I’m sorry, I don’t believe you
have the
slightest idea what I’m going through, Mr. Shelby."
switch on compassionate
end
single choice "Persist"
SCOTT: "There’ll be other victims if we don’t
stop the killer.
You have got
to help me, Lauren. You may know something
that can aid
the investigation."
LAUREN: "Help you? There’s nothing you can do!
My son is dead!
Do you hear
me? He’s dead!"
switch on persist
end
choices if (UnlockPhase2A or UnlockPhase2B or UnlockPhase2C)
choice "Trick"
SCOTT: "If we don’t find the killer, there’ll
be other mothers
who find
their son’s body on a deserted wasteland.
But
you’re right! Why should you care? It’s not your problem
anymore,
right?"
[Long pause, Lauren will sit down on the bed before she continues]
LAUREN: "What do you want to know?"
switch on trick
enter hub "Phase 2" // this instantly switches to hub
"Phase 2"
end
choice "Buy"
SCOTT: "I bought ten minutes of your time,
didn’t I? All I ask is
that you
use that time to answer some questions"
LAUREN: "You want to pay me to tell you about
my son, is that it?
You can buy my body, Mr. Shelby, but my son is
not for sale!
Get out of here! GET THE FUCK OUT!"
switch on buy
exit scene // player made the wrong choice
end
end
end
hub "Phase 2"
// random is a
modifier for conditionals and choices and allows the author to mark them
// as random. The
exact implementation needs to be done by the dialog engine
random if (TimesUpA or TimesUpB or TimesUpC)
LAUREN: "Time's up Mr. Shelby. I hope you got
what you wanted. Now get out of here."
exit scene
end
if (TimesUpD)
LAUREN: "Time's up Mr. Shelby. I hope you got
what you wanted. Now get out of here."
exit scene
end
single random if (HasntOfferedCigarette) [Random, when the player does not move towards the bed]
LAUREN: "Do you want a cigarette?"
SCOTT: "No thanks, I quit."
LAUREN: "That's brave."
switch on offerCigarette
end
single choice
"Disappearance"
SCOTT: "How did your son disappear?"
LAUREN: "He used to go play with the
neighborhood kids after school.
It was pouring
down something awful that day. I’ll never forget it.
All his
friends came home 'round 3, all except him."
switch on disappearance
end
single choice "Johnny?"
SCOTT: "Tell me about Johnny. What kind of
kid was he?"
LAUREN: "Johnny was really a good boy.
Sometimes, he fought with other kids who called
me
a… you know. In his own way, I think he understood what was going
on."
switch on johnny
end
single choice "Suspect"
SCOTT: "Did you suspect anyone after he
disappeared?"
LAUREN: "I meet a lot of pretty shady
characters in my line of work. Sure, I thought
of it at first. But it didn’t
seem to make any sense. I don’t believe any of
my clients could have
done that to my Johnny... and all those other kids?"
switch on suspect
end
single choice "Johnny's
home"
SCOTT: "Did Johnny live with you?"
LAUREN: "Yes. Of course I made sure he never
met any of my clients. I wanted to stop,
you know... but we needed
the money. I was trying to earn enough to get us
out of
here."
switch on johnnysHome
end
random choices if (HasTalkedDisappearance or HasTalkedJohnny or HasTalkedJohnnysHome or HasTalkedSuspect)
single choice "Police"
SCOTT: "When did you sound the alarm?"
LAUREN: "About eight o’clock. I began to get
worried, I went all around the
neighborhood, I went to the wasteland where
they liked to play, I went to
see his friends. I called the cops
about ten o’clock."
switch on police
end
single choice "Johnny's father"
SCOTT: "Tell me about Johnny’s father."
LAUREN: "A loser without a job who liked to
beat me after a few drinks...
He left the day Johnny disappeared. I ain’t
seen him since. Coward!
Good thing he left."
switch on johnnysFather
end
single choice "Leads"
SCOTT: "Do you know if they found anything on
the wasteland? Any leads or witnesses?"
LAUREN: "No. They said he must’ve run away and
would probably end up coming back.
His body was found five days later with an
origami figure in his hand and
an orchid on his chest."
switch on leads
end
end
end
end scene
#############################################################################
Example 4: Mass Effect 2 (a bit more
tricky, but it still works ;))
#############################################################################
characters: EDI, SHEPARD, GRUNT
switches: openTank, gaveName, phase5, convinced,
playerShoots, shooting, hasShot
conditions
OpenTank when openTank is on
KnowsName when gaveName is on
Phase5 when phase5 is on
GruntIsConvinced when convinced is on
PlayerShoots when playerShoots is on
EndsWithShooting when shooting is on
DoneShooting when hasShot is on
end
scene "NORMANDY SR-2. PORT CARGO. OPENING
THE TANK."
defaults
EDI: "The subject is stable, Shepard. Integration with
onboard systems was seamless."
end
hub "Phase 1"
choice "Keep it sealed."
exit hub // this directly leads to the 'parting' section at the end of the script
end
choice "Open the tank"
SHEPARD: "Stand by. I'm
going to open the tank and let him out."
EDI: "Cerberus protocol is very clear
regarding untested alien technology."
enter hub "Phase 2"
end
choice "Is he aware?"
SHEPARD: "Can he see
anything in there? Does he know where he is?"
EDI: "Unlikely. Current neural patterns
indicate minimum cognition. Barring ship-wide
power loss, the nutrients
in the tank could sustain him for over a year."
end
choice "Is he dangerous?"
SHEPARD: "Any idea how
dangerous this guy is?"
EDI: "He is a krogan, Shepard. If you are
asking whether he is actively hostile, I
don't have the necessary data to answer.
Okeer's technology could impart
data, not methods of thinking. The subject may know
of his views, but would not
necessarily share them."
end
choice "Detect anything odd?"
SHEPARD: "What can you
tell me about this guy? Anything unusual?"
EDI: "The subject is an exceptional example
of the krogan species, with fully formed
primary, secondary, and tertiary organs, where
applicable. No defects of any
kind, aside from the genetic markers of the genophage present in
all krogan. I
cannot judge mental functioning."
end
end
// hidden hubs won’t be accessed unless
they are called explicitly
hidden hub "Phase 2"
single choice "Leave him where
he is then"
exit hub
end
single choice "He's to valuable
to leave"
SHEPARD: "He's either a
powerful addition to the crew or a time bomb. I'd rather deal
with it
now."
switch on openTank
exit hub
end
single choice "Do as I say,
EDI"
SHEPARD: "I won't be
second guessed on my own ship, by my own ship. Do it."
switch on openTank
exit hub
end
end
if (OpenTank)
EDI: "Very well, Shepard. The controls are online. The
switch - and consequences - are
yours."
[Cutscene where
the tank is opened, forwarding to next scene]
enter scene "NORMANDY SR-2.
PORT CARGO. RECRUITING GRUNT." // here, we invoke another scene
end
parting
SHEPARD: "I'm leaving it the way it is. Make sure nobody
tempers with it."
EDI: "Of course, Shepard."
end
end scene
scene "NORMANDY SR-2. PORT CARGO.
RECRUITING GRUNT."
first time [Grunt smashes
Shepard against the wall and holds him there]
// wildcards (in
braces) can be used in dialog lines to set placeholders
// which can be
replaced by an appropriate dialog engine during runtime
GRUNT: "Human. {Gender}. Before you die, I need a
name."
end
// this hub and the
subsequent dialog line show how you can model choices which are handled
completely
// identical in the
game, without the need to write redundant dialog lines
// (GRUNT will respond
identically, no matter what the player chooses)
hub "Phase 3"
choice "You'll get more than that"
SHEPARD: "I'm Commander
Shepard, and I don't take threats lightly. I suggest you
relax."
exit hub
end
choice "Of course"
SHEPARD: "I'm Commander
Shepard of the Normandy."
exit hub
end
end
GRUNT: "Not your name. Mine. I am trained. I know things,
but the tank... Okeer couldn't
implant connection. His words are hollow. Warlord,
legacy, grunt... grunt.
\"Grunt\" was among the last. It has no
meaning. It'll do. I am Grunt."
hub "Phase 4"
// Quotation marks
need to be escaped with a backslash
choice "Why \"Grunt\"?"
SHEPARD: "You wouldn't
prefer \"Okeer\"? Or \"legacy\"?"
GRUNT: "It's short. Matches the training in
my blood. The other words are big things I
don't feel. Maybe
they fit your mouth better. I feel nothing for Okeer's clan
or his enemies. I will do what
I am bred to do... fight and determine the
strongest -- but his imprint has
failed."
exit hub
end
choice "You want to die?"
SHEPARD: "Why do you want
me to try to kill you?"
GRUNT: "Want? I do what I am meant to-- fight
and reveal the strongest. Nothing in the
tank ever asked what I want. I feel nothing
for Okeer's clan or his enemies.
That imprint failed. He has failed."
exit hub
end
end
GRUNT: "Without a reason that's mine, one fight is as good
as any other. Might as well
start with you."
hub "Phase 5"
choice "Join my crew. We’ll find it" [Paragon
choice]
SHEPARD: "I have a strong
ship and a strong crew, a strong clan. You'd make it
stronger."
GRUNT: "If you're weak and choose weak
enemies, I'll have to kill you."
SHEPARD: "Our enemies are
worthy. No doubt about that."
switch on convinced
exit hub
end
choice "You feel nothing for Okeer?"
SHEPARD: "Is it that easy
for Okeer's perfect krogan to abandon his mission?"
GRUNT: "Okeer is just a voice in the tank. If
his imprints are true, then he created
something stronger than him. So he's not
worthy of me. And if his hatreds
aren't strong enough to compel me, they've
failed, too. I feel
nothing. I have
no connection."
end
choice "My command is your reason" [Renegade
choice]
SHEPARD: "I took you and I
released you. Follow my command, and you'll have purpose."
GRUNT: "Nothing in the tank imprints
indicated humans could be so forceful.
You command as though you've earned
it."
SHEPARD: "My enemies
threaten galaxies. Everyone on my ship has earned their place."
switch on convinced
exit hub
end
choice "Stand down or else"
SHEPARD: "I'm offering you
the chance to join my crew. Stand down. I won't ask again."
GRUNT: "Asking marks you as unworthy. That's
why you'll die first."
if (PlayerShoots) [Player chooses to shoot Grunt in a QTE]
SHEPARD: "You will stand
down."
switch on hasShot
exit hub
else
enter hub "Phase 6-1"
end
end
choice "I released you. You owe me"
SHEPARD: "You should show
more gratitude. Refusing an ally can bite you in the ass."
GRUNT: "If I can brush an ally aside, what
use are they? You're only worthy of dying
first."
enter hub "Phase 6-1"
end
end
hidden hub "Phase 6-1"
choice "You leave me no choice"
SHEPARD: "I gave you a
chance. This is on you."
switch on shooting
exit hub
end
choice "I was being generous"
SHEPARD: "Talking was the
generous Plan A. Here's Plan B."
switch on shooting
exit hub
end
end
if (GruntIsConvinced)
GRUNT: "Hmm. Hmph! That's... acceptable. I'll fight for
you."
[camera reveals
that Shepard has been pointing his gun at Grunt the whole time]
SHEPARD: "I'm glad you saw reason."
GRUNT: "Hmm? Ha! Offer one hand, but arm the other."
else if (EndsWithShooting)
[gets shot by
Shepard several times, but shows no signs of weakness]
GRUNT: "Huh?"
switch on hasShot
end
if (DoneShooting)
GRUNT: "You offer one hand but arm the other -- and don't
hesitate. Maybe you are
worthy. You will give me strong enemies? A chance to find my
own reason for the
skills in my blood? Very well. I will fight for you."
SHEPARD: "Try that again and I won't be so patient."
end
parting
GRUNT: "Wise, Shepard. If I find a clan, if I find what
I... I want, I will be honored
to eventually pit them against you."
end
Keine Kommentare:
Kommentar veröffentlichen