@kevL_s - I managed to solve it! It works! Here’s an explanation for my future self and for others that want to attempt something similar on their own.
I used the custom examine.xml that @kevL_s or @Lance_Botelle (or both? I don’t remember) had made for me before, that I have in my override folder (could maybe have had it in my campain folder too, I don’t know). This XML examine script looks like this:
<?xml version="1.0" encoding="NWN2UI">
<UIScene name="SCREEN_EXAMINE" x=ALIGN_CENTER y=ALIGN_CENTER modal=false width=509 height=700 fadeout="0.3" fadein="0.3" draggable=true backoutkey=true scriptloadable=true
OnAdd=UIScene_OnAdd_AddExamineScreen("EXAMINE_NAME_TEXT","EXAMINE_DESCRIPTION_TEXT","IDENTIFY_BUTTON")
OnAdd0=UIObject_Misc_ExecuteServerScript("gui_effects")
OnRemove=UIScene_OnRemove_RemoveExamineScreen() priority="SCENE_INGAME"/>
<UIText name="EXAMINE_SCREEN_NAME" strref="549" uppercase=true x=60 y=12 width=208 height=20 align=left valign=middle fontfamily="Title_Font" style="1" />
<UIIcon name="EXAMINE_DETAIL" img="ia_examine.tga" x=15 y=12 width=40 height=40 />
<!-- Close Button -->
<UIButton name="CloseButton" x=474 y=8 style="STYLE_CLOSE_BUTTON"
OnLeftClick=UIButton_Input_ScreenClose()>
</UIButton>
<UIButton name="IDENTIFY_BUTTON" x=ALIGN_CENTER y=45 width=140 height=29
OnLeftClick=UIButton_Input_HandleIdentify() disabledcolor="white" >
<UIText name="IDENTIFY_TEXT" width=PARENT_WIDTH height=PARENT_HEIGHT align=center valign=middle uppercase=truefontfamily="Default" style="bold" />
<UIFrame state=up fill="b_subtab_normal.tga" />
<UIFrame state=down fill="b_subtab_pressed.tga" />
<UIFrame state=focused fill="b_subtab_normal.tga" />
<UIFrame state=hilited fill="b_subtab_normal.tga" />
<UIFrame state=hifocus fill="b_subtab_pressed.tga" />
<UIFrame state=disabled fill="b_subtab_disabled.tga" />
</UIButton>
<!-- Item Name -->
<UIText name="EXAMINE_NAME_TEXT" x=ALIGN_CENTER y=87 width=474 height=55 align=center valign=middle fontfamily="Body_Font" style="bold" multiline=true maxlines=3 />
<UIIcon name="HZ_BAR" img="grid_pixel.tga" x=10 y=138 width=490 height=1 />
<UIListBox name="HEADER_LISTBOX" x=26 y=139 width=472 height=551 yPadding=0 xPadding=0 showpartialchild=true
unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=true >
<UIText name="EXAMINE_DESCRIPTION_TEXT" width=PARENT_WIDTH height=DYNAMIC align=left valign=top color="3d3131" fontfamily="NWN1_Dialog" style="bold" />
<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>
</UIListBox>
<!-- Background Image -->
<UIIcon name="EXAMINE_BACKGROUND_TOP" img="idesc_top_bg.tga" x=10 y=8 width=490 height=80 />
<UIIcon name="EXAMINE_BACKGROUND" img="idesc_paper_bg.tga" x=10 y=88 width=490 height=603 />
<UIFrame x=0 y=0 width=PARENT_WIDTH height=PARENT_HEIGHT topleft="frame1_tl.tga" topright="frame1_tr.tga" bottomleft="frame1_bl.tga"
bottomright="frame1_BR.tga" top="frame1_t.tga" bottom="frame1_b.tga"
left="frame1_l.tga" right="frame1_r.tga" border=32 />
Then I checked my gui_effects script (must have been made by Lance originally and then edited by myself) and added some code to that:
///////////////////////////////////////////////////////////////////////////////////////////////////
// Get the nearest examined object to the PC (The game looks for object with the variable "LeftClickExamine").
// This is a way to workaround the fact that we cannot get the left click target any other way.
///////////////////////////////////////////////////////////////////////////////////////////////////
object GetToolsetExamined()
{
object oPC = OBJECT_SELF;
location lPC = GetLocation(oPC);
object oPlace = GetFirstObjectInShape(SHAPE_SPHERE, 5.0, lPC, 0, OBJECT_TYPE_PLACEABLE);
while(oPlace != OBJECT_INVALID)
{
if(GetLocalInt(oPlace, "ClickExamine") && GetLocalInt(oPC,"ThePlaqueToExamine"))
{
return oPlace;
}
oPlace = GetNextObjectInShape(SHAPE_SPHERE, 5.0, lPC, 0, OBJECT_TYPE_PLACEABLE);
}
return OBJECT_INVALID;
}
void main()
{
object oPC = GetControlledCharacter(OBJECT_SELF);
object oPC1 = GetFirstPC();
// Current opened target
object oTarget = GetPlayerCurrentTarget(oPC);
// If just a click examine via toolset setting
if(oTarget == OBJECT_INVALID)
{
oTarget = GetToolsetExamined();
}
string sScriptToRun = GetLocalString(oTarget, "OnExaminedScript");
if(sScriptToRun == "s_tat_examineplaque" && !GetLocalInt(oPC1,"DoneExaminePlaque"))
{
AssignCommand(oPC, ClearAllActions(TRUE));
SetLocalObject(oPC, "ExaminedObject", oTarget);
DelayCommand(0.1, ExecuteScript(sScriptToRun, oPC));
}
else if(sScriptToRun == "s_taf_examinenote" && !GetLocalInt(oPC1,"DoneExamineNote"))
{
AssignCommand(oPC, ClearAllActions(TRUE));
SetLocalObject(oPC, "ExaminedItem", oTarget);
DelayCommand(0.1, ExecuteScript(sScriptToRun, oPC));
}
}
The thing I added here was the “else if” part. In that “else if” part I mention my new script s_taf_examine script that looks like this:
void main()
{
object oPC = OBJECT_SELF;
//object oTarget = GetLocalObject(oPC, "ExaminedObject");
//DeleteLocalObject(oPC, "ExaminedObject");
object oPC1 = GetFirstPC();
if(GetLocalInt(oPC1,"DoneExamineNote")) return;
SetLocalInt(oPC1,"DoneExamineNote",TRUE);
SendMessageToPC(oPC1, "Examined note success!");
}
I then went to the item in question, looked at properties and added this among the variables (I had made something similar with the placeable object):
Ingame I got the message “Examined note success!” so everything seems to be working!