9 open my $fh, '<', '../../xonotic-data.pk3dir/qcsrc/server/qc.asm'
10 or die "must have qc.asm in server qc";
14 if(/^\.(\w+) (\w+);$/)
22 $types{$2} = "string";
32 $types{angle} = "direction";
33 $types{angles} = "angles";
34 $types{_color} = "color";
35 $types{colormod} = "color";
36 $types{killtarget} = "target";
37 $types{model2} = "model";
38 $types{model} = "model";
39 $types{noise} = "sound";
40 $types{noise1} = "sound";
41 $types{noise2} = "sound";
42 $types{noise3} = "sound";
43 $types{target2} = "target";
44 $types{target3} = "target";
45 $types{target4} = "target";
46 $types{targetname} = "targetname";
47 $types{target} = "target";
48 $types{team} = "integer";
50 # missing definition in QC, q3map2 only
51 $types{_ambient} = "real";
52 $types{_anglescale} = "real";
53 $types{author} = "string";
54 $types{_blocksize} = "integer3";
55 $types{_castshadows} = "boolean";
56 $types{_celshader} = "texture";
57 $types{_clonename} = "targetname";
58 $types{_clone} = "target";
59 $types{_description} = "string";
60 $types{_deviance} = "real";
61 $types{fade} = "real";
62 $types{_farplanedist} = "real";
63 $types{_filterradius} = "real";
64 $types{_floodlight} = "string";
65 $types{_frame} = "real";
66 $types{gridsize} = "integer3";
67 $types{_ignoreleaks} = "boolean";
68 $types{_indexmap} = "texture";
69 $types{key1} = "string";
70 $types{key2} = "string";
71 $types{_layers} = "integer";
72 $types{_lightmapscale} = "real";
73 $types{light} = "real";
74 $types{max} = "real3";
75 $types{_mingridlight} = "real";
76 $types{_minlight} = "real";
77 $types{min} = "real3";
78 $types{modelscale_vec} = "real3";
79 $types{_noshadersun} = "boolean";
80 $types{_offsets} = "string";
81 $types{_receiveshadows} = "boolean";
82 $types{_remap} = "array";
83 $types{_samples} = "integer";
84 $types{_scale} = "real";
85 $types{_shader} = "texture";
86 $types{_sun} = "boolean";
89 # angle specialisation of real - Yaw angle
90 # angles specialisation of real3 - Pitch Yaw Roll
91 # array an array of strings - value is a semi-colon-delimited string
92 # boolean an integer - shows as a checkbox - true = non-zero
93 # color specialisation of real3 - RGB floating-point colour
94 # direction specialisation of real - Yaw angle, -1 = down, -2 = up
95 # integer2 two integer values
96 # integer3 three integer values
97 # integer an integer value
98 # model the VFS path to a model file
99 # skin the VFS path to a skin file
100 # sound the VFS path to a sound file
101 # target a string that uniquely identifies an entity or group of entities
102 # targetname a string that uniquely identifies an entity or group of entities
103 # texture the VFS path to a texture file or a shader name
107 <?xml version="1.0"?>
121 if(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) ?(.*)/)
124 print "<point name=\"$1\" color=\"$2\" box=\"$3 $4\">\n";
125 $closetag = "</point>";
126 @spawnflags = split / /, $5;
128 elsif(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \? ?(.*)/)
131 print "<group name=\"$1\" color=\"$2\">\n";
132 $closetag = "</group>";
133 @spawnflags = split / /, $3;
139 elsif(/^([0-9a-z_]*): +(.*)/)
141 my $type = $types_override{$class}{$1} || $types{$1};
142 warn "No type for $1"
143 if not defined $type;
144 print "<$type key=\"$1\" name=\"$1\">$2</$type>\n";
146 elsif(/^([0-9A-Z_]*): +(.*)/)
148 my $bit = [grep { $spawnflags[$_] eq $1; } 0..@spawnflags-1]->[0];
149 warn "Cannot find bit $1 in @spawnflags\n"
151 print "<flag key=\"$1\" name=\"$1\" bit=\"$bit\">$2</flag>\n";