Reminder: Internet Explorer 6 or below are NOT supported.





There are currently 43 users playing Freelancer on
39 servers. | January. 19, 2021 |
The Starport Forum Index
>
The Shipyard
>
Speciality Modding
>
Freelancer-related Programming
>
Infocard XML coding
Browsing this Thread:
1 Anonymous Users
Infocard XML coding |
||||
---|---|---|---|---|
Starport Admin
![]() ![]() Joined:
2009/2/21 21:42 Group:
Webmasters Registered Users
Posts:
3520
![]() |
I've been having a go at FL's XML scripting since a few days and I stumbled upon a very odd issue.
I need to understand how the TRA tag works. Basically, the TRA tags has three parameters: data, mask and ref. I have found out the syntax of data inside FLHook's manual, but the rest puzzles me. I've tried to find patterns within the different values, and I'm starting to believe either mask or ref "cancel" out the style defined by an earlier TRA tag. However, I haven't found a way to make them work. Here's a little compilation of TRA tags. <TRA data="96" mask="-32" def="-1"/> <TRA data="24" mask="24" def="-25"/> <TRA data="65280" mask="-32" def="31"/> //Red <TRA data="65281" mask="-31" def="30"/> //Bold Red <TRA data="2" mask="2" def="-3"/> //Italic <TRA data="0" mask="2" def="-1"/> //Normal <TRA data="1" mask="1" def="-2"/> //Bold <TRA data="5" mask="5" def="-6"/> //Bold underline <TRA data="3" mask="3" def="-4"/> //Bold italic I don't know what the first two do. And here's the same tags written as hex: <TRA data="0x00000060" mask="0xFFFFFFE0" def="0xFFFFFFFF"/> <TRA data="0x00000018" mask="0x00000018" def="0xFFFFFFE7"/> <TRA data="0x0000FF00" mask="0xFFFFFFE0" def="0x0000001F"/> //Red <TRA data="0x0000FF01" mask="0xFFFFFFE1" def="0x0000001E"/> //Bold Red <TRA data="0x00000002" mask="0x00000002" def="0xFFFFFFFD"/> //Italic <TRA data="0x00000000" mask="0x00000002" def="0xFFFFFFFF"/> //Normal <TRA data="0x00000001" mask="0x00000001" def="0xFFFFFFFE"/> //Bold <TRA data="0x00000005" mask="0x00000005" def="0xFFFFFFFA"/> //Bold underline <TRA data="0x00000003" mask="0x00000003" def="0xFFFFFFFC"/> //Bold italic Anybody has any further info on the matter?
Posted on: 2008/7/11 18:35
|
|||
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try." -Peggy Noonan |
||||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Starport Admin
![]() ![]() Joined:
2009/2/21 21:42 Group:
Webmasters Registered Users
Posts:
3520
![]() |
*Cough* Bump?.... ???
Posted on: 2008/7/13 3:14
|
|||
"Cynicism is not realistic and tough. It's unrealistic and kind of cowardly because it means you don't have to try." -Peggy Noonan |
||||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2008/2/10 22:00 Group:
Registered Users FLServer Admins Senior Members
Posts:
1281
![]() |
Not a clue how it works. I do know that each of the ID_Info's define a different section of what you see, some are for what you see in the ship dealer and one of them is for the what other players see when they scan your ship.
You might want to go through the following information in the link below for the MSXML format http://msdn.microsoft.com/en-us/library/ms256177(VS.85).aspx
Posted on: 2008/7/13 15:34
|
|||
Galaxy Empire Youtube Videos |
||||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2009/8/16 2:58 From Qld, Aus.
Group:
Registered Users FLServer Admins Trusted Speciality Developers Senior Members
Posts:
1958
![]() |
I would have thought there'd be more info on XML/RDL, but a search for "underline" (since "tra" and "rdl" are too small) only seemed to yield this topic. Since I've just gone through it again for my patch, here's a complete description of the TRA tag.
<TRA data="0xBGRA|<number>" mask="0xBGRA|<number>" def="0xBGRA|<number>" color="default|gray|blue|green|aqua|red|fuchsia|yellow|white|#RGB|<number>|0x<hexnumber>" font="default|<number>" bold="default|true|false" italic="default|true|false" underline="default|true|false" /> RGB is, of course, the red/green/blue component of the color, as a two-digit hex number. A is the attribute, storing the font and bold/italic/underline settings: 1 = bold, 2 = italic, 4 = underline, remaining bits are the font number (see DATA\FONTS\rich_fonts.ini; the number used by FONT is one more than this). DATA contains the new value; MASK contains the bits that should be set from DATA; DEF contains the bits that should be made default. So if we take your "bold/red" example: data="65281" (0x0000FF01) -> red + bold mask="-31" (0xFFFFFFE1) -> all color bits and the bold bit are relevant, don't change anything else def="30" (0x0000001E) -> use default font/italic/underline For my patch, I've replaced all these with the smaller strings: <TRA color="#FF0000" bold="true"/>...<TRA color="default" bold="false"/> The RGBs for the color names: gray = #808080 blue = #4848E0 green = #3BBF1D aqua = #87C3E0 red = #BF1D1D fuchsia = #8800C2 yellow = #F5EA52 white = #FFFFFF If you choose to use a number for the color, one is subtracted from it, for some reason. BTW, the complete text of all the resource files (687k; .rc files; before I made use of COLOR and FONT) can be found on my site.
Posted on: 2009/8/20 15:28
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Just popping in
![]() ![]() Joined:
2010/4/6 16:55 From New York
Group:
Registered Users
Posts:
9
![]() |
Very nice description, and makes almost complete sense to me.
I do have two questions regarding the color specification: When you say <number>, is that the numeric equivalent of the hex value used in #RGB, or is it the number that would be the color component of the data="0xBGRA" field? (I'm assuming the second, but want to verify) Similarly, when it is '0x<hexnumber>', I'm assuming that's the same thing that would be in the data field, except ignoring the last (attribute) pair? Also, Quote: If you choose to use a number for the color, one is subtracted from it, for some reason. You mean from each color individually, or from the whole number? I ask this instead of trying it myself because I'm working on an XML to HTML converter that verifies the syntax and shows what it would look like ingame in the browser, and those two are the only remaining unknowns in the script.
Posted on: 2010/5/18 2:37
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2009/8/16 2:58 From Qld, Aus.
Group:
Registered Users FLServer Admins Trusted Speciality Developers Senior Members
Posts:
1958
![]() |
Quote: When you say <number>, is that the numeric equivalent of the hex value used in #RGB, or is it the number that would be the color component of the data="0xBGRA" field? (I'm assuming the second, but want to verify) In both cases, <number> is just a straight decimal number, equivalent to the 0x number, so it does include the attribute. e.g. #010203 == 0x03020100 == 50462976. (I think, anyway.) Quote:
The number as a whole. e.g. 50462976 -> 50462975 == 0x030200FF. (Again, I think. It's just as easy for you to experiment, as for me.)
Posted on: 2010/5/18 7:09
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Just popping in
![]() ![]() Joined:
2010/4/6 16:55 From New York
Group:
Registered Users
Posts:
9
![]() |
After a week or two of work on a web-based infocard development 'application' for the Discovery dev team, I have a part of that code that I want to release to the dev community at large, and I hope that it is useful to someone.
A php class that facilitates working with XML infocards: http://cshake.homeip.net/disco/class.FreelancerXML.phps Features:
The BBCode translator works for all possible XML tags, and will produce functionally identical infocard markup when converted back and forth an unlimited number of times. The supported 'bbcode' tags are: Code: [b] [i] [u] [align=(left|right|center)] [font=(default|0-7)] [color=(#rrggbb|default|named colors)] The XML writer will use the 'pretty' human-readable color="red", bold="true" style TRA tags by default, but will also output the 'raw' data/mask/def style tags if desired. In the case of reading in a 'pretty' style infocard, the output will be identical (even if converted to bbcode and back). When reading in a 'raw' style infocard, the output will be identical if not converted to bbcode, but if it is converted the mask and default values may be slightly different, but will function identically in-game. This comes from me always masking all the color bits when a color is specified, and always masking 0xF8 when a font is specified, while 0x38 (font numbers 0-7) is usually used in the vanilla cards. The code is (I believe) fully commented and readable. Except for the use of variable-type arrays it should be easy enough to port to C/C++ if the FLDev people want to improve their 'bbcode' editor. Thank you very much to adoxa for the <TRA> explanation here! [edit]6/10/10 - did some fixes, changed the link to the latest version instead of a specific one.[/edit]
Posted on: 2010/5/24 18:14
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2009/8/16 2:58 From Qld, Aus.
Group:
Registered Users FLServer Admins Trusted Speciality Developers Senior Members
Posts:
1958
![]() |
No worries. I did miss one thing, though: TRA is Text Render Attributes, not transform (and RDL is Render Display List).
Posted on: 2010/5/25 7:53
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Just popping in
![]() ![]() Joined:
2010/8/17 9:45 Group:
Registered Users
Posts:
2
![]() |
Here's a question, how can you change info cards? Can someone explain how to change them from A to Z?
Posted on: 2010/9/26 10:16
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Just can't stay away
![]() ![]() Joined:
2010/2/2 13:57 Group:
Registered Users $$$ Supporters $$$
Posts:
351
![]() |
Use Freelancer Developer or FLEd-ids, both are self-explaining I think...
Posted on: 2010/9/26 20:08
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2009/8/16 2:58 From Qld, Aus.
Group:
Registered Users FLServer Admins Trusted Speciality Developers Senior Members
Posts:
1958
![]() |
Posted on: 2010/9/27 5:51
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Just popping in
![]() ![]() Joined:
2010/8/17 9:45 Group:
Registered Users
Posts:
2
![]() |
Tried FRC, I can't get my head around it and yes I have ran it from command line since you used that programming method.
Having a go at FLEd. Thanks for the info guys ![]()
Posted on: 2010/10/2 8:12
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Home away from home
![]() ![]() Joined:
2009/8/16 2:58 From Qld, Aus.
Group:
Registered Users FLServer Admins Trusted Speciality Developers Senior Members
Posts:
1958
![]() |
I was so pleased with FRC, yet no one seems to use it. I thought it was so simple, but perhaps not.
Code: E:\contrib\games\Freelancer\frc>type test.frc What's so hard about that?
Posted on: 2010/10/2 16:29
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Not too shy to talk
![]() ![]() Joined:
2008/3/15 16:10 Group:
Registered Users
Posts:
75
![]() |
I love your FRC adoxa its a lot easier to edit/add text then using old FLEdids.
Posted on: 2010/10/2 17:01
|
|||
|
Re: Infocard XML coding |
||||
---|---|---|---|---|
Starport Admin
![]() ![]() Joined:
2008/2/26 20:36 From Germany
Group:
Webmasters Registered Users
Posts:
1787
![]() |
adoxa, could you submit your various tools to our download section? I think they fit there better than in forum posts as attachments.
Posted on: 2010/10/2 18:21
|
|||
aka chaosgrid http://www.freelancerserver.de https://www.moddb.com/mods/fwtow |
||||
|