XML file review and help

Post » Fri Feb 18, 2011 9:00 pm

I have created an XML file. But I haven't tested it yet. I'm going to use MenuQue to insert it. Does this look right:

rect name="TimeKeeper">	 105		 &true; 				 Menus\TimeKeeper\Time_Keeper_Background.dds 		 160 		 48 		 1 		 0			 0 		 255 				 3 		 		 ¢er; 		 114 		 114 		 114  		 3 		 						
2
2
0 0 255


?
All I want is the texture included in the "image" element. And in that texture will be the current date and time. I still have to figure out how to do that. I'm sure there's an OBSE or MenuQue function that will allow me to insert some text (a string -- I provided the string element, but not the actual string).
User avatar
Michael Russ
 
Posts: 3380
Joined: Thu Jul 05, 2007 3:33 am

Post » Sat Feb 19, 2011 3:00 am

Tested it, and NOPE. Doesn't display. All I want is a simple black background. And then place some text in the background. The texture is there.

EDIT:

I'm going to try MenuQue's template option. Use the message XML. Not what I want, but better than nothing.
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Sat Feb 19, 2011 1:25 am

Ah, progress! All I really need is the background texture element. Use MenuQue to insert that into the MainHUD, and BOOM! we have the black box I am looking for. Now to position it where I want it...
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Fri Feb 18, 2011 7:54 pm

Alright. Trying to figure something out. How do I get the text to be displayed inside the black box I have on the screen, where I want it?

Here's the current XML, but the text is roughly centered on the screen:

	 105		 &true; 				 Menus\TimeKeeper\Time_Keeper_Background.dds 		 300 		 100 		 1 		 1060 		 800 		 255 				 3 		 TK 		 ¢er; 		 114 		 114 		 114  		 3 		 						
2
2
255


Here's the relevant script info:

InsertXML "TimeKeeper\Time Keeper.xml" 1004SetMenuStringValue "TimeKeeper\Time_Keeper_Text\string|Hello", 1004

User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Fri Feb 18, 2011 10:25 pm

Got it working right! I'm slowly starting to get the hang of XML files, with the help of examples and the Wiki. Here's the code that works as intended, for anyone who's curious:

	 105		 &true; 	  	  	 1060 	 800 	 255 				 Menus\TimeKeeper\Time_Keeper_Background.dds 		 300 		 100 		 1 		 0 		 0 		 255 				 3 		 TK 		 ¢er; 		 114 		 114 		 114  		 3 		 			
2
2
0 0 255


Now on to the scripting...
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Fri Feb 18, 2011 7:57 pm

Better man than I there Gunga Din. :D

I get to learn this too.......
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Sat Feb 19, 2011 12:30 am

:D

That took little XML took me about three hours. I wouldn't be able to write anything complicated.
User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Fri Feb 18, 2011 11:01 pm

I'm having trouble with one thing. When I insert the string I want into the XML (the current time), and when the time changes, the last number remains in view, overwritten by the current number. And it kinda flashes. How can I correct that?

InsertXML "TimeKeeper\Time Keeper.xml" 1004SetMenuStringValue "TimeKeeper\Time_Keeper_Text\string|%z:%z" svHumanHours svHumanMinutes 1004

User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Sat Feb 19, 2011 3:29 am

The string svHumanMinutes changes every 60 seconds. So why does the previous value of the string remain on-screen? Do I need to clear that string somehow, before printing the new value that has changed after 60 seconds?
User avatar
Gracie Dugdale
 
Posts: 3397
Joined: Wed Jun 14, 2006 11:02 pm

Post » Sat Feb 19, 2011 12:54 am

do you close the window, and reopen it between changes?
User avatar
Aaron Clark
 
Posts: 3439
Joined: Fri Oct 26, 2007 2:23 pm

Post » Sat Feb 19, 2011 3:13 am

No. I'm using MenuQue to insert the XML. There is no function to remove the XML. I may have to use a variable that gets reset every time a menu string changes.

Thanks, 'ol reliable.
User avatar
emma sweeney
 
Posts: 3396
Joined: Fri Sep 22, 2006 7:02 pm

Post » Fri Feb 18, 2011 9:27 pm

What do ya think, HeyYou: What's the most efficient way to check to see if a string variable != it's previous value.

TimerIf timer ==  &&  == Set  to 1


There has to be a more efficient way. That may work, but it will result in bloated code.
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Sat Feb 19, 2011 12:12 pm

