Date: 2023/09/10 03:28:51 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# speaker:
# title (string)
# text (string)
# options:
# - text (string)
# click (task)
tickquests_create_dialogue_task:
type: task
definitions: d|loc
script:
- define title <[d.speaker.title]>
- define text <[d.speaker.text]>
- define lines <list>
# TITLE
- define lines:->:<[title]>
- define lines:->:<empty>
# TEXT
- define lines:->:<&[base]><[text]>
- define lines:->:<empty>
# OPTIONS
- foreach <[d.options]> as:opt:
- define lines:->:<&[base]><[opt.text]>
- define text <[lines].separated_by[<n>]>
- spawn tickquests_text_display[text=<[text]>] <[loc]> save:text
- define text_entity <entry[text].spawned_entity>
- define line_width <[text_entity].line_width>
- define lines_split <[text].split_lines_by_width[<[line_width]>]>
- announce <[lines_split]>
tickquests_text_display:
type: entity
entity_type: text_display
mechanisms:
background_color: black
pivot: center
display: left
scale: 0.7,0.7,0.7
line_width: 150
tickquests_sample_dialogue:
type: data
d:
speaker:
title: James
text: Hello, I'm <element[James].custom_color[emphasis]>. This is a sample dialogue.
options: <list[<map[text=Opt 1]>].include_single[<map[text=Opt 2]>]>