Thread: XML Tutorial?
View Single Post
Old 07-29-2002, 11:55 AM   #3
Kalthanan
A Hill Giant
 
Join Date: Jul 2002
Server: Cazic Thule
Posts: 34
Post XML Tutorial

Basically, the way XML is used in the EQ UI files, it's just a tiered config file, with open and close tags to define the areas.

What happens in the XML file is something along these lines:
1. Define standard stuff, like the schema (we don't have access to a list of these or a way to change them, so we have to ignore it for now), XML version, and XML ID.. just ignore this stuff.
2. Define the pieces (gauges, labels)
3. Define the window
4. List the pieces (gauges, labels)
5. Close the XML tag.

Code:
<?xml version = "1.0"?> <XML ID="EQInterfaceDefinitionLanguage"> <Schema xmlns="EverQuestData" xmlns:dt="EverQuestDataTypes"/> <Gauge item="Player_HP"> <ScreenID>PlayerHP</ScreenID> <!--<Font>3</Font>--> <TextColor> <R>240</R> <G>240</G> <B>240</B> </TextColor> <RelativePosition>true</RelativePosition> <Location> <X>3</X> <Y>0</Y> </Location> <Size> <CX>108</CX> <CY>41</CY> </Size> <TextOffsetX>8</TextOffsetX> <GaugeOffsetY>33</GaugeOffsetY> <Style_VScroll>false</Style_VScroll> <Style_HScroll>false</Style_HScroll> <Style_Transparent>false</Style_Transparent> <!--<TooltipReference/>--> <FillTint> <R>240</R> <G>0</G> <B>0</B> </FillTint> <LinesFillTint> <R>220</R> <G>220</G> <B>0</B> </LinesFillTint> <DrawLinesFill>false</DrawLinesFill> <!--<EQType>1</EQType> used to display player name JKH --> <GaugeDrawTemplate> <Background>A_GaugeBackground</Background> <Fill>A_GaugeFill</Fill> <Lines>A_GaugeLines</Lines> <LinesFill>A_GaugeLinesFill</LinesFill> <EndCapLeft>A_GaugeEndCapLeft</EndCapLeft> <EndCapRight>A_GaugeEndCapRight</EndCapRight> </GaugeDrawTemplate> </Gauge> <Screen item="PlayerWindow"> <!--<ScreenID/>--> <RelativePosition>false</RelativePosition> <Location> <X>130</X> <Y>260</Y> </Location> <Size> <CX>124</CX> <CY>96</CY> </Size> <Text>Player</Text> <Style_VScroll>false</Style_VScroll> <Style_HScroll>false</Style_HScroll> <Style_Transparent>false</Style_Transparent> <TooltipReference>The Breath Meter</TooltipReference> <DrawTemplate>WDT_RoundedNoTitle</DrawTemplate> <Style_Titlebar>false</Style_Titlebar> <Style_Closebox>false</Style_Closebox> <Style_Minimizebox>false</Style_Minimizebox> <Style_Border>true</Style_Border> <Style_Sizable>false</Style_Sizable> <Pieces>Player_HP</Pieces> <Pieces>Pet_HP</Pieces> <Pieces>Player_HPNumber</Pieces> <Pieces>Player_Mana</Pieces> <Pieces>Player_ManaPercent</Pieces> <Pieces>Player_Fatigue</Pieces> <Pieces>Player_ExpGauge</Pieces> <Pieces>Player_XPPercent</Pieces> <Pieces>Player_NextLevelSign</Pieces> <Pieces>Player_AltAdvGauge</Pieces> <Pieces>Player_AAXPPercent</Pieces> <Pieces>Player_AANextLevelSign</Pieces> </Screen> </XML>


The listing I have here is a stripped down version of the Player window. I took out all the "pieces" except the player's hit points. If you look at the code between

Code:
<Gauge item> and </Gauge>

you'll see everything that defines how the Player Hit Points gauge works. The tags are pretty descriptive, and are best left as an exercise for the reader to figure out.

Then we get to

Code:
<Screen item=PlayerWindow>

This actually defines the window itself (transparency, size, default location, window type, whether or not it should have scrollbars, etc. Then it lists the pieces you defined earlier in the code. Then it closes the Screen tag and closes the XML tag, and you're done.

A couple rules you have to remember;
1. There are quirks in the way EQ reads these files; get used to crashing out if you do a lot of modding and experimenting.
2. For those of you who don't like to use third party programs to modify your skin while you're online, you can set up a second PC on your LAN and share your UI files directory and edit the files remotely, then reload the skin and zone to update the skin.
3. Some of the windows REQUIRE certain pieces be present. You can strip them so that they don't display anything by removing everything between the defining tags, but be aware of this.
4. Displaying more than one of the same tag (ie, the player hit points label -- people like to put that on their player window in addition to their inventory window) results in one of them not working anymore. For some reason EQ can't tolerate redundant labels.

Whew! Anyway, hope this helps.

Kal
Kalthanan is offline   Reply With Quote