Difference between revisions of "Writing ACR Quests/The Hook"
Line 50: | Line 50: | ||
To do that, we select the NPC's offer and add nodes inside of it. | To do that, we select the NPC's offer and add nodes inside of it. | ||
+ | |||
+ | == Nodes == | ||
[[File:tooling_hook_7.png]] | [[File:tooling_hook_7.png]] |
Latest revision as of 22:25, 6 January 2015
This guide is written by our own Zelknolf, on the forums.
Creating the hook
Onward to the actual static quest now. It does seem like a lot of buildup to as much, but this is where you start if you were working with a bunch of resources that already existed (e.g. "I have a quest that takes place between Rivermoot and one of the orc caves, having to do with orcs, and how they're green." -- that project starts here).
So I start by opening up my inn keeper's conversation. On most servers, you can figure out which one it is by just looking at the name (this one is named "Eldata" so the conversation with Eldata in the name is the one I want).
This conversation already has an option to ask about work, and already has the failover option of "I can't hire you, but here's a breadcrumb to help you find statics elsewhere." -- not every conversation will have that, but you can use the same strategies I'm using to add the quest to this node to add the node to begin with.
So, first, I pick the node I want to respond to and click add.
This is a pretty fleshed-out conversation, so I have some written voice to mimic. Fortunately, the voice is also pretty archetypal, so it's an easy one to copy.
Now that ends up going below the "sod off, I can't hire you" line, which we don't want. When an NPC gets a chance to speak, they will always say the first thing that they're allowed to, so we want to put the default option last on the list, and we want the options for specific circumstances before it.
Now we get into the part that starts to look like code to some people. I promise, it is not. It's the computer asking in a very computerey way "What step of what quest do you want these people to be on?" and "OK, what step are they on now?"
Conditions
So we're going to pick our newly-on-top conversation option, and we're going to add a condition to it.
And the ACR already provides us with all of the code we need in that condition. So we're just going to use it-- if there's something broken in it, it gets to be someone else's job to fix it. (also, it means that we can just fix that one thing if something really is broken, instead of mucking through everyone's custom code and fixing each individual case).
Once you type in the script's name, hit refresh, and you'll get two boxes.
Now, we need to name our quest. Strictly speaking, you can pick any string that plays nice with WinForms, C++ and SQL. But you don't know either of those things (or why would you be reading this?) -- so, simple rule that will work: use all lower-case letters, numbers, and underscores.
I'm going to call this one 010_sel_centipede_arc (this will make it easy for people reviewing logs to figure out what's happening. 010 is Baldur's Gate, "sel" is added to most of the happenings in and around Ruqel, centipede is actually English, and we call this one the "arc" because we're going to be distinguishing it from its spinoff centipede butchery later; if you call your quest something like "derp," and it breaks, we're going to have a hard time figuring out what or where "derp" is to fix it)
The quest's name goes into the box labeled sQuest.
The other box, nState, is again a computery way of asking "What step of this quest does this person need to be on to see this?" -- well, they haven't even started the quest, right? That's why Eldata is trying to give the PC some work. Presumably, she'd otherwise have responded to the topic of work with "Oh yeah, how is that thing coming along? You were supposed to save me from centipede-themed doom, remember?" -- so the PC needs to be on step 0 to start this quest, and we put that in the nState box.
Now that we have the NPC talking about work, we need to give the PC the option to take or reject the offer, and we'll need to update the quest state.
To do that, we select the NPC's offer and add nodes inside of it.
Nodes
But this time, our new node gets an action (we have something to do: we have to say "OK, the PC is now on step 1!")
Now, you don't necessarily have to set the same quest that you checked as being updated. If you had a big story arc with a bunch of little quests springing out of it, you'd want to check where the arc is and then start the subquest. But that's not what we're doing here. So, we use the standard ACR script (acr_quest_update) and we tell it to set the PC's 010_sel_centipede_arc to step 1.
As a brief mention of the boxes we're leaving as zeros: -- bAllPlayers is a dangerous option, and you should be super careful with it. It is meant for use with server-wide quests (e.g. if taking this action prompts some impetus for action onto every player on the server, that's what bAllPlayers is for; but if you're writing such a thing, that's probably a conversation between you and the HDM). So, for here, it's 0. We don't want to make the whole server kill centipedes when one person asks about it. -- bAllowOverrideHigher is used if you want this action to let people step backward in the quest. Usually you use this if your quest is repeatable, and you want to let someone go from the finished state to the started state. That's not going to apply here. -- nXP is used to give XP for this step of the quest. We're not doing that here because the PC hasn't really done anything.
With that done, we have all of the functional pieces that make the quest work, but it's nice for everyone's experience if we flesh it out a little bit. What does the NPC say if the PC says no? Are they happy, mad, businesslike, unresponsive if they accept? And what do they say if the PC asks about work again?
I include an example of that last one, because it's the one that needs a condition on it. I place this one between the "Step 0" conversation and the "default" conversation option, and I put a check on it to see if the PC is on "Step 1" (which is where we just put the PC, if they accepted the work) -- this way, if the PC asks again, they get asked what's up with centipedes.