Aller au contenu

Photo

XML Button Does Not Toggle Colour When Screen Name Changed!


  • Veuillez vous connecter pour répondre
27 réponses à ce sujet

#1
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi There,

This problem is driving me crazy!

I have an edited version of the "journal.xml", which works fine in *every* respect - unless I change its name to "journalsmall.xml" and give it a screen name like "SCREEN_JOURNAL_SMALL". When I do, the XML still works ... apart from the fact that buttons clicked on do NOT revert back to "normal" when clicked on another button. The last button clicked remains as if still clicked!

In other words, the problem occurs with the same XML code when I call it this way:-

DisplayGuiScreen(oPlayer, "SCREEN_JOURNAL_SMALL", FALSE, "journalsmall.xml");
instead of calling it this way:-

DisplayGuiScreen(oPlayer, "SCREEN_JOURNAL", FALSE);

The XML code (apart from editing the SCREEN NAME and the file name between testing) is unchanged!

Effectively, the following elements are not being observed when the button they are attached to has returned back to its "UP" state in the renamed file:-
 
<UIFrame state=up	fill="b_g_lg01_normal.tga" />
<UIFrame state=down	fill="b_g_lg01_pressed.tga" />
<UIFrame state=focused	fill="b_g_lg01_pressed.tga" />
<UIFrame state=hilited	fill="b_g_lg01_normal.tga" />
<UIFrame state=hifocus	fill="b_g_lg01_pressed.tga" />
<UIFrame state=disabled	fill="b_g_lg01_normal.tga" />
Has anybody any idea how to get around this problem?

Thanks in advance,
Lance.

#2
kevL

kevL
  • Members
  • 4 056 messages

have you tried initializing your new GUI with the 'ingameguix2.ini' file?

I assume ingameguix2 overrules ingamegui and ingameguix1 -- that is, i have a custom ingameguix2.ini, by itself, in \Override\ui\default\


under [MandatoryGUI] section:

SCREEN_JOURNAL_SMALL=journalsmall.xml


it's a longshot, Lance, but there 'tis. Then call it via
 

DisplayGuiScreen(oPlayer, "SCREEN_JOURNAL_SMALL", FALSE);

maybe the engine will think it's a right-proper GUI this way,
 



#3
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

have you tried initializing your new GUI with the 'ingameguix2.ini' file?

I assume ingameguix2 overrules ingamegui and ingameguix1 -- that is, i have a custom ingameguix2.ini, by itself, in \Override\ui\default\


under [MandatoryGUI] section:

SCREEN_JOURNAL_SMALL=journalsmall.xml


it's a longshot, Lance, but there 'tis. Then call it via



DisplayGuiScreen(oPlayer, "SCREEN_JOURNAL_SMALL", FALSE);
maybe the engine will think it's a right-proper GUI this way,


Hi KevL,

Yes, I tried exactly that too! :D

I also assumed that editing the ingameguix2.ini would be sufficient as it was the latest/newest read by the engine ... as I say, I assume.
 
