Well, I'm not a professional Quester, but teach it to those who do not know, be happy: D
Come learn the basics of doing quests.
Lately I've seen, both in skype as forum, people who need a lot of quests that are very simple.
I come here to do a little tutorial on the basics of quests, for those unaware.
The first thing we must know is that ALL quests start at:
quest name begin
Where to put the name in the name of the quest. So give the order to start the quest.
After that, we proceed to the state.
state start begin
Now, let's see, quest serves to start the quest, and the state, serves to ... ?
The state is a division of type quest, all quests in the initial state will always start and from there we can change the state to be able to perform various actions.
And we continue to onset of action:
When action begin
In When there are several types of actions:
- Button;
- Enter;
- Info;
- Kill;
- Leave;
- Letter;
- Levelup;
- Login;
- Logout;
- Target;
- Unmount;
- Chat;
- Click;
- Use.
Where are the most common:
- Button;
- Info;
- Kill;
- Letter;
- Levelup;
- Login;
- Target;
- Chat;
- Click;
- Use.
Now, where do you usually use these kinds of when?
If you look in quests biologist use up all these whens.
But we'll focus more on login, because it will be used in the example.
Come on then translate these first 3 lines of a quest:
When you start the quest name, the state start begin, causing the action to start.
Sounds complicated portuquês talking?
Let's talk in question, in language. Honeymoon:
Code:
quest teste begin
state start begin
when login begin
say("Vais mudar de state")
set_state(aprender)
end
end
state aprender begin
when login begin
say("Estás no state aprender")
end
end
end
Well, let's see a little bit.
quest begin test
Top of quest.
state start begin
Home state start.
When login begin
Start of when, this will cause the player character when they log in (when we teleportamos including a map) suffers an action.
say ("You'll change your state")
It is the action that the player will suffer when logs.
set_state (learn)
Change to state that the player suffers another action.
end
Closed when.
end
Closed state.
state learning begin
Home of the new state that we did.
When login begin
Start of when, this will cause the player character when they log in (when we teleportamos including a map) suffers an action different from the action of the state start.
say ("You learn in state")
It is the action that the player will learn to suffer in the state.
end
Closed when.
end
Closed state.
end
Closing the quest.
Easy?
So, let's proceed.
Is there anyway to change state between quests?
Yes, the function set_quest_state ("nome_da_quest", "nome_do_state").
Consider:
Code:
quest teste4 begin
state start begin
when 9010.chat."Ae" begin
say("Ae cara")
set_quest_state("teste5", "hi")
end
end
end
Code:
quest teste5 begin
state start begin
when 9003.chat."Olá" begin
say("Olá")
set_state(hi)
end
end
state hi begin
when 9001.chat."Hi" begin
say("Hello, nice to meet you!")
end
end
end
What will happen here?
When the npc 9010 and click on the option Ae, a message will appear saying Ae guy and will switch to state hi, teste5 quest that will cause the npc go to 9001 and click on the option Hi, the message Hello, nice to meet you!
It's simple!
That is, the state hi will only be activated when the end test4 quest!
What are the ends?
Like give begin to start something, in the end close.
How do we know how to put on a quest ends?
It is simple and easy, so a quest to work, plus a good syntax, needs to be properly closed.
That said, watching the quest, we can deduce that:
- The quest, state and When are mandatory bring an end forever.
That is, in all quests always necessary, the third end, these three are required!
One for the quest, one for the state and one for when.
Besides these, if also the lead end, always!
For example:
Code:
quest aprender begin
state start begin
when login begin
say("Já sei usar os ends")
end -> end do when
end -> end do state
end -> end da quest
Simple, no?
And if you want to use 2 When a quest, I always have to change state?
No, not always, only when a player suffers an action say, quite different from the first, ie, if it is to put in several npc When, for example, to open multiple stores, so before getting a second when, would have to close the first.
That is:
Code:
quest teste2 begin
state start begin
when 9003.chat."The End" begin
say("Oi")
end -> end do primeiro when
when 9003.chat."The End2" begin
say("Adeus")
end -> end do segundo when
end -> end do state
end -> end da quest
And the same goes for the state, but not with the quest because the quest includes all this, if you close a quest, you can not add another in the same document.
Structure of a quest
This can be as you like, but if in doubt we advise ends to put to use what I use:
This way we know what we're close.
That's it!
Any doubt and say if they want another day, another topic of these, let us know!
I hope I have been explicit.