When the value changes, (or, gets initially set...) I also set a temp variable to the same value. When the time comes, I compare current, to temp, and see if they match. Not the most elegant method, but, it works.....
User avatar
stevie trent
 
Posts: 3460
Joined: Thu Oct 11, 2007 3:33 pm

Post » Sat Feb 19, 2011 1:09 am

Ah yes. Good stuff. I'll do that. Better than my timer idea.

The only problem I foresee is when the time returns to what the temp variable was set to.
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Sat Feb 19, 2011 9:36 am

If you update more than once per day, that shouldn't happen.

When you DO find a change in the variable, reset the temp value to the current value. :D They should never be the same.
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Sat Feb 19, 2011 7:51 am

Check this out, 'Ol Reliable:

If sXMLReset == 0		            InsertXML "TimeKeeper\Time Keeper.xml" 1004		            SetMenuStringValue "TimeKeeper\Time_Keeper_Text\string|%z %z:%z %z" svDayoftheWeek svHumanHours svHumanMinutes svAMPM 1004		            Let svTempMinutes := svHumanMinutes		            Set sXMLReset to 1	        EndIf		        If svTempMinutes != svHumanMinutes		            Set sXMLReset to 0	        EndIf


That doesn't work. I still get the double number overwrite problem. I haven't implemented the above post, but do you have any ideas why that doesn't work?
User avatar
Brandi Norton
 
Posts: 3334
Joined: Fri Feb 09, 2007 9:24 pm

Post » Sat Feb 19, 2011 7:54 am

Not real up on xml.... but, I wonder if moving the InsertXML statement outside the loop would fix? Seems to me, you should only have to insert that once? Is it possible that it is inserting a NEW value each time, instead of simply overwriting the old value??
User avatar
Scarlet Devil
 
Posts: 3410
Joined: Wed Aug 16, 2006 6:31 pm

Post » Fri Feb 18, 2011 8:43 pm

I suggest having a look at TheNiceOne's HUD status bars. I used that when I was learning Oblivion XML. A little hard to figure out at first, but once you start getting the hang of it, his mod is really handy. He his a section that allows you to display the game clock on screen and it works really well.
User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm

Post » Sat Feb 19, 2011 2:57 am

Not real up on xml.... but, I wonder if moving the InsertXML statement outside the loop would fix? Seems to me, you should only have to insert that once? Is it possible that it is inserting a NEW value each time, instead of simply overwriting the old value??


Yeah, could be. I'll insert the XML once, and only make changes to the variables.

I suggest having a look at TheNiceOne's HUD status bars. I used that when I was learning Oblivion XML. A little hard to figure out at first, but once you start getting the hang of it, his mod is really handy. He his a section that allows you to display the game clock on screen and it works really well.


Ah yes. I have a couple mods that display the in-game time. I'll check those out. TNO's HUDSB first. He is a good scripter.
User avatar
Allison C
 
Posts: 3369
Joined: Mon Dec 18, 2006 11:02 am

Post » Fri Feb 18, 2011 8:54 pm

I couldn't find anything in HUD SB specific to the clock. I checked HUD Improved by forli, and the only thing he did different than I is set the string in the XML that displays the clock to a value ("_currtime", to be exact). I don't see how that will make a difference, but I'm quite the noob...

I'll emulate what forli did and see if that helps.
User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Sat Feb 19, 2011 7:14 am

Nope. Copying most of what forli did for HUD Improved didn't help. It's a problem with the "InsertXML" function from MenuQue. I'll try just OBSE functions and see if that helps.
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Sat Feb 19, 2011 4:16 am

I would have to add the new XML to the main HUD XML manually for that to work. Using "InsertXML" is easier, I just have to figure out how to erase the old string value and insert the new one when the time changes.
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm

Post » Fri Feb 18, 2011 11:57 pm

Success!! It was the "InsertXML" function. All I had to do was set it to insert once (which I used a short for, but I may change it to GetGameLoaded, because Oblivion processes it so quickly, it doesn't give the XML time to fully load, so the background is faded), and BAM! the time display no longer shows two numbers when changing.

Shout out to 'Ol Reliable.
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Fri Feb 18, 2011 9:56 pm

I'm trying to work out a kink before I move on. The background texture does not fully load unless I specify for the XML to get inserted more than once. But if I insert the XML more than once, the time gets screwed up. So, that's not an option.

My question is: can I use "SetMenuStringValue" on the "filename" trait, to kind of reload the background texture?
User avatar
Sophie Morrell
 
Posts: 3364
Joined: Sat Aug 12, 2006 11:13 am


Return to IV - Oblivion