I realized my entire design for Quest Editor was flawed. While NPC data is mostly consumed of checkmarked options and a ComboBox, Quest data has an insanely complicated hierarchy. My experience with extending Java’s native GUI components is slightly better after my first attack, but I know that making 20 slightly similar classes along with a fair amount of custom panels and comboboxes (item/npc/quest selection). The worst would be the text editing. The entire point of the GUI was to make things simplier than formatting YAML markup. Which I realized wouldn’t be the case.
The best method would actually be to create a script alongside a parser that would build the YAML markup. After 5 hours of hacking and slashing, I’ve gotten it working. A fair amount of time was spent updating Citizen’s own save functions for quests.yml.
Here’s an example of the script, and it’s output.
=== New Players Rift NPC guardian === The Rift is a seperate entity outside of time and space. Here generations before you have made it simple to go to any slot in time you wish. The portal behind me will take you to Eldaria in the year 1600 AD. To open a portal, throw the lever beside it, but be sure to quick and step through before the portal closes! Some portal can take you to multiple places, to chose one, click the panel beside the lever till the desired target is selected. Now step forth and try it. Then witness with your very eyes, the fall of Eldaria. * The guardian hands you a book for you to pen your adventure. Then lightly shoves you towards the portal. ITEM book === Go Kill Zombie Eldaria 1600 AD NPC alex === Ah, another one. Well I'm sure you can make yourself useful. Here. Go kill a zombie or two. Try not to die. ITEM stone_sword KILL zombie 5 ITEM cookie Well at least you're not useless. Here's a bandaid. And since you've been such a good boy, a cookie as well. === Supplies Eldaria 1600 AD NPC alex === You'll probably want to get up to speed with everything. I'm not the best one for that, so go meet the guy who runs the inn on the way to Miran Des. Just follow the road. ITEM paper While your at it, give him this supply sheet. We're low on supplies. When you've gotten them, hand them to me. NPC innkeeper GIVE paper ITEM potion 1 8257 Ah. Welcome, welcome. Come sit down and rest up. What is this place? Hmmm. *puff* Where to start? This land used to be filled with dragons you know. It was their home before we came. We lived with them for a time, but things grew complicated as friendships always do. We drove them off. Well, killed em all really. That was years ago now. The last ones fell just near here at the heart of Miran Des. You ought ta go check out them bones. Huuuuge. Each one was near a quarter of the Tower in height. Well now. If you're off in that direction, ask Steve over there. He's a mage. He'll know more of the specifics on the dragons and the Tower. ITEM apple 64 Oh and before you jaunt off to Miran Des with him. Take these supplies over to the guys back at the portal. NPC alex GIVE apple 64 Thanks for bringing the supplies foreigner. Now get on your way to Miran already.
Turns into this:
'Rift: New Players':
texts:
description: 'Rift: New Players'
completion: 'Rift: New Players completed'
acceptance: 'Rift: New Players started'
repeats: 0
objectives:
'0':
'0':
type: talk
npcdestination: 0
message: The Rift is a seperate entity outside of time and space. Here generations before you have made it simple to go to any slot in time you wish. The portal behind me will take you to Eldaria in the year 1600 AD.
'1':
'0':
type: talk
npcdestination: 0
message: To open a portal, throw the lever beside it, but be sure to quick and step through before the portal closes!
'2':
'0':
type: talk
npcdestination: 0
message: Some portal can take you to multiple places, to chose one, click the panel beside the lever till the desired target is selected.
'3':
'0':
type: talk
npcdestination: 0
message: Now step forth and try it. Then witness with your very eyes, the fall of Eldaria.
'4':
'0':
type: talk
npcdestination: 0
message: '* The guardian hands you a book for you to pen your adventure. Then
lightly shoves you towards the portal.'
rewards:
'0':
type: item
id: 340
amount: 1
data: 0
take: false
'(1600 AD) Eldaria: Go Kill Zombie':
texts:
description: '(1600 AD) Eldaria: Go Kill Zombie'
completion: '(1600 AD) Eldaria: Go Kill Zombie completed'
acceptance: '(1600 AD) Eldaria: Go Kill Zombie started'
repeats: 0
requirements:
'0':
type: quest
quest: 'Rift: New Players'
take: false
objectives:
'0':
'0':
type: talk
npcdestination: 5
message: Ah, another one. Well I'm sure you can make yourself useful. Here. Go kill a zombie or two.
'1':
'0':
type: talk
npcdestination: 5
message: Try not to die.
rewards:
'0':
type: item
id: 272
amount: 1
data: 0
take: false
'2':
'0':
type: hunt
amount: 5
'3':
'0':
type: talk
npcdestination: 5
message: Well at least you're not useless. Here's a bandaid. And since you've been such a good boy, a cookie as well.
rewards:
'0':
type: item
id: 357
amount: 1
data: 0
take: false
'(1600 AD) Eldaria: Supplies':
texts:
description: '(1600 AD) Eldaria: Supplies'
completion: '(1600 AD) Eldaria: Supplies completed'
acceptance: '(1600 AD) Eldaria: Supplies started'
repeats: 0
requirements:
'0':
type: quest
quest: '(1600 AD) Eldaria: Go Kill Zombie'
take: false
objectives:
'0':
'0':
type: talk
npcdestination: 5
message: You'll probably want to get up to speed with everything.
'1':
type: talk
npcdestination: 5
message: I'm not the best one for that, so go meet the guy who runs the inn on the way to Miran Des. Just follow the road.
'1':
'0':
type: talk
npcdestination: 5
message: While your at it, give him this supply sheet. We're low on supplies. When you've gotten them, hand them to me.
rewards:
'0':
type: item
id: 339
amount: 1
data: 0
take: false
'3':
'0':
type: delivery
npcdestination: 6
item:
id: 339
amount: 1
data: 0
'4':
'0':
type: talk
npcdestination: 6
message: Ah. Welcome, welcome. Come sit down and rest up.
rewards:
'0':
type: item
id: 373
amount: 1
data: 8257
take: false
'5':
'0':
type: talk
npcdestination: 6
message: What is this place? Hmmm. *puff* Where to start?
'6':
'0':
type: talk
npcdestination: 6
message: This land used to be filled with dragons you know. It was their home before we came. We lived with them for a time, but things grew complicated as friendships always do. We drove them off. Well, killed em all really. That was years ago now.
'7':
'0':
type: talk
npcdestination: 6
message: The last ones fell just near here at the heart of Miran Des. You ought ta go check out them bones. Huuuuge. Each one was near a quarter of the Tower in height.
'8':
'0':
type: talk
npcdestination: 6
message: Well now. If you're off in that direction, ask Steve over there. He's a mage. He'll know more of the specifics on the dragons and the Tower.
'9':
'0':
type: talk
npcdestination: 6
message: Oh and before you jaunt off to Miran Des with him. Take these supplies over to the guys back at the portal.
rewards:
'0':
type: item
id: 260
amount: 64
data: 0
take: false
'11':
'0':
type: delivery
npcdestination: 5
item:
id: 260
amount: 64
data: 0
'12':
'0':
type: talk
npcdestination: 5
message: Thanks for bringing the supplies foreigner. Now get on your way to Miran already.
As you can see, it’s still needs to be improved upon. Mainly the saving of objectives, and filtering default settings to keep filesize down. The schema of the scripts are built like so:
root
header
name
world
time
npc
body
objective (new step)
objective
objective (new step)
objective (new step)
switch target npc for all following objectives (for diliveries and talking)
objective (new step)
objective
As you can see, it allows long conversations to be written very easily. The builder itself deals with all the counting.
To Do
- Add the rest of the objective types (and rewards).
- Add a config file to skin text messages with:
- (Click to continue) as a suffix and greyed out.
- Option for a prefix.
- Prefixes include putting the targetted NPC’s name in front like so: Name: blah
- Manage the npc-profiles. Making specified NPCs a quester.
- Option for sidequests and non-linear plot. My thoughts are to keep the automatic linking to the last quest unless specified as a sidequest or a required quest has been mentioned.
- Parametered titles in the config.
- 1 param: %1$s
- 2 param: %2$s: %1$s
- 3 param: (%3$s) %2$s: %1$s
- Allow quests.txt to be broken up into several files by moving it into a subfolder. The parser would then read files alphabetically.
- 0-start.txt
- 1-training.txt
- 2-sword1.txt
- 3-mage1.txt
- …
- sidequests.txt




