QuestBoard¶
The interaction for a quest board which allows to consult the 3 quest boards and take any open quests by having a dialogue with the caretaker of the quest board which is another NPCControl.
args meaning¶
None.
Data meaning¶
data[0]
: An entity id that corresponds to the caretaker of the quest boarddata[1]
: A dialogue line id of what the caretaker of the quest board will say when accepting to take a quest. The line must contain a prompt for the system to work because this line will get prepended with a questprompt when confirming the quest. Check the documentation of that command to learn more about how this all workdata[2]
: If it's not negative, this is a flag slot that if it's false, Interact will be called on thenpcdata
of the map entity whose id isdata[0]
.vectordata[0]
: The camera position to move before showing the quest board UI, set to instance.camoffset
vectordata[1]
: The camera angles to move before showing the quest board UI, set to instance.camangleoffset
vectordata[2].x
: The camera speed to usd while moving the camera before showing the quest board UI, set to instance.camspeed
vectordata[2].y
: The time in seconds to let the camera move before showing the quest board UI
LateUpdate (SpecialTattles)¶
The tattleid
is set to -1 ("L.", this isn't supposed to be tattled as this text is an internal error message).
Interact¶
If data[2]
isn't negative and its corresponding flag slot is false, Interact is called on the npcdata
of the map entity whose id is data[0]
without any arguments.
Otherwise, an OpenQuestBoard coroutine is started with the map entity whose id is data[0]
as the caretaker and this as the caller.
PlayerControl.LateUpdate¶
entity.emoticonid
gets set to 1 (a blue ?) and entity.emoticoncooldown
gets set to 2.0 if all of the following conditions are met:
- We aren't in a
pause
orminipause
- The message lock is released
- The player isn't
digging
,flying
,startdig
or inshield
- This is the closest NPC in the
npc
list as of the last 3 frames
MainManager.OpenQuestBoard¶
This is a public static coroutine that is exclusive to this interaction. It receives an EntityControl as the caretaker (the entity whose id is data[0]
) and an NPCControl as the caller (which is this NPCControl).
Its job is to setup the opening of the quest board UI and also setups the ItemList that shows the quests. Since this coroutine involves a lot of verbose rendering, its documentation is going to paraphrase a lot:
- All huds elements are hidden (including the berry count and discovery ones) by setting
discoveryhud
,showmoney
andhudcooldown
to 0.0 - The camera position is saved to the temporary files via SaveCameraPosition(true)
- flag 2 (unchecked new quests) is set to true
option
is set to 0minipause
is set to true- The
No Quests
BoardQuest is removed from theboardquests
- A frame is yielded
- FaceTowards is called on the caretaker to face the player
- Every
playerdata
entity has FaceTowards called on them to face the caller - instance.
boardcaller
is set to the caller - instance.
camoffset
is set to the caller.vectordata[0]
- instance.
camangleoffset
is set to the caller.vectordata[1]
- instance.
camspeed
is set to the caller.vectordata[2].x
- caller.
vectordata[2].y
seconds are yielded - Every
playerdata
entity has FaceTowards called on them to face the caller - FaceTowards is called on the caretaker to face the player
From there, there is a lot of rendering logic that won't be detailed for brevity. The main things to keep in mind is the quest board root UI object is set to instance.questboardobj
with the name QuestBoard
. Every UI elements ends up being a descendant to it. This UI rendering involves SetText calls in non dialgue mode. The only thing worth mentioning about these calls is if the languageid is Japanese
or Russian
, it affects the presence or parameters of size commands and it doesn't offset the text of the tabs in x. If it's Spanish
, the tab's text are offset by -0.75 in x. The tabs's text are offset by -0.05 in other languages.
From there, listammount
is set to 10 and ShowItemList is called with the open quests list type, a position of (-8.5, 2.55) with show description and without listsell.
All in all, this adds some functionality in MainManager.Update where the player is also able to use the left and right inputs to change the listtype being shown from open quests -> taken quests -> completed quests. This support wrap around. This functionality is possible thanks to the presence of the questboardobj
.
Finally, UpdateQuestBoard is called and it will be called everytime the listtype
changes.
MainManager.UpdateQuestBoard¶
This is a private static method exclusive to this interaction. It is called by OpenQuestBoard and and also once everytime the player changes the board's listtype.
All this really does is it manages the tabs's sortingOrder
and whether or not the Take Quest
UI element should be enabled (it only is on the open quests list type). The details on how this happens won't be documented for brevety.