|
Posted by necros [99.227.132.108] on 2012/02/07 20:41:26 |
http://necros.slipgateconstruct.co... (v0.1)
This is a java program, so you must have java installed. I wrote this with the 1.7 JDK, but it doesn't use any fancy stuff, so it probably works with older versions.
to run, you must type: java -jar QDefConv ENTFile FGDFile
ENTFile: the .ent file you wish to convert
FGDFile: (optional) the file you want to write to. if nothing is specified here, it will just use the same name with the FGD extension.
This is command line only for now.
Some warnings:
+For obvious reasons, make backups of your original files. There are no overwrite checks.
+The parser isn't perfect. because of the nature of .ent files, there is no standardized way of writing definitions. As a result, the parser has to guess at a lot of things.
-It interprets texts inside " or ' as a keyval. If you don't enclose your keyvals with anything it probably won't work.
That said, it can cope with the stock .ent file for quake.
-If you follow the conventions that were used there (and even the stock defs aren't great btw...) then most stuff should parse fine.
-Sometimes you may see keyvals that are incorrect popping up in your smart edit boxes... this is just the parser getting fooled.
+Smart edit mode will not have nice labels for the keyval pairs. for example, in the stock worldcraft FGD for worldspawn, the 'sounds' key is labeled "CD track to play" in WC. With the converter, you'll just get a straight up conversion. The parser CAN understand descriptions of keys, but often the descriptions are way too long to fit in the key labels, so i opted not to try to convert those.
+There are no caught exceptions, so if something goes wrong you'll get some crash messages. If you do get some, i'd appreciate if you post them here or email me about it.
For those familiar with the .fgd format, you may see some goofy things in the generated versions. this is because the converter doesn't understand inheritance as it is used in the .fgd format yet and the .ent format has no concept of that at all.
All it does is hardcode the AppearanceFlags baseclass and makes every other entity inherit from there.
It doesn't, for example, make a Monster baseclass and have all monsters inherit from there, instead it will redefine each monster alone.
note: There are, apparently, multiple formats that share the .ent extension.
This converter only accepts the standard QuakEd definitions (plain text with block comments beginning with /*QUAKED) |
|
 |
 Ent / Def / Inheritance
#1 posted by SleepwalkR [85.178.123.199] on 2012/02/07 21:06:15
necros, def files do have a notion of inheritance, see the following which was taken directly from QuakeEd's def file:
/*QUAKED _light_style
{
choice "style"
(
(0,"normal")
(1,"flicker (first variety)")
etc, etc,
);
}
*/
/*QUAKED light (0.0 1.0 0.0) (-8 -8 -8) (8 8 8) START_OFF
{
base("_light_style");
}
Non-displayed light.
Default light value is 300
If targeted, it will toggle between on or off.
Default "style" is 0.
*/
Here, the definition "light" inherits everything from "_light_style".
 Ok,
#2 posted by necros [99.227.132.108] on 2012/02/07 21:32:18
there seems to be 3 versions of .ent files then.
this is a .ent file in QE3 (and how i remember them from GTKRadiant):
/*QUAKED light (1 1 0) (-8 -8 -8) (8 8 8) start_off
Non-displayed light. If targeted, it will toggle between on or off.
Flags:
"start_off"
starts off until triggered
Keys:
"light"
sets brightness (default: 300)
"style"
0 = normal
1 = flicker (first variety)
2 = slow strong pulse
3 = candle (first variety)
4 = fast strobe
5 = gentle pulse
6 = flicker (second variety)
7 = candle (second variety)
8 = candle (third variety)
9 = slow strobe
10 = flourescent flicker
11 = slow pulse, not fading to black
styles 32-62 are assigned by the light program for switchable lights
(default: 0)
"targetname"
entity name
"delay" sets the attenuation formulae, possible values are:
0 (default) - Linear falloff, identical to id's original light program.
1 - Use the 1/x attenuation formula, has wider range than default.
2 - Use the 1/(x*x) attenuation formula, faster falloff than delay 1.
3 - No attenuation (light stays same brightness at any distance).
4 - Local minlight (no attenuation, non-additive and minlight override).
5 - Similar to 2 but with more attenuation and never brighter than "light" value.
*/
an regular QuakEd definition is what is in the quake source code and only has rigid syntax for the first line (which describes entity size, colour, classname and flags).
the rest is just plain text.
which editor are you using that has a definition like that?
 Wow
#3 posted by Tronyn [24.79.203.208] on 2012/02/07 22:34:15
what a useful idea
 Hmm
#4 posted by SleepwalkR [85.178.123.199] on 2012/02/07 22:55:26
Actually, I took that file from ToeTag, I think. No idea where Willem got it from. I thought it was the original file!
#5 posted by necros [99.227.132.108] on 2012/02/07 23:22:21
looks like he added some extensions to it.
thanks for bringing that to my attention though. eventually, i'd like to get all formats supported and the ones that actually have some syntax are much easier to deal with (the fgd reader was very straightforward to write).
|
 |
 |
Website copyright © 2002-2011 John Fitzgibbons. All posts are copyright their respective authors.
|
|