01/07/16, 07:49 PM | #1 |
|
Help Appending To In-Game Quest List
I really know it's going to be something dumb. I'm looking to add to the existing in-game quest list on the journal page.
From Wyykyd's Quest Tracker, I can use Code:
local allQuests, allCategories, seenCategories = QUEST_JOURNAL_MANAGER:GetQuestListData() Is this not the best way to do this? Should I be using a different method? Any help you can provide is appreciated. Also any hints or tidbits on the next steps, of getting my added quest to cycle when "T" is pressed or provide additional information in the journal panel when it's active or clicked would be appreciated as I am sure that will be my next stumbling block. ;-) For those interested, I'm trying to build this. I got the questing logic and stuff worked out and functioning in an alpha state, but I'm trying to integrate most everything into the base UI to make it the best experience possible. TIA |
01/07/16, 09:15 PM | #2 | |
|
You'll probably want to manipulate that questMasterList. But then you might run into issues with MAX_JOURNAL_QUESTS, the active quest limit. You can't overload functions in Lua There's no way to attach argument count/type restrictions to a function. |
|
01/07/16, 09:35 PM | #3 |
|
Your looking for this:
Lua Code:
Here is an example of how to do it:
Warning: Spoiler
Lua Code:
The above code allows you to create quest categories and quests and add them to the journal, but as merlight said there are problems you might run into like MAX_JOURNAL_QUESTS & all of the quest functions that use any quest info like questIndex. You would probably have to hook all of them and handle them yourself or you would probably crash any addon that works with quests. Also who knows what trouble you might run into if ZOS code runs some private functions or something server side and attempts to use your fake questIndex or any of your other fake quest info. Last edited by circonian : 01/07/16 at 09:59 PM. |
01/07/16, 09:50 PM | #4 |
|
That is one of the things I meant when I said you would probably have to hook a lot of functions involving quest info and handle them yourself. You would have to do it to get info to show on the journal page like the description, stepText, Condition text, hints, exc... It would also be required to get the "T" key to cycle to your quest properly.
|
01/08/16, 08:05 AM | #5 |
|
Thank you both for going above and beyond. The code worked exactly as I had hoped. As pointed out, I will need to hook a bunch more. I will spend the day trying to figure it out. I THINK the code above combined with using MailR as a good "how to" for how they handled all hooks inside the messaging screen MIGHT get me there. Thanks again.
|
01/08/16, 08:30 AM | #6 | |
|
||
01/08/16, 11:40 AM | #7 |
|
Argh. Using MailR as an example, which apparently may not be the best case, I put this at the top:
Lua Code:
Assigned the following in my intialization: Lua Code:
And created this: Lua Code:
Which to my limited knowledge should simply run the original GetJournalQuestInfo, but questIndex is coming in nil. I got it to not come in nil once by accident, made some changes, and can't get it back. What am I missing? The plan would be to check the quest index number and if it's a custom quest pass back custom quest info, but if it's a vanilla quest to use the vanilla function as coded above. Thank again. Last edited by dominoid : 01/08/16 at 11:43 AM. |
01/08/16, 11:51 AM | #8 |
|
Ok so changing QuestMaker:GetJournalQuestInfo to QuestMaker.GetJournalQuestInfo worked? What's the difference and why did it work for MailR and not mine?
Sorry for all the noob stuff. I swear I know what I'm outside of here. My problem is my base knowledge is VB.net syntax. If I really new C# or C++, the LUA syntax would look better to me (I think). That and I'm self taught. |
01/08/16, 12:44 PM | #9 | |
function A:f(b,c,d) is equal to function f(self,b,c,d) In both case is self the instance the method is called for. So, if you save a reference of a function declared like A:f(b) it must be handled as f(self, b): Lua Code:
Lua Code:
Lua Code:
|
||
01/09/16, 04:59 PM | #10 |
|
Thanks you. I'm still not sure why it worked for one addon and not the other, but I understand a little better. ;-)
|
01/09/16, 07:19 PM | #11 |
|
I may not be 100% accurate on how I try to explain, but this should at least give you an idea of what the problem is.
As Votan said when you do this: Lua Code:
It is expecting a QuestMaker object to be used to call the function, something like Lua Code:
Where QuestMaker (the object before the : colon) becomes the first parameter called self. So even though you did not write (self, questIndex) as your parameters that is what happens. The QuestMaker object automatically becomes the first parameter called self. Since GetJournalQuestInfo (the original function) does not belong to the QuestMaker object. Meaning it (the original function) is not defined as: Lua Code:
It is defined as: Lua Code:
But since you assigned the original function to reference Lua Code:
Lua Code:
Which causes the problem. When you call GetJournalQuestInfo(questIndex), remember since you redirected it to QuestMaker:GetJournalQuestInfo it is expecting two parameters (self, questIndex), so questIndex is the first parameter and it is becoming self and there is no other parameter so questIndex is nil. You should make it something like Lua Code:
Last edited by circonian : 01/09/16 at 07:25 PM. |
ESOUI » Developer Discussions » General Authoring Discussion » Help Appending To In-Game Quest List |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|