Дополнительно: больше запросов — КиберПедия 

Опора деревянной одностоечной и способы укрепление угловых опор: Опоры ВЛ - конструкции, предназначен­ные для поддерживания проводов на необходимой высоте над землей, водой...

Адаптации растений и животных к жизни в горах: Большое значение для жизни организмов в горах имеют степень расчленения, крутизна и экспозиционные различия склонов...

Дополнительно: больше запросов

2021-11-25 13
Дополнительно: больше запросов 0.00 из 5.00 0 оценок
Заказать работу

Вы можете создавать свои собственные внешние функции, хотя синтаксис немного отличается: см. Раздел о функциях ниже.

Часть 2: Плетение

До сих пор мы создавали разветвленные истории самым простым способом с «опциями», которые ссылаются на «страницы».

Но для этого необходимо, чтобы мы однозначно назвали каждое место назначения в истории, что может замедлить написание и препятствовать незначительному переходу.

У чернил гораздо более мощный синтаксис, разработанный для упрощения потоков историй, которые всегда направлены вперед (как это делают большинство историй, а большинство компьютерных программ этого не делают).

Этот формат называется «переплетением», и он построен на основе базового синтаксиса контента / опций с двумя новыми функциями: меткой сбора -и вложением вариантов и сборок.

Собирает

Собирайте очки, собирайте поток обратно вместе

Давайте вернемся к первому примеру с несколькими вариантами ответов в верхней части этого документа.

"What's that?" my master asked.

   *  "I am somewhat tired[."]," I repeated.

          "Really," he responded. "How deleterious."

   *  "Nothing, Monsieur!"[] I replied.

   * "I said, this journey is appalling[."] and I want no more of it."

          "Ah," he replied, not unkindly. "I see you are feeling frustrated. Tomorrow, things will improve."

В реальной игре все эти три варианта вполне могут привести к одному и тому же выводу - месье Фогг покидает комнату. Мы можем сделать это, используя сборку, без необходимости создавать какие-либо новые узлы или добавлять любые отклонения.

"What's that?" my master asked.

   *  "I am somewhat tired[."]," I repeated.

          "Really," he responded. "How deleterious."

   *  "Nothing, Monsieur!"[] I replied.

          "Very good, then."

   * "I said, this journey is appalling[."] and I want no more of it."

   "Ah," he replied, not unkindly. "I see you are feeling frustrated. Tomorrow, things will improve."

 

-  With that Monsieur Fogg left the room.

Это приводит к следующему прохождению:

"What's that?" my master asked.

 

1: "I am somewhat tired."

2: "Nothing, Monsieur!"

3: "I said, this journey is appalling."

 

> 1

"I am somewhat tired," I repeated.

"Really," he responded. "How deleterious."

With that Monsieur Fogg left the room.

Варианты и собирает формы цепочки контента

We can string these gather-and-branch sections together to make branchy sequences that always run forwards.

=== escape ===

I ran through the forest, the dogs snapping at my heels.

 

   * I checked the jewels[] were still in my pocket, and the feel of them brought a spring to my step. <>

       

   * I did not pause for breath[] but kept on running. <>

 

   *  I cheered with joy. <>

 

- The road could not be much further! Mackie would have the engine running, and then I'd be safe.

 

   *  I reached the road and looked about[]. And would you believe it?

   * I should interrupt to say Mackie is normally very reliable[]. He's never once let me down. Or rather, never once, previously to that night.

 

-  The road was empty. Mackie was nowhere to be seen.

This is the most basic kind of weave. The rest of this section details additional features that allow weaves to nest, contain side-tracks and diversions, divert within themselves, and above all, reference earlier choices to influence later ones.

The weave philsophy

Weaves are more than just a convenient encapsulation of branching flow; they're also a way to author more robust content. The escape example above has already four possible routes through, and a more complex sequence might have lots and lots more. Using normal diverts, one has to check the links by chasing the diverts from point to point and it's easy for errors to creep in.

With a weave, the flow is guaranteed to start at the top and "fall" to the bottom. Flow errors are impossible in a basic weave structure, and the output text can be easily skim read. That means there's no need to actually test all the branches in game to be sure they work as intended.

Weaves also allow for easy redrafting of choice-points; in particular, it's easy to break a sentence up and insert additional choices for variety or pacing reasons, without having to re-engineer any flow.

Nested Flow

The weaves shown above are quite simple, "flat" structures. Whatever the player does, they take the same number of turns to get from top to bottom. However, sometimes certain choices warrant a bit more depth or complexity.

For that, we allow weaves to nest.

This section comes with a warning. Nested weaves are very powerful and very compact, but they can take a bit of getting used to!

Options can be nested

Consider the following scene:

- "Well, Poirot? Murder or suicide?"

*  "Murder!"

* "Suicide!"

-  Ms. Christie lowered her manuscript a moment. The rest of the writing group sat, open-mouthed.

The first choice presented is "Murder!" or "Suicide!". If Poirot declares a suicide, there's no more to do, but in the case of murder, there's a follow-up question needed - who does he suspect?

We can add new options via a set of nested sub-choices. We tell the script that these new choices are "part of" another choice by using two asterisks, instead of just one.

- "Well, Poirot? Murder or suicide?"

   *  "Murder!"

      "And who did it?"

          * * "Detective-Inspector Japp!"

          * * "Captain Hastings!"

          * * "Myself!"

   * "Suicide!"

   -  Mrs. Christie lowered her manuscript a moment. The rest of the writing group sat, open-mouthed.

(Note that it's good style to also indent the lines to show the nesting, but the compiler doesn't mind.)

And should we want to add new sub-options to the other route, we do that in similar fashion.

- "Well, Poirot? Murder or suicide?"

   *  "Murder!"

      "And who did it?"

          * * "Detective-Inspector Japp!"

          * * "Captain Hastings!"

          * * "Myself!"

   * "Suicide!"

          "Really, Poirot? Are you quite sure?"

          * * "Quite sure."

          * *       "It is perfectly obvious."

   -  Mrs. Christie lowered her manuscript a moment. The rest of the writing group sat, open-mouthed.

Now, that initial choice of accusation will lead to specific follow-up questions - but either way, the flow will come back together at the gather point, for Mrs. Christie's cameo appearance.

But what if we want a more extended sub-scene?


Поделиться с друзьями:

Эмиссия газов от очистных сооружений канализации: В последние годы внимание мирового сообщества сосредоточено на экологических проблемах...

Наброски и зарисовки растений, плодов, цветов: Освоить конструктивное построение структуры дерева через зарисовки отдельных деревьев, группы деревьев...

Архитектура электронного правительства: Единая архитектура – это методологический подход при создании системы управления государства, который строится...

Индивидуальные и групповые автопоилки: для животных. Схемы и конструкции...



© cyberpedia.su 2017-2024 - Не является автором материалов. Исключительное право сохранено за автором текста.
Если вы не хотите, чтобы данный материал был у нас на сайте, перейдите по ссылке: Нарушение авторских прав. Мы поможем в написании вашей работы!

0.012 с.