I even tried renaming the SCREEN name SCREEN_JSMALL (instead of SCREEN_JOURNAL ) just in case it it did not like "similar" names or a second "_" in the name. Still did not work, :(
 
Lance.

#4
kevL

kevL
  • Members
  • 4 056 messages

Lol, sorry then that's all i can think of,

 

other than just double-check the button-state .Tga's



#5
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Lol, sorry then that's all i can think of,
 
other than just double-check the button-state .Tga's


Same script, just renamed .... :(

Most strange I think,
Lance.

#6
kevL

kevL
  • Members
  • 4 056 messages

I also assumed that editing the ingameguix2.ini would be sufficient as it was the latest/newest read by the engine ... as I say, I assume.


sidenote: I recently discovered that's not always a safe assumption. Was tinkering with 'worldmapnx2.xml' and when it didn't work I had to fall back on one of the earlier versions, for my changes to show up.



#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

sidenote: I recently discovered that's not always a safe assumption. Was tinkering with 'worldmapnx2.xml' and when it didn't work I had to fall back on one of the earlier versions, for my changes to show up.


Oooookay! I'll have another go adding to all the ingamegui files.

I'll post results in a bit.

Cheers,
Lance.

#8
kevL

kevL
  • Members
  • 4 056 messages

well... if you can make the call from script without spec'ing the XML filename, and the Gui indeed shows up, then it's a safe assumption that the ingamegui that defined the SCREEN is working



#9
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

well... if you can make the call from script without spec'ing the XML filename, and the Gui indeed shows up, then it's a safe assumption that the ingamegui that defined the SCREEN is working



Hi again,

OK, I edited all three ingamegui and the XML fires OK (as if recognised as an "official" one) ... but those buttons fail ... again. :(

Most frustrating!

Lance.

#10
kevL

kevL
  • Members
  • 4 056 messages

Lance,
I'm getting the same behavior w/ SCREEN_JOURNAL and SCREEN_JOURNAL_SMALL

that is, I copied journal.xml to journalsmall.xml

Changed the 2nd screenname to SCREEN_JOURNAL_SMALL and put an arbitrary button on both screens identically. I called the screens from the console using your function calls from the OP. And, most importantly, I used unique .Tgas (align_ce.tga, etc.) for each of

<UIFrame state="up"       fill="align_ce.tga" />
<UIFrame state="down"     fill="align_cg.tga" />
<UIFrame state="focused"  fill="align_cn.tga" />
<UIFrame state="hilited"  fill="align_e.tga" />
<UIFrame state="hifocus"  fill="align_g.tga" />
<UIFrame state="disabled" fill="align_le.tga" />

and watched what happened.

- up is of course default.
- hilited is mouseover.
- down is pressed
- focused is released
- hifocus is focused w/ mouseover

and both screens then stay on the focused Tga until focus is removed by *clicking somewhere else on the Gui* which makes the button return to its default/up icon.

Both screens exhibit the same -- seemingly correct -- behavior. oh, and i didn't define the small_journal in ingamegui ...

#11
kevL

kevL
  • Members
  • 4 056 messages
PS
 

... apart from the fact that buttons clicked on do NOT revert back to "normal" when clicked on another button. The last button clicked remains as if still clicked!


there wouldn't happen to be (invisibly) overlapping elements, would there? Such that clicking on another button maintains focus on the first?

[edit] With two buttons side by side, both screens change the focus just fine here. Here's my call-script:
 
// 'gui_testscreen'

void main(int iCase)
{
    object oPC = OBJECT_SELF;
    oPC = GetControlledCharacter(oPC); // just a safety.

    switch (iCase)
    {
        case 1:
            DisplayGuiScreen(oPC, "SCREEN_JOURNAL", FALSE);
        break;
        case 2:
            DisplayGuiScreen(oPC, "SCREEN_JOURNAL_SMALL", FALSE, "journalsmall.xml");
        break;
    }
}

Modifié par kevL, 12 mai 2014 - 10:30 .


#12
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi KevL,

EDIT: Actually, did I just read you had it working by changing the name of the TGAs for one of the XML scripts?

 

I must have misunderstood, as I just tried changing the tga names for the small journal and it still comes back the same. :(

I really appreciate you looking a this ... It's driven me bonkers!

As far as I am aware, there is no overlap ... as I say, the same XML code works when I change the SCREEN/FILE name.

Below is the XML code in its entirety.

See if you can spot anything else that I may have missed.

EDIT: I recognise that you are missing some textures for this .... !

EDIT: The script below uses a 2da, but you can change the entry requests for something more available to test if you like. Eventually, I will be adding via script code entries rather than 2da if all goes to plan.

EDIT .. POPULATE LIST CODE: PLACE ON A LEVER TO USE:
 

void main()
{
	object oPlayer = GetLastUsedBy(); 	
	
	DisplayGuiScreen(oPlayer, "SCREEN_JOURNAL_SMALL", FALSE, "journalsmall.xml"); 
	
	int i = 0;
	
	while (i < 5) 
	{
		AddListBoxRow(oPlayer, "SCREEN_JOURNAL_SMALL", "BEASTLIST", "BESTIARY_OBJECT_"+IntToString(i), 
		"BESTIARY_OBJECT_TEXT="+ Get2DAString("bestiary","Name", i), 
		"BESTIARY_OBJECT_IMAGE=" + Get2DAString("bestiary","Icon", i) + ".tga", 
		"5="+IntToString(i), "");
		
		i = i + 1;
	}
}

Many Thanks,
Lance.

 

<?xml version="1.0" encoding="utf-8">

<UIScene name="SCREEN_JOURNAL_SMALL" x=ALIGN_CENTER y=ALIGN_CENTER width=379 height=460 draggable=true scriptloadable=true idleexpiretime="0.1" backoutkey=true priority="SCENE_INGAME" 
OnAdd0=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD")   
OnRemove0=UIScene_Misc_RequestJournalUpdates("false","NOTES_FIELD") 
OnRemove1=UIObject_Misc_ExecuteServerScript("gui_examine","JournalClosed")/>

	<!-- ***SCENE TITLE*** -->
	<UIText name="SceneTitle" strref="181392" x=80 y=12 width=280 height=24 align=left valign=middle uppercase=true fontfamily="Title_Font" style="1" />

	<!-- Close Button -->
	<UIButton name="CloseButton" x=342 y=8 style="STYLE_CLOSE_BUTTON" 		OnLeftClick0=UIButton_Input_ScreenClose()>
	</UIButton>

	<!-- SIZE TOGGLE Button -->
	<UIButton name="SizeButton" text="Toggle Size" x=220 y=7 style="STYLE_SMALL_BUTTON" 
		OnLeftClick=UIObject_Misc_ExecuteServerScript("gui_examine","JournalSize")>
	</UIButton>

	<UIIcon name="JOURNAL_ICON" img="qj_icon.tga" x=0 y=0 width=78 height=71 />

	<!-- ***JOURNAL OPTION TABS*** -->
	<UIButton name="SHOW_QUESTS_ACTIVE" x=26 y=43 style="STYLE_SMALL_TAB" strref="63497" buttontype=radio groupid=1 groupmemberid=1
		OnSelected0=UIButton_Input_SetJournalPage("QUESTS_PAGE","PAGE_QUEST_ACTIVE") OnSelected1=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD") 				OnUnselected=UIButton_Input_HideObject("QUESTS_PAGE")>
	</UIButton>
	
	<UIButton name="SHOW_QUESTS_COMPLETED" x=108 y=43 style="STYLE_SMALL_TAB" text="Complete" buttontype=radio groupid=1 groupmemberid=2 
		OnSelected0=UIButton_Input_SetJournalPage("QUESTS_PAGE","PAGE_QUEST_COMPLETED") OnSelected1=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD") 				OnUnselected=UIButton_Input_HideObject("QUESTS_PAGE") >
	</UIButton>

	<UIButton name="SHOW_BESTIARY" x=190 y=43 style="STYLE_SMALL_TAB" text="Bestiary" buttontype=radio groupid=1 groupmemberid=3
		OnSelected0=UIButton_Input_ShowObject("BESTIARY_PAGE")  OnSelected1=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD") OnUnselected=UIButton_Input_HideObject("BESTIARY_PAGE") >
	</UIButton>
	
	<UIButton name="SHOW_NOTES" x=272 y=43 style="STYLE_SMALL_TAB" strref="63498" buttontype=radio groupid=1 groupmemberid=4
		OnSelected0=UIButton_Input_SetJournalPage("NOTES_PAGE","PAGE_NOTES") OnSelected1=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD") OnUnselected=UIButton_Input_HideObject("NOTES_PAGE") >
	</UIButton>


	<!-- ***JOURNAL LIST OF COLLAPSABLES*** -->
	<UIPane name="QUESTS_PAGE" x=34 y=84 width=336 height=368 hidden=false >

		<!-- ***JOURNAL SORT OPTIONS*** -->
		<UIPane name="SORT_DATE_PANE" x=0 y=0 width=100 height=20 >
			<UIButton name="ByDate" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=1
				OnSelected=UIButton_Input_SetJournalSort("SORT_DATE") >
			</UIButton>
			<UIText name="DATE_TEXT" strref="6325" x=22 y=0 width=78 height=20 
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>
		<UIPane name="SORT_NAME_PANE" x=100 y=0 width=100 height=20 >
			<UIButton name="ByAlpha" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=2
				OnSelected=UIButton_Input_SetJournalSort("SORT_NAME") >
			</UIButton>
			<UIText name="NAME_TEXT" strref="154" x=22 y=0 width=78 height=20 
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>
		<UIPane name="SORT_PRIORITY_PANE" x=200 y=0 width=130 height=20 >
			<UIButton name="ByPriority" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=3
				OnSelected=UIButton_Input_SetJournalSort("SORT_PRIORITY") >
			</UIButton>
			<UIText name="PRIORITY_TEXT" text="Recommend" x=22 y=0 width=108 height=20
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>		
		
		<UIListbox name="JournalEntryList" x=1 y=47 width=332 height=320 yPadding=2  
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32
		update=true OnUpdate=UIObject_OnUpdate_GetJournalEntries() >
			<UICollapsable prototype=true name="JournalCollapsable" x=0 y=0 height=PARENT_HEIGHT width=299 isexpanded=true 
			yPadding=1 xPadding=5 >
				<UIButton name="PROTO_HEADER" x=0 y=0 height=44 width=299 header=true >
					<UIText indent=18 hangingindent=18 align=left valign=middle fontfamily="Default" style=2 uppercase=true prototype=true maxlines=2 />
					<UIFrame state=up			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=down			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hilited		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=focused		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hifocus		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=disabled		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=header		fill="b_qjd_normal.tga" />
					<UIFrame state=hiheader		fill="b_qjd_normal.tga" />
					<UIFrame state=downheader	fill="b_qjd_normal.tga" />
				</UIButton>
				<UIText name="PROTO_TEXT" x=0 y=0 width=299 height=DYNAMIC prototype=true align=left valign=top multiline=true color="312A0A"
				fontfamily="NWN1_Dialog" style="bold" />
			</UICollapsable>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListbox>
	</UIPane>

	<UIPane name="NOTES_PAGE" x=34 y=84 width=336 height=368 hidden=true >
		<UIListBox name="NOTES_LISTBOX" x=1 y=47 width=332 height=320 showpartialchild=true
			unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >
			<UIText name="NOTES_FIELD" width=PARENT_WIDTH height=DYNAMIC align=left valign=top multiline=true color="black" fontfamily="NWN1_Dialog" style="bold" clearonescape="false"
			editable=true selectable=true maxlength=16384 allowspace="true" />
			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListBox>	
	</UIPane>

	<! ---------------- NEW CODE FOR BESTIARY TAB -------------------------------------- >

	<UIPane name="BESTIARY_PAGE" x=10 y=74 width=360 height=380 hidden=true >

		<!-- *** BESTIARY CREATURE INFORMATION - TOP PANEL *** -->

		<UIPane name="BESTIARY_BOX" x=0 y=5 width=PARENT_WIDTH height=170 >

			<UIText name="BESTIARY_TEXT1" text="Creature Name" x=0 y=-1 width=355 height=20 align=center valign=middle fontfamily="Title_Font" style=1 />
			<UIIcon img="char_stats_title.tga" x=ALIGN_CENTER y=0 width=355 height=20 ignoreevents="true" />

			<UIIcon img="p_friend_frame.tga" x=0 y=22 width=78 height=86 />
			<UIIcon name="BESTIARY_IMAGE" x=10 y=35 height=64 width=64 />
	
				<UIListBox name="INNERBOX" x=80 y=27 width=276 height=130 showpartialchild=true unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >		
				
					<UIText name="BESTIARY_TEXT2" text="Creature Description" width="268" height="DYNAMIC" align="left" valign="top" fontfamily="Default" style="1" multiline="true" indent=4 hangingindent=4 />
					<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>

				</UIListBox>	

			<UIIcon name="DETAIL_MIDDLE" img="stats_container_lg.tga" x=ALIGN_CENTER y=ALIGN_CENTER width=360 height=170 ignoreevents="true" />			
			<UIIcon name="BACKGROUND_TOP2" img="qj_top2.tga" x=0 y=0 width=360 height=180 ignoreevents="true" capturemouseclicks="false" />	
	
		</UIPane>		
				

		<!-- *** BESTIARY LIST OF CREATURES - BOTTOM PANEL *** -->
		
		<UIListbox name="BEASTLIST" x=21 y=177 width=336 height=200 yPadding=2 update=true updaterate="0.3" OnUpdate=UIObject_Misc_ExecuteServerScript("gui_bestiary_refresh",local:2)
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32 hidescrollbarwhennotneeded=false >		
				
			<UIPane name="BESTIARY_PROTO" width=268 height=40 tupple=true draggable=false prototype=true 
			OnLeftClick0=UIObject_Misc_ExtractData(self:,string,5,local:1)  			
			OnLeftClick1=UIObject_Misc_ExecuteServerScript("gui_beast_info",local:1) >

				<UIIcon img="icon_frame.tga" x=5 y=0 width=40 height=40 />
				<UIIcon name="BESTIARY_OBJECT_IMAGE" img="ife_harmorprof.tga" x=5 y=0 width=40 height=40 />

				<UIButton name="BESTIARY_OBJECT_TEXT" x=45 y=0 width=256 height=40 >

					<UIText name="FEAT_TEXTFIELD" indent=3 hangingindent=3 align=left valign=middle fontfamily="Title_Font" maxlines=3 />				

					<UIFrame state=up	fill="b_g_lg01_normal.tga" />
					<UIFrame state=down	fill="b_g_lg01_pressed.tga" />
					<UIFrame state=focused	fill="b_g_lg01_pressed.tga" />
					<UIFrame state=hilited	fill="b_g_lg01_normal.tga" />
					<UIFrame state=hifocus	fill="b_g_lg01_pressed.tga" />
					<UIFrame state=disabled	fill="b_g_lg01_normal.tga" />
				</UIButton>

			</UIPane>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>			

		</UIListbox>	
		
		<UIIcon name="BACKGROUND" img="qj_paper.tga" x=0 y=175 width=PARENT_WIDTH height=202 />

	</UIPane>

	<! ---------------- END CODE FOR BESTIARY TAB -------------------------------------- >

	<!-- Background Image -->
	<UIIcon name="BACKGROUND_TOP" img="qj_top.tga" x=10 y=8 width=360 height=120 />
	<UIIcon name="BACKGROUND" img="qj_paper.tga" x=10 y=128 width=360 height=323 />
	<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 />	


#13
kevL

kevL
  • Members
  • 4 056 messages

Okay,
after bringing it to look like this:

NWN2_SS_051214_185112.jpg
http://s26.postimg.o...1214_185112.jpg

I determined that the listbox rows have only two states: up and down.

i click on one it changes to the down state. i click on a different one, that changes to the down state and the first flips back to up. And with a click off to the side all revert to the up state.


( Pastebin has the .Xml if you want to continue working with it, it might afford fresh perspective on things )



#14
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi KevL,

OK, I used that XML script you uploaded, and my results were the same ....

1) When I use the file named journal.xml and the SCREEN name was SCREEN_JOURNAL, only one button would be in the down position at any one time. (This is what I considered "GOOD" and what I was aiming for.)

2) When I changed the SCREEN name to SCREEN_JOURNAL_SMALL (so it was still journal.xml at this stage), I went back to the same problem of all the buttons remain in the "pressed down" state. (This I considered "WRONG", compared to results I get with the different SCREEN name.)

So, when you say: "i click on one it changes to the down state. i click on a different one, that changes to the down state and the first flips back to up. And with a click off to the side all revert to the up state." ... I assume that you have the SCREEN name as SCREEN_JOURNAL ... yes? If you change that to SCREEN_JOURNAL_SMALL and alter the module scripts to update that screen instead (even though it is the same journal.xml in every other respect), then the buttons will not "reset" between pushing others.

Let me know if I have misunderstood ... and if your buttons still change with the different screen name.
 
Name%20Compare.jpg

Many thanks,
Lance.



#15
kevL

kevL
  • Members
  • 4 056 messages

So, when you say: "i click on one it changes to the down state. i click on a different one, that changes to the down state and the first flips back to up. And with a click off to the side all revert to the up state." ... I assume that you have the SCREEN name as SCREEN_JOURNAL ... yes?


no i was using the exact XML i uploaded to Pastebin: SCREEN_JOURNAL_SMALL, with filename 'lance_journalsmall.xml'

+ Since those rows are being added by script, here's the call-code:
DisplayGuiScreen(oPC, "SCREEN_JOURNAL_SMALL", FALSE, "lance_journalsmall.xml");

int i = 0;
while (i < 5)
{
    string sTextField = "Row ";

    AddListBoxRow(
        oPC,
        "SCREEN_JOURNAL_SMALL",
        "BEASTLIST",                                                                  // sListBox
        "BESTIARY_OBJECT_" + IntToString(i),                                          // sRowName
//        "BESTIARY_OBJECT_TEXT=" + Get2DAString("bestiary", "Name", i),              // sTextFields
        "BESTIARY_OBJECT_TEXT=" + sTextField + IntToString(i),
//        "BESTIARY_OBJECT_IMAGE=" + Get2DAString("bestiary", "Icon", i) + ".tga",    // sTextures
        "BESTIARY_OBJECT_IMAGE=" + "align_g.tga",
        "5=" + IntToString(i),                                                        // sVariables
        "");                                                                          // sHideUnhide

    i++;
}



/coffee

#16
kevL

kevL
  • Members
  • 4 056 messages

onCoffee event :   :huh:



#17
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

no i was using the exact XML i uploaded to Pastebin: SCREEN_JOURNAL_SMALL, with filename 'lance_journalsmall.xml'

+ Since those rows are being added by script, here's the call-code:



DisplayGuiScreen(oPC, "SCREEN_JOURNAL_SMALL", FALSE, "lance_journalsmall.xml");

int i = 0;
while (i < 5)
{
    string sTextField = "Row ";

    AddListBoxRow(
        oPC,
        "SCREEN_JOURNAL_SMALL",
        "BEASTLIST",                                                                  // sListBox
        "BESTIARY_OBJECT_" + IntToString(i),                                          // sRowName
//        "BESTIARY_OBJECT_TEXT=" + Get2DAString("bestiary", "Name", i),              // sTextFields
        "BESTIARY_OBJECT_TEXT=" + sTextField + IntToString(i),
//        "BESTIARY_OBJECT_IMAGE=" + Get2DAString("bestiary", "Icon", i) + ".tga",    // sTextures
        "BESTIARY_OBJECT_IMAGE=" + "align_g.tga",
        "5=" + IntToString(i),                                                        // sVariables
        "");                                                                          // sHideUnhide

    i++;
}
/coffee


Hi KevL,

I will try the exact format/naming convention you do and let you know.

Back when done.

Cheers,
Lance.

#18
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

onCoffee event :   :huh:


Hi KevL,

Results ... The same issue .. :(

Even using the same XML script you have (named lance_journalsmall.xml) with the ONLY edit to "gui_bestiary_refresh" to "gui_bestiary_refreshxx" so it would not try to call the refresh script. I then used your script above (with the only change of oPC to oPlayer just because I had defined it that way) and I still get the buttons stay on!

Last resort ... I may see what happens if I do the same thing in a completely fresh module.

Most bizarre!

Lance.

EDIT: OH NO ... It worked in a blank new module! I suppose that's good news in many ways, but it means I now need to do some extra digging .... Many thanks for your help in this matter KevL.

If you can think of anything I may have that might be causing the problem, do let me know.

Many Thanks,
Lance.

#19
kevL

kevL
  • Members
  • 4 056 messages

am guessing you have a conflict re. an element's name="name"

 

somewhere,

 

and not necessarily the UIScene name ... might be in a script, might be in an Xml, maybe one of the .Ini's

 

 

( thinking, that button-field name, or the UIPane-proto name  ) /guess

 

Do you have any prior experimental scripts / XML / etc. still left active but forgotten about ?



#20
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

am guessing you have a conflict re. an element's name="name"
 
somewhere,
 
and not necessarily the UIScene name ... might be in a script, might be in an Xml, maybe one of the .Ini's
 
 
( thinking, that button-field name, or the UIPane-proto name  ) /guess
 
Do you have any prior experimental scripts / XML / etc. still left active but forgotten about ?


I am not aware of any of these issues ... BUT, latest update, it's down to one of 1200 campaign scripts ... which I am going through by groups now ... It's quite exciting actually. :)


Watch this space ... :0

Down to 1162 files and counting ...............
Down to 1112 files and counting ...............
Down to 707 files and counting ............... Am I using the right module ... ? :o
Down to 191 files and counting ............... Have I confused myself ... ? :o
Down to 44 files and counting ............... Double checked by moving all, so something is in this lot :o
Down to 33 files and counting ............... So close! :o
Down to 14 files and counting ............... :o

The file called to handle the button information is causing the problem ... i.e. "gui_beast_info" .. so now I will experiment some more with this.
 
#include "alb_bestiary_include"
#include "alb_functions"

void main(string sFUNCTION = "Null", string sItemTarget = "NULL")
{
object oPC = OBJECT_SELF;

if(sFUNCTION == "RECORDDATA")
{
object oCreatureTarget = StringToObject(sItemTarget);
int iAppearance = GetAppearanceType(oCreatureTarget);
object oMainPC = GetMainPC(OBJECT_SELF);

// CHECK ENTRY RECORD & UPDATE IF REQUIRED
CheckBestiaryEntry(oMainPC, iAppearance, oCreatureTarget);
}

else if (sFUNCTION != "Null") // I HAVE A NASTY FEELING THAT THIS SHOULD HAVE BEEN sItemTarget ... NO, STILL TESTING
{
SendMessageToPC(oPC,"FUNCTION DATA >>>>>>>>>>>>>>>> " + sFUNCTION);

int nBestiaryID = StringToInt(sFUNCTION);
string sName = GetBestiaryNameFromEntry(nBestiaryID);
string sImage = GetBestiaryIconFromEntry(nBestiaryID);
string sDesc = GetBestiaryDescFromEntry(nBestiaryID);

// BIG JOURNAL UPDATE
SetGUIObjectText(oPC,"SCREEN_JOURNAL","BESTIARY_TEXT1",-1,sName);
SetGUIObjectText(oPC,"SCREEN_JOURNAL","BESTIARY_TEXT2",-1,sDesc);
SetGUITexture(oPC,"SCREEN_JOURNAL","BESTIARY_IMAGE",sImage+".tga");

// SMALL JOURNAL UPDATE
SetGUIObjectText(oPC,"SCREEN_JOURNAL_SMALL","BESTIARY_TEXT1",-1,sName);
SetGUIObjectText(oPC,"SCREEN_JOURNAL_SMALL","BESTIARY_TEXT2",-1,sDesc);
SetGUITexture(oPC,"SCREEN_JOURNAL_SMALL","BESTIARY_IMAGE",sImage+".tga");
}
}
Lance.

#21
kevL

kevL
  • Members
  • 4 056 messages

... it's down to one of 1200 campaign scripts ... which I am going through by groups now ... It's quite exciting actually. :)

strangely, I know what you mean

sort of, "oooo a Problem! Let's see if I can FIX IT!!!"

sometimes it takes months.. but looks like you've got the beast caged in ....

#22
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

strangely, I know what you mean

sort of, "oooo a Problem! Let's see if I can FIX IT!!!"

sometimes it takes months.. but looks like you've got the beast caged in ....


Hi KevL,

Actually, I note that this GUI callback contains some of my old "calls" from another method and so may be the root problem all along. Hopefully, now that I know where the problem lies, it will be fixed soon. i.e. I cannot even find RECORDDATA anywhere now! ... EDIT: Yes I do, it's to do with updating when a creature is targeted ... getting there ... may take a break and come back later.

I'll let you know. :)

Cheers,
Lance.

#23
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi KevL,

Thank you for sticking at this with me and helping me to find the problem!

Once I had narrowed it down to that script, I was able to start going backwards and seeing how other errors had been hidden by its own problems. Suffice to say, I did the following:-

1) Ensured the XML GUIs sent the data in the correct order, and ...
2) Separated the two journal sizes to run their own GUI scripts.

And, the good news, the selection bars work as they should now! Yippee!

Thanks again,
Lance.

#24
4760

4760
  • Members
  • 1 204 messages

Nice work!

 

By the way, are there any tutorials (or more precisely, requirements/expectations for NWN2) about these GUIs ?



#25
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Nice work!
 
By the way, are there any tutorials (or more precisely, requirements/expectations for NWN2) about these GUIs ?


Hi 4760,

I think only myself (general NWN2 XML coding) and Sunjammer (more to do with just Listboxes) put any GUI tutorials together. If you need the links, I can post them, but they are easily available at the Vault.

I'm not quite sure what you mean by "requirements/expectations", as my knowledge is purely working knowledge only ... I kind of wrestle my way through with trial and error. ;)

EDIT: Just seen your button post. Yeh!

Lance.