Dilly-dallying!

Was about to post this as a Twitter thread, but I could use some more characters and formatting!

First of all, thanks for sharing Ron and David! It’s great be able to to play with this codebase :grin:

Sooo! The first thing that struck me was that the conversation scripts (Yacks) are written in - I THINK - Ink.

If it’s not Ink it’s indeed something very similar and I apologize in advance if:

  • I improperly use Ink’s terminology to describe what follows.
  • I explain myself poorly: I’m fond of Ink and lately I began using it more and more in my workflow, so this is very familiar to me, but may not be so for everyone else :slight_smile:

I created a dialog choice to test out the system, so let’s dive into my edited version of Natalie.yack:

== main ==
// ... other previous choices ...

// When selected, divert to national_inquisitor_first knot
6 SAY(0, "Natalie, there was something I wanted to tell you.") -> national_inquisitor_first

// ... more following choices ...

== national_inquisitor_first ==
parrot NO // turn off the repeating of the dialogue choice text by the playing character
natalie: SAY(0, "And that something is...")

// When selected, divert to national_inquisitor_second knot
1 SAY (0, "I first applied to the National Inquisitor.") -> national_inquisitor_second

== national_inquisitor_second ==
pause 2.0 // pause for 2 seconds
{ actorTurnTo(delores, DIR_FRONT) } // make Delores turn towards the camera
SAY(0, "Naah, that's mean.")
parrot YES // turn on the repeating of the dialogue choice text by the playing character
-> main // fallback to the "main" knot

So, == main ==, == national_inquisitor_first ==, == national_inquisitor_second == are “knots”, blocks of content you can visit.

You can probably think of “diverts” -> as "GOTO"s. They “divert” the flow towards this or that knot.

parrot OFF|ON seems to me that it is interpreted by the engine as a command to turn off and on the repeating of the dialogue choice text by the active playable Actor.
I switched it off when I wanted to have Delores say a different thing than the one that was displayed as a choice. This is Adventure Game Comedy 101, here!

{ actorTurnTo(delores, DIR_FRONT) } between curly brackets you can call actual methods and this one pretty straightforwardly “directs” the Actor delores so that she turns towards the camera.

NOTE: I’m aware that what I shared doesn’t make Delores look back again towards Natalie after that, but that’s just me testing!


Now on to the dilly-dallying! I enabled Delores to dilly-dally by the newspapers in the Nickel, also making Natalie aware of that, saying a random line out of a simple list of lines.

First, I have included the “verb_dillydally” as instructed in the VerbHelpers.dinky file.

ROOT(master_verb_list) <- [
    //other verbs
    "verb_dillydally"
    //even more verbs
}

ROOT(master_verb_names) <- {
    //other verbs
    "verb_dillydally": TEXT(0,"Dilly-dally by")
    //even more verbs
}

I did not include it in the verb_no_walkto list, because I wanted Delores to walk to the hotspot.

Then, I moved on to the room script, Nickel.dinky. In the script you can see a function assignHeadline(obj, headline) that handles the code for every newspaper Object that’s in that room.

Since I wanted Delores to dilly-dally by all of those newspapers, I simply added this block of code to the function.

obj.verb_dillydally <- function(use_with=null)
{
    sayLine(delores, SAY(0, "Look at me, I'm dilly-dallying!"))
    breakwhiletalking()
    sayLine(natalie, randomfrom(SAY(0, "What did I say about dilly-dallying?"),
                                SAY(0, "Dilly-dallying already, Delores?"),
                                SAY(0, "Please refrain from further dilly-dallying!")))
    breakwhiletalking()
}

Of course randomfrom() simply picks a random line among those I defined in its parameters.

If I wanted, I could modify each newspaper Object more or less like this:

newspaper1 = DEFINE_OBJECT({
	name = SAY(0,"DELORES IT'S ME, UNCLE CHUCK")
	note = SAY(0,"... I can't believe you fell for that!")
	default_verb = "verb_read"
	
	VERB(read) {
		Newspaper.genericNewspaper(strupper(note))
	}
	
	VERB(dillydally) {
		sayLine(delores, SAY(0, "Look at me, I'm dilly-dallying!"))
		breakwhiletalking()
		sayLine(natalie, randomfrom(SAY(0, "What did I say about dilly-dallying?"),
									SAY(0, "Dilly-dallying already, Delores?"),
									SAY(0, "Please refrain from further dilly-dallying!")))
		breakwhiletalking()
	}
})

Newspaper.genericNewspaper(strupper(note)) will open up the Newspaper UI, showing the content of note all in uppercase.

You can see that I put those breakwhiletalking() calls between the lines. That’s because otherwise I wouldn’t have been able to read the previous line before it skipped to the next.

I’m not entirely sure about this, but it seems to me that SAY() is a “breaking” action while sayLine() is not. So sayLine() is more for the so-called “barks”. If you are familiar with Adventure Game Studio scripting, this, to me, sounds much like the difference between Say() and SayBackground().

Hope this makes sense to anyone who reads it :grimacing:!

7 Likes

And it’s great to see the experiments that result from it! :smiley:

4 Likes

SAY() is just a macro that embeds the translation information. You can see it in Defines.dinky. sayLine() is the actual command. SAY() and TEXT() do the same thing, we have two just so the text extractor knows which one.

sayLine() doesn’t wait…

sayLine("Hi")
sayLine("There")

will have delores just say “There”

Inside .yack files, the

delores: Hi
delores: There

does wait.

1 Like

And yes, .yack files are based on Ink, but high simplified. I call === dest ==== labels, but you can call them whatever you like.

Ooh, I see! Thanks for clarifying.

I only looked around so much and it seemed that very rarely (if ever) two characters speak to each other outside of conversations, so that’s why I made the wrong assumption!

1 Like

Making sayLine() wait outside of .yack files would be odd. Most of them are said “in real time” as the play runs around. There would be a lot of blocking.

3 Likes