Date: 2015/01/18 12:49:06 UTC-08: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
#Alright, in the interest of learning the best way to do this, I'm going to put together an example script so I can show what I'm confused about.
RedBlueGreen:
type: assignment
default constants:
color: (red|blue|green)
actions:
on assignment:
- trigger name:chat toggle:true
- trigger name:proximity toggle:true
interact scripts:
- RBGStart
RBGStart:
type: interact
steps:
1:
proximity trigger:
1:
script:
#Here I'm laying out a list of choices for the player
- chat "<white>Hello <player.name>, which color do you like more? <red>Red<white>, <blue>blue<white>, or <green>green<white>?"
chat trigger:
1:
trigger: /regex: (i?) (red)/
script:
- chat "<white>Are you sure you want <red>red<white>?"
- zap step: 'confirm red'
'confirm red':
chat trigger:
1:
trigger: /regex: (i?) (yes)/
script:
- chat "<white>Oh, thanks for your input."
2:
trigger: /regex: (i?) (no)/
script:
- chat "In that case, what is your favorite color?"
- zap step: 1
#So my question is, can I create a generic script like 'confirm red' to encompass all of the options so I don't have to copy paste the script three times for each choice?
#I'm not asking becasue I'm too lazy to copy past three scripts, I want to apply the concept to much larger lists.