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} = "integer";
66 $types{_skin} = "integer";
67 $types{gridsize} = "integer3";
68 $types{_ignoreleaks} = "boolean";
69 $types{_indexmap} = "texture";
70 $types{key1} = "string";
71 $types{key2} = "string";
72 $types{_layers} = "integer";
73 $types{_lightmapscale} = "real";
74 $types{light} = "real";
75 $types{max} = "real3";
76 $types{_mingridlight} = "real";
77 $types{_minlight} = "real";
78 $types{min} = "real3";
79 $types{modelscale_vec} = "real3";
80 $types{_noshadersun} = "boolean";
81 $types{_offsets} = "string";
82 $types{_receiveshadows} = "boolean";
83 $types{_remap} = "array";
84 $types{_samples} = "integer";
85 $types{_scale} = "real";
86 $types{_shader} = "texture";
87 $types{_sun} = "boolean";
90 # angle specialisation of real - Yaw angle
91 # angles specialisation of real3 - Pitch Yaw Roll
92 # array an array of strings - value is a semi-colon-delimited string
93 # boolean an integer - shows as a checkbox - true = non-zero
94 # color specialisation of real3 - RGB floating-point colour
95 # direction specialisation of real - Yaw angle, -1 = down, -2 = up
96 # integer2 two integer values
97 # integer3 three integer values
98 # integer an integer value
99 # model the VFS path to a model file
100 # skin the VFS path to a skin file
101 # sound the VFS path to a sound file
102 # target a string that uniquely identifies an entity or group of entities
103 # targetname a string that uniquely identifies an entity or group of entities
104 # texture the VFS path to a texture file or a shader name
108 <?xml version="1.0"?>
122 if(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) ?(.*)/)
125 print "<point name=\"$1\" color=\"$2\" box=\"$3 $4\">\n";
126 $closetag = "</point>";
127 @spawnflags = split / /, $5;
129 elsif(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \? ?(.*)/)
132 print "<group name=\"$1\" color=\"$2\">\n";
133 $closetag = "</group>";
134 @spawnflags = split / /, $3;
140 elsif(/^([0-9a-z_]*): +(.*)/)
142 my $type = $types_override{$class}{$1} || $types{$1};
143 warn "No type for $1"
144 if not defined $type;
145 print "<$type key=\"$1\" name=\"$1\">$2</$type>\n";
147 elsif(/^([0-9A-Z_]*): +(.*)/)
149 my $bit = [grep { $spawnflags[$_] eq $1; } 0..@spawnflags-1]->[0];
150 warn "Cannot find bit $1 in @spawnflags\n"
152 print "<flag key=\"$1\" name=\"$1\" bit=\"$bit\">$2</flag>\n";