KO

← JumPHP 엔진 확장

Dialogue v0.5.13

jumphp/dialogue · MIT · 다운로드 1회

Branching dialogues with conditions and variables, a quest log and a typewriter text box, written as JSON files and checked when loaded.

JumPHP >=0.5.9에서 동작

제공하는 기능

  • .dialogue.json files: nodes, choices, conditions (gold >= 5 && !helped), set / action, {variables} in the text
  • Variables and a QuestLog (objectives with counts, started / progress / done / failed events) that dialogues can read and drive
  • DialogueRunner: start, line(), advance(), choose(); actions go to your code
  • DialogueBox: the text letter by letter, choices with a cursor, sized to the view
  • Errors say where (the dialogue, the node, the choice); save and restore of the whole state; pure PHP, 32-bit safe

게임에 추가

bin/jumphp extension:add <game> jumphp/dialogue

또는 Composer로:

bin/jumphp composer <game> require jumphp/dialogue

서비스: JumPHP\Dialogue\Variables, JumPHP\Dialogue\QuestLog, JumPHP\Dialogue\DialogueRunner, JumPHP\Dialogue\DialogueBox

예제

$runner->load($this->engine->extensions()->load('assets/dialogue/village.dialogue.json'));$runner->start('elder');// each frame: $box->update($dt, $this->actions());  then  $box->render($r, $this->font());

문서 소스 코드 Packagist

Dialogue

Dialogues and quests for JumPHP games (jumphp/dialogue): branching conversations with conditions and variables in JSON files, a quest log, a typewriter text box. Documentation: doc/index.md; sample: doc/samples/ (bin/jumphp extension:add <game> jumphp/dialogue copies both into your game). Example game: games/dialogue-demo.

이 확장에 대한 리뷰

GitHub 로그인 이 확장을 평가하려면 GitHub로 로그인하세요.

아직 리뷰가 없습니다. 첫 번째가 되어 보세요.