Does anyone know how to get an XML callback somewhere in the xml code when we collapse or expand a journal entry?
Or (perhaps better still), does anyone know how to insert some xml that allows a journal entry to be clicked on and its entry recognised in a callback?
My guess is that it has to be somewhere in this bit … if possible.
I have managed to get some feedback, but I am unable to extract data as I hoped. This is probably just me, but does anyone know what to use with the following “UIObject_Misc_ExtractData”…
Quite frankly, I don’t know if “self:” is referring to the button called “PROTO_HEADER” or to the listbox “JournalEntryList” (though I believe it’s the button). What I know however is that the variable local(0) will be a string containing the internal reference of objectid(0), whatever that is in the xml.
Did you try UIObject_Misc_ExtractData("selected:JournalEntryList","string",0,local:0)?
Not sure if the data type is a string, and its index is 0, but I understand that in that case local(0) will contain the selected row within the list box (but here I don’t know if it’s the quest name or the entry itself - sorry, you’ll have to check )
However, if I understand correctly what you’re after, maybe it’s simpler to just use OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_journalnotes","GIVEDATA",listboxrow:JournalEntryList)
(as per New UI Callback Parameters - Neverwinter Nights 2 Blog - Obsidian Forum Community)
Yes, I have read that info many times already and am still not much wiser with respect to the extract command.
Yes. This and many other combinations, even with diff variables (0-5). The only data I ever got back was the module.
I will give that a go!
Thanks! (I will let you know if that worked.)
EDIT: Unfortunately, I got nothing at all trying to send the data directly like this. So, it must require the extract data command, but I am beginning to wonder if the data is not retrievable from the GUI.
UPDATE: I now managed to get the “module” data returned (again) on a left click using this method, if I used the UIObject_Misc_ExtractData prior to calling the line. Still no individual journal indicators though.
It’s true that the information regarding these commands is not very clear (at least for me!)
If you get the module itself, it could be that the Object_ID index is not high enough? When I test your instant spell code, I’ll test some more things with the UIObject_Misc_ExtractData command
I feel like we are missing potential variable names/numbers to get at what we need sometimes. But, I would have thought the journal GUI would have some variable references we could extract for each list object somewhere.
Let me know if you succeed - and I will keep trying now and then. Perhaps @kevL_s has one of his special tools that could dissect the info we might need.
@Lance no it seems to me all the GUI-functions and related stuff is ‘concealed’ within the hardcoded nwn2 executable. If it were written in c# they would be relatively easy to get at, but I believe the .exe is c/c++
I haven’t done much at all (anything?) with UIObject_Misc_ExtractData()
here’s the xml files (in my nwn2 setup) that use the funct:
If I’m right, the quests are listed in “NOTES_LISTBOX” and the journal entries are in “NOTES_FIELD”. Therefore, to get the text of the entry from the selected quest, you should probably call OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_journalnotes","GIVEDATA",listboxtext:NOTES_LISTBOX.NOTES_FIELD)
If that doesn’t work, please try another time but after having put the “selectonleftclick=true” attribute on the UIListbox
I just checked that section of xml and that affects the NOTES section only … so, I do think its the section of XML I am looking at. But thanks for looking!
“NOTES_PAGE”
Check this TAB instruction … which directs to that section of xml.
Sadly, I still have nothing returned … (zero for module at best).
I may try rewriting the xml from scratch to see if I can do away with the collapsible element altogether, as I think that is what is causing the issue … possibly? It all depends how they hard code the journal info reaching the GUI in the first place.
I mean in my own additions, I use UIPane to encase certain UIListBox elements, which then appear to give me data feedback, but I get nothing from this at the moment. But one would imagine they must be embedded somewhere.
I went through those OC xml and they do follow the pattern I was using. I think my problem is I don’t know where or how (if any) the variables are stored on the GUI. I note that some of these GUIs give some refs for the variables they have used, but I cannot find any info on journal GUI variables.
Definitely … and I tried winging around the proto elements, but it broke the GUI completely. So, I am trying to think of a way around the issue.
Here’s my issue that was annoying me and wanted to resolve, but is turning out more trouble than worth …
I like to give players updated journal entries with additional info, like you have found 3/4 items you need. Furthermore, I add this minor quick ref detail to the journal name so it’s easy to see and reference. I use TOKENS to store this info and update as required. The problem is, TOKENS do not like changing when already “baked” into a journal entry, so you have to remove the entry, update the token and give the entry back. This results in two journal updates spammed to the chat widow, which looks untidy and unnecessary.
So, my idea was to move this additional info to a small “current ref” GUI that could be updated separately and displayed as required by clicking on a journal entry in the journal.
First I tried to stop the chat feedback completely … could not do it.
Next, I tried this GUI approach, but cannot get the callback to work.
So, any ideas on a workable system?
I am edging towards adding my own single button to bring up my own list of journal entries that can be “monitored” as a small in-game GUI. But that feels like overkill!
I am also going to add a right click function to the button to change the background type while open, so it is this style, perhaps a black smudge style and finally a no background (just text) style.
As you say, it’s more immediately accessible this way and I can now remove all those TOKEN points of code that annoyed me. It’s a fair amount of messing around, but I reckon the end result will be worth it. I was also going to have the button have a slight blue glow when it contains active tasks (worth opening).
UPDATE: Choice of TASK BOX background added: As imaged, with black smudge or just plain text. And icon indication when task list available added.