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";
49 $types{target_random} = "boolean";
51 # missing definition in QC, q3map2 only
52 $types{_ambient} = "real";
53 $types{_anglescale} = "real";
54 $types{author} = "string";
55 $types{_blocksize} = "integer3";
56 $types{_castshadows} = "boolean";
57 $types{_celshader} = "texture";
58 $types{_clonename} = "targetname";
59 $types{_clone} = "target";
60 $types{_description} = "string";
61 $types{_deviance} = "real";
62 $types{fade} = "real";
63 $types{_farplanedist} = "real";
64 $types{_filterradius} = "real";
65 $types{_floodlight} = "string";
66 $types{_frame} = "integer";
67 $types{_skin} = "integer";
68 $types{gridsize} = "integer3";
69 $types{_ignoreleaks} = "boolean";
70 $types{_indexmap} = "texture";
71 $types{key1} = "string";
72 $types{key2} = "string";
73 $types{_layers} = "integer";
74 $types{_lightmapscale} = "real";
75 $types{light} = "real";
76 $types{max} = "real3";
77 $types{_mingridlight} = "real";
78 $types{_minlight} = "real";
79 $types{min} = "real3";
80 $types{modelscale_vec} = "real3";
81 $types{_noshadersun} = "boolean";
82 $types{_offsets} = "string";
83 $types{_receiveshadows} = "boolean";
84 $types{_remap} = "array";
85 $types{_samples} = "integer";
86 $types{_scale} = "real";
87 $types{_shader} = "texture";
88 $types{_sun} = "boolean";
91 # angle specialisation of real - Yaw angle
92 # angles specialisation of real3 - Pitch Yaw Roll
93 # array an array of strings - value is a semi-colon-delimited string
94 # boolean an integer - shows as a checkbox - true = non-zero
95 # color specialisation of real3 - RGB floating-point colour
96 # direction specialisation of real - Yaw angle, -1 = down, -2 = up
97 # integer2 two integer values
98 # integer3 three integer values
99 # integer an integer value
100 # model the VFS path to a model file
101 # skin the VFS path to a skin file
102 # sound the VFS path to a sound file
103 # target a string that uniquely identifies an entity or group of entities
104 # targetname a string that uniquely identifies an entity or group of entities
105 # texture the VFS path to a texture file or a shader name
109 <?xml version="1.0"?>
123 if(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) \((\S+ \S+ \S+)\) ?(.*)/)
126 print "<point name=\"$1\" color=\"$2\" box=\"$3 $4\">\n";
127 $closetag = "</point>";
128 @spawnflags = split / /, $5;
130 elsif(/^\/\*QUAKED (\S+) \((\S+ \S+ \S+)\) \? ?(.*)/)
133 print "<group name=\"$1\" color=\"$2\">\n";
134 $closetag = "</group>";
135 @spawnflags = split / /, $3;
141 elsif(/^([0-9a-z_]*): +(.*)/)
143 my $type = $types_override{$class}{$1} || $types{$1};
144 warn "No type for $1"
145 if not defined $type;
146 print "<$type key=\"$1\" name=\"$1\">$2</$type>\n";
148 elsif(/^([0-9A-Z_]*): +(.*)/)
150 my $bit = [grep { $spawnflags[$_] eq $1; } 0..@spawnflags-1]->[0];
151 warn "Cannot find bit $1 in @spawnflags\n"
153 print "<flag key=\"$1\" name=\"$1\" bit=\"$bit\">$2</flag>\n";