Skip to content
/ spellcast Public
  • Notifications You must be signed in to change notification settings
  • Fork 0
  • Star 19

Make your own adventure!

License

19 stars 0 forks Branches Tags Activity
Star
Notifications You must be signed in to change notification settings

cronvel/spellcast

Branches Tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,433 Commits
bin
bin
 
 
demo/cloak-of-darkness
demo/cloak-of-darkness
 
 
doc
doc
 
 
lib
lib
 
 
media
media
 
 
sample
sample
 
 
script-lib/core
script-lib/core
 
 
shell-lib
shell-lib
 
 
test
test
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
Makefile.bkup
Makefile.bkup
 
 
README.md
README.md
 
 
TODO.md
TODO.md
 
 
bdd-spec.md
bdd-spec.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
spellbook
spellbook
 
 

Repository files navigation

Spellcast Logo

Spellcast is a scripting language, an interpreter/server, plus a terminal and a web clients with powerful capabilities.

It's main purpose is to create scenario with branches, so you can build game in the spirit of old roleplay gamebooks out of the box.

But Spellcast can also be embedded into your app, to allow users to create content, item, campaign and so on.

This page focus on the story capabilities of spellcast, but Spellcast is also a task-runner.

See also:

  • The full story mode reference

Usage

Usage: spellcast story [<book>] [<options 1>] [<options 2>] [...]

Options:

  • --ui <name>: Set the UI to use
  • --locale <locale>: Set the locale for the script
  • --locale-list: List the available locales
  • --assets <URL>: Set the asset base URL (default: main book directory)
  • --ws-server [<port>]: Create a web socket server (default to port 57311)
  • --http: Create a HTTP server for content, sharing the port of the web socket server
  • --token <token>: Add a token to server accepted token list (can be used multiple times)
  • --browser , -B <exe>: Open a client browser , force --ws-server and --http
  • --electron , -E: Open Electron client, force --ws-server and --http
  • --client-ui <name>: Set the UI for the local client (use with --browser)
  • --client-name <name>: Set the name of the local client user
  • --script-debug: Activate debug-level logs for scripts ([debug] tag)
  • --script-verbose: Activate verbose-level logs for scripts ([debug verbose] tag)
  • --max-ticks: Max ticks between two user interactions (prevent from infinite loop, default: Infinity)
  • --js/--no-js: Turn on/off the [js] tags

Getting started: basic script example

This is an example of a very short script with 3 scenes, featuring the most basic tags. Copy-paste this script into a file named test.kfg, then run spellcast story test.kfg.

[[doctype spellcast/book]]

[chapter intro]
	[scene village]
		[message]
			$> You lived in a small village of few hundred peoples.
			$> You started learning how to forge horseshoe since the age of 12
			$> with your father, the local smith.
			$> At the age of 15, you leave your village.
			$> What do you do?

		[next master]
			[label] $> You seek for a master at forgery.
			
		[next rogue]
			[label] $> You are a rogue living in the wood.

	[scene master]
		[message]
			$> You found the master and learn everything he taught to you.
			$> You became famous in the entire country.
		
		[win]

	[scene rogue]
		[message]
			$> You lived in the forest and becomes an highwayman.
			$> That's really bad!
		
		[lost]

In this example, the story in the first message tag is displayed to the player. Then the player has 2 choices:

  • either he seeks for a master at forgery, and it will trigger the scene named master, therefore winning the game by becoming famous
  • either he becames a rogue (triggering the rogue scene) and lost by becoming an highwayman

The syntax of Spellcast books is really simple. The main component of Spellcast is tag. A tag start with an opening bracket and finish with a closing bracket. The content of a tag is indented using tabs.

So here we have:

  • The [[doctype spellcast/book]] is a meta-tag, it tell spellcast that the current file is a spellcast story file. Meta-tags have two opening and two closing brackets, they MUST be placed before any other tags, because they are headers.
  • A top-level container tag: the [chapter] tag with an identifier (intro).
  • This chapter contains 3 [scene] tags named village, master and rogue.
  • The first scene contains 2 [next] tags: those tags tell which scene will follow the current one.
  • When there are more than one [next] tag in a scene, the player can choose between multiple choice.
  • The [next] tag has a scene identifier, e.g. [next master] means that if the player choose that option, the next scene will be the one named master.
  • The [label] tag is simply the text displayed to the user for this choice.
  • The [message] tag contains text to be displayed to user.
  • The [win] and [lost] tags causes the game to exit, either with a game win or a game lost.
  • all text supports internationalization and localization

About

Make your own adventure!

Resources

Readme

License

Activity

Stars

19 stars

Watchers

4 watching

Forks

0 forks
Report repository

Releases

490 tags

Packages

No packages published

Contributors 2

  •  
  •  

Languages

  • JavaScript 99.9%
  • Other 0.1%

Footer

© 2024 GitHub, Inc.

玻璃钢生产厂家上海商场美陈展台制作动物玻璃钢雕塑哪里有玻璃钢雕塑设计要素武威玻璃钢动物雕塑设计玻璃钢花盆模具制作方法中卫玻璃钢雕塑制作临沧商场美陈展示玻璃钢海豚雕塑设计及定制四川大型商场美陈批发玻璃钢花盆如何钻孔主题商场美陈供应商郑州上海抽象玻璃钢雕塑销售厂家邯郸附近有卖玻璃钢花盆的吗价格合理的玻璃钢雕塑日本商场美陈湖南学校玻璃钢雕塑厂家门头沟玻璃钢雕塑工厂玻璃钢雕塑成型方式红桥玻璃钢花盆花器玻璃钢室外镂空雕塑加工西藏玻璃钢动物牛雕塑重庆独角兽玻璃钢雕塑商场野生动物世界 美陈通辽动物玻璃钢雕塑制作石家庄玻璃钢雕塑制作河南环保玻璃钢雕塑图片玻璃钢防铜雕塑公厂在哪里广场玻璃钢雕塑尺寸南通如东玻璃钢雕塑雕塑重庆商场玻璃钢雕塑香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化