Jump to content
Aveyond Studios Community
Sign in to follow this  
tuskel

Variables: simple fetch quest tutorial?

Recommended Posts

Is there a nice simple fetch quest tutorial anywhere? I specifially want the end bit... I have managed (long time ago in the past) to get the "give quest" thing working, but I don't seem to have managed to get the end bit - giving the items and getting the reward - right.

 

Also, I want to add a little variable event in a house: I cannot leave unless I have collected a book, and my character comments on it. If he has collected it already, the event won't run. So it has to be sort of 

*variable=has book

** self switch A is on (empty page)

*variable=no book

** Text: "I should pick up this book"

 

 

(If you get what I mean in my noob event description way, heheh)

 

tuskel,

sincerely

 

EDIT: I figured out the book thing (it's just "If this item in inventory", I had done it on another map before, so I could basically copy it), however, still need help with the fetching bit in a quest.

Share this post


Link to post
Share on other sites

testing testing, I can't seem to reply to this post O.o

 

EDIT: Oh sure, THAT one went through. I have a real post written up for you, but the forum is being temperamental. Please hold while I try to figure out why.

 

EDIT EDIT: son of a gun, I don't know why this isn't working O.o Okay well I had these all neatly under spoiler headings, but I'm going to try to take them out and see if that helps?

 

EDIT EDIT EDIT: oh for crying out loud. I have no idea why this isn't working.

 

I think Tigerseye might've had a tutorial, but you'd have to search the Wayback Machine to find it.

I generally don't use variables for quests--I use switches. The difference between them is that switches have two states--On or Off--while variables can be set to any number. If you had to pick up three books, for example, I would use a variable--but for one book, I'd use a switch.

So you have your quest: you need to bring a book to someone in the house before you can leave. If you try to pick up the book before you get the quest, you can't do so. If you try to leave the house without doing it, you get bounced back. If you try to leave with the book, you get bounced back. The only way to get out that door is by doing all these tasks:

-Talk to the quest-giver, get the quest

-Pick up the book

-Talk to the quest-giver again to complete the quest

-NOW you can leave

 

The next three posts, because it won't post as one for some god-forsaken reason, are how I would go about it. Moderator-gods, forgive me xD

Share this post


Link to post
Share on other sites

I don't know why I can't get this to post. I've removed all traces of formatting, but still no luck. I'm going to try in smaller pieces. Forgive my triple-posting OTL

 

For the Quest-Giver:

EVENT: Quest-Giver, [Page 1], [No Conditions], Graphic: Fighter01

Show Text: "Hi! Would you pick up that book over there and bring it to me, please?"

Control Switch: "001: Get Book is ON"

 

EVENT: Quest-Giver, [Page 2], [switch "001: Get Book" is ON], Graphic: Fighter01

Conditional Branch:

 If Item001: Book is in inventory

Show Text: "Thank you!"

Control Switch "001: Get Book is OFF"

Control Switch "002: Book Quest Complete is ON"

Change Items: "001: Book" -1

Else

Show Text: "Have you gotten the book yet?"

Share this post


Link to post
Share on other sites

EVENT: Quest-giver, [Page 3], [switch "002: Book Quest Complete" is ON], Graphic: Fighter01

Show Text: "Thanks for bringing me the book!"

 

For the Book:

EVENT: Book, [Page 1], [No Conditions], Graphic: Tileset (select the square with the book)

Show Text: "This book looks interesting, but it isn't yours. Better leave it alone."

 

EVENT: Book, [Page 2], [switch "001: Get Book" is ON], Graphic: Tileset

Show Text: "You pick up the book."

Play ME: Item01

Control Items: "001: Book" +1

Set Move Route: This Event

Change Graphic: NONE

Control Self-Switch: A is ON

 

EVENT: Book, [Page 3], [self-Switch "A" is ON], Graphic: NONE

[Empty. You don't need anything on this page!]

Share this post


Link to post
Share on other sites

For the Door:

EVENT: Door, [Page 1], [No Conditions], Graphic: NONE

Conditional Branch:

If Switch 002: Book Quest Complete is ON

Transfer Player: "Map002: Outside"

Else

Show Text: "You shouldn't leave yet."

Set Move Route: Player

Move Up (or whatever direction is away from your door)

 

Most of the commands in the events there should explain themselves pretty well, but shout if you need clarification!

Share this post


Link to post
Share on other sites

Wow, thanks for the thorough answer! Everything is pretty self-explanatory, but I had never thought of putting in a switch for the completion of a quest. Which leads me to another question: sometimes there are quests that take place well, all over the place, and you cannot get a quest before you have finished one somewhere else. That "quest A complete" switch would be very useful then. Or do I have to use something else then? Common events? I mean, how to make sure that a person in another town will know a certain quest is completed? (example: the wine merchant in Darkthrop games - Edit: is it because the item is gone from the inventory?)

 

Also, I will have to lean to use variables one day, because one of my "tutorial" quests is collecting three piles of logs. I have managed to get the quest, and collect piles of logs, but the person doesn't seem to realise I have them, and still keeps asking where they are. :P

 

tuskel,

sincerely

Share this post


Link to post
Share on other sites

Honestly, I'd forgotten just how much I use "quest complete" switches XD When the quest isn't relevant to something later, I just use self-switches--but if, like you said, someone in the next town over needs to know that you completed the quest? Super useful.

 

Yep, if you wanted to give a quest (let's call that Quest B ) that can only be completed after a different quest (Quest A), turn on a switch "Quest A Complete" when Quest A is complete and have a condition that Quest B will only be offered If Switch: Quest A Complete is ON. You can do this either with multiple event pages or with a conditional branch. If the same person gives both quests, I would use multiple pages. If the person giving Quest B is not the same person who gave Quest A, I would use a conditional branch.

 

Variables are a lot like switches, just a little more complex! For your log-collecting quest, you would do the following:

-When you're given the quest, include a command Control Variable: 001: Logs Found == 0

-Create a new event page for the quest-giver with the condition [Variable 001: Logs Found is greater than 0], then use a conditional branch:

IF Variable 001: Logs Found = 3

Show Text: "Thanks for finding all the logs!"

ELSE

Show Text: "You haven't found all the logs yet."

 

Then, for each log, you'd have something that looks like this:

Show Text: "You found a log!"

Change Items: Log +1

Control Variable: 001: Logs Found =+ 1

Control Self Switch A is ON

(and then a blank page with the condition Self Switch A is ON)

 

That makes it so you can only pick up each log once, and it will add one to your "logs found" each time. You can't find the same log multiple times (because you turned on the self-switches that call a blank page) and the quest-giver won't let you move on until you have three logs.

 

There are many functions that you can do to variables--you can change a variable by an amount tied to a different variable!--but this should be a good start for you. I know for sure TigersEye had a good Variables tutorial, if you need more information!

Share this post


Link to post
Share on other sites

For your log-collecting quest, you would do the following:

-When you're given the quest, include a command Control Variable: 001: Logs Found == 0

-Create a new event page for the quest-giver with the condition [Variable 001: Logs Found is greater than 0], then use a conditional branch:

IF Variable 001: Logs Found = 3

Show Text: "Thanks for finding all the logs!"

ELSE

Show Text: "You haven't found all the logs yet."

I need some more help. I simply cannot seem to get it to work. Am I in the wrong place or sth? 

 

What I have done so far is this:

Page 1:

@Text: \nm[saara]If you could find three piles of logs and 

carry them home for me, I would be really grateful! 
And while you do that, I get your vegetables ready!
@ Control Variables: [0002 Three logs] = 0
@ Control Switches: [0003 Logs for Saara] = ON
@ Control Self Switch: A  =ON
 
Page 2:
(Self switch A is on, obviously)
(And here I am trying to do what you told me up there in the quote bit, and failing :D)
@ Conditional Branch: Variable [0002: Three Logs] ==3
 @ Change items: [Logs]  -3
 @ Text: \nm[saara] Thank you! Here are your vegetables!
 @ Change Items: [Cave Vegetables] +1
 @ Play ME
 @ Text: Acquired Cave Vegetables
 @ Control switches: [0003 Logs for Saara] = OFF
 Else:
 @ Text: \nm[saara] Have you found my firewood yet?
Branch End
 
So what is the thing in the quote you said to include first: condition (logs greater than 0), and then branch. But where is the condition itself? I am really confused!  :wacko:
 
tuskel,
sincerely

Share this post


Link to post
Share on other sites

A "conditional branch" is used for establishing a cause and effect, essentially. If you have all three logs, she gives you a reward. By default, when you choose "Conditional Branch" as an event command, RMXP gives you a secton for IF (if the condition is true) and ELSE. "Else" covers if the condition is not true. In this case, that means all the other possibilities--if you found one, two, or zero logs.

 

If you wanted to, you could add another conditional branch in the ELSE section and say that "IF logs found == 0, then show text "don't forget my firewood!" ; ELSE show text "Have you found all the firewood yet?" If-else statements are yes or no questions. Is this true? Yes? Then this happens. No? This other thing happens.

 

I'm not sure why what you have there isn't working--it looks pretty much like it should to me, only some minor changes I'd make:

Event page 1 looks good--but I wouldn't turn on Self Switch A there. You don't really need it. Just turning on "Logs for Saara" should do it.

Then I'd set the condition for page 2 as "Switch 003: Logs for Saara is ON" rather than "Self Switch A is ON." Everything you have for page 2 looks good, but in order to make the quest end once and stay ended (no repeat rewards) I would add "Control Self-Switch A: ON" after you've turned "003: Logs for Saara."

Then I'd add a page 3, with something like:

Text: \nm[saara] Thanks again for finding my firewood!"

 

If that doesn't work, I'll whip up a trial version of the event and see for sure if there's anything I'd do differently. Good luck, let me know!

Share this post


Link to post
Share on other sites

Nope, it still doesn't seem to work. So I got thinking: How do I actually make the program understand that the logs I am collecting are the things it should be counting? Is that where I've been going wrong?

 

EDIT: I got it working! I read another tutorial, and figured out that Control Variable bit you mentioned in the previous post. Basically, that is the thing that tells the game what that variable is. In my case I had to tell the game that "0002 Three Logs" meant that it had to count items in my inventory - Logs. Have I finally understood? :)

Share this post


Link to post
Share on other sites

OHHH, that's what was missing!

 

Yes, Control Variable will tell it what to look for--but I think you found a different way to do it! I didn't realize that you could set a variable equal to the number of a specific item in your inventory. That's really neat! All this time I've been changing the variables manually XD You learn something new every day, haha.

 

So yes, it sounds like you figured it out! :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×