1 | ///////////////////////////////////////////////////////////////////////////////
|
---|
2 | //
|
---|
3 | // ## ######
|
---|
4 | // ###### ###
|
---|
5 | // ## ############### Shark 3D Engine (www.shark3d.com)
|
---|
6 | // ########## # # #
|
---|
7 | // ######## Copyright (c) 1996-2006 Spinor GmbH.
|
---|
8 | // ######### # # # All rights reserved.
|
---|
9 | // ## ##########
|
---|
10 | // ##
|
---|
11 | //
|
---|
12 | ///////////////////////////////////////////////////////////////////////////////
|
---|
13 |
|
---|
14 | // Definition of the player.
|
---|
15 | //
|
---|
16 | // In this case, the player is a player having a walk collision detection
|
---|
17 | // and can be controlled by the human player.
|
---|
18 | //
|
---|
19 | // The player is not defined directly, but only a suppl for the player.
|
---|
20 | // The reason for this is that not only one player must be created,
|
---|
21 | // but a new player for every player which logs into the server.
|
---|
22 | // As long as no client logs into a server, no player is created.
|
---|
23 | // Each time a player logs into the server, the player suppl
|
---|
24 | // is used to create a player.
|
---|
25 |
|
---|
26 |
|
---|
27 | // Since each dsc-file formally can only contain a single actor,
|
---|
28 | // we use the group actor to define more than one actor.
|
---|
29 | actor_ident "kit_base.group"
|
---|
30 | actor_param
|
---|
31 | {
|
---|
32 | // Delegate action calls to the children.
|
---|
33 | active 1
|
---|
34 | child_array
|
---|
35 | {
|
---|
36 | // This dispatcher dispatches commands coming
|
---|
37 | // from outside the capsule.
|
---|
38 | ident "kit_base.dispatch"
|
---|
39 | param
|
---|
40 | {
|
---|
41 | name "dispatch_export"
|
---|
42 | entry_array
|
---|
43 | // notice_destroy the player:
|
---|
44 | {
|
---|
45 | cmds "destroy"
|
---|
46 | targets "motionserver"
|
---|
47 | newcmd "disable_pos"
|
---|
48 | }
|
---|
49 | {
|
---|
50 | cmds "destroy"
|
---|
51 | targets "capsule"
|
---|
52 | }
|
---|
53 | {
|
---|
54 | cmds "net_traverse"
|
---|
55 | targets "group_player"
|
---|
56 | newcmd "traverse"
|
---|
57 | }
|
---|
58 | {
|
---|
59 | cmds "net_appear"
|
---|
60 | targets "reproduce"
|
---|
61 | newcmd "rework"
|
---|
62 | }
|
---|
63 | // Inform management:
|
---|
64 | {
|
---|
65 | // Store the inform-actor in "inform":
|
---|
66 | cmds "assign_inform" "set_inform"
|
---|
67 | targets "inform_deleg"
|
---|
68 | newcmd "set_deleg_target"
|
---|
69 | }
|
---|
70 | {
|
---|
71 | // Delegate the inform command:
|
---|
72 | cmds "assign_inform" "set_inform"
|
---|
73 | targets "informanswer"
|
---|
74 | "oninform_gfxmgr" "oninform_sndmgr"
|
---|
75 | "oninform_world" "oninform_sky"
|
---|
76 | "oninform_sim"
|
---|
77 | "oninform_noise"
|
---|
78 | "oninform_sensorstate"
|
---|
79 | "oninform_maincamera"
|
---|
80 | "maininform_switch"
|
---|
81 | }
|
---|
82 | {
|
---|
83 | cmds "search_inform" "search_noinform"
|
---|
84 | targets "informanswer"
|
---|
85 | }
|
---|
86 | {
|
---|
87 | // Set the position of the player.
|
---|
88 | cmds "set_transf"
|
---|
89 | targets "scene_root"
|
---|
90 | }
|
---|
91 | {
|
---|
92 | cmds "add_motion"
|
---|
93 | targets "player_deleg" "godplayer_deleg"
|
---|
94 | }
|
---|
95 | {
|
---|
96 | cmds "add_motion_to_gear"
|
---|
97 | targets "gear"
|
---|
98 | newcmd "add_gear_motion"
|
---|
99 | }
|
---|
100 | {
|
---|
101 | cmds "god"
|
---|
102 | targets "god_switch"
|
---|
103 | newcmd "toggle_switch"
|
---|
104 | }
|
---|
105 | }
|
---|
106 | }
|
---|
107 | {
|
---|
108 | ident "kit_base.dispatch"
|
---|
109 | param
|
---|
110 | {
|
---|
111 | name "dispatch"
|
---|
112 | entry_array
|
---|
113 | {
|
---|
114 | // Disable god mode:
|
---|
115 | cmds "disable_god"
|
---|
116 | targets "maininform_switch"
|
---|
117 | newcmd "select_normalmode"
|
---|
118 | }
|
---|
119 | {
|
---|
120 | // Disable godmode.
|
---|
121 | cmds "disable_god"
|
---|
122 | targets "player_deleg_actor"
|
---|
123 | newcmd "enable"
|
---|
124 | }
|
---|
125 | {
|
---|
126 | // Disable godmode.
|
---|
127 | cmds "disable_god"
|
---|
128 | targets "godplayer_deleg_actor"
|
---|
129 | newcmd "disable"
|
---|
130 | }
|
---|
131 | {
|
---|
132 | // Disable godmode.
|
---|
133 | cmds "disable_god"
|
---|
134 | targets "godctrl"
|
---|
135 | newcmd "god_to_player"
|
---|
136 | }
|
---|
137 | {
|
---|
138 | // Disable godmode.
|
---|
139 | cmds "disable_god"
|
---|
140 | targets "scene_root"
|
---|
141 | newcmd "activate_body"
|
---|
142 | }
|
---|
143 | {
|
---|
144 | // Enable godmode.
|
---|
145 | cmds "enable_god"
|
---|
146 | targets "maininform_switch"
|
---|
147 | newcmd "select_godmode"
|
---|
148 | }
|
---|
149 | {
|
---|
150 | // Enable godmode.
|
---|
151 | cmds "enable_god"
|
---|
152 | targets "player_deleg_actor"
|
---|
153 | newcmd "disable"
|
---|
154 | }
|
---|
155 | {
|
---|
156 | // Enable godmode.
|
---|
157 | cmds "enable_god"
|
---|
158 | targets "godplayer_deleg_actor"
|
---|
159 | newcmd "enable"
|
---|
160 | }
|
---|
161 | {
|
---|
162 | // Enable godmode.
|
---|
163 | cmds "enable_god"
|
---|
164 | targets "godctrl"
|
---|
165 | newcmd "player_to_god"
|
---|
166 | }
|
---|
167 | }
|
---|
168 | }
|
---|
169 | {
|
---|
170 | ident "kit_base.deleg"
|
---|
171 | param
|
---|
172 | {
|
---|
173 | name "inform_deleg"
|
---|
174 | deleg_name "inform"
|
---|
175 | deleg_target ""
|
---|
176 | allow_no_target 1
|
---|
177 | enabled 1
|
---|
178 | }
|
---|
179 | }
|
---|
180 | {
|
---|
181 | ident "kit_engobj.informanswer"
|
---|
182 | param
|
---|
183 | {
|
---|
184 | name "informanswer"
|
---|
185 | answer_cmd "add_result"
|
---|
186 | answer_actor "capsule_deleg"
|
---|
187 | }
|
---|
188 | }
|
---|
189 | {
|
---|
190 | ident "kit_base.switch"
|
---|
191 | param
|
---|
192 | {
|
---|
193 | name "god_switch"
|
---|
194 | target "dispatch"
|
---|
195 | disable_switch_cmd "disable_god"
|
---|
196 | enable_switch_cmd "enable_god"
|
---|
197 | }
|
---|
198 | }
|
---|
199 | {
|
---|
200 | ident "kit_engobj.itemeye"
|
---|
201 | param
|
---|
202 | {
|
---|
203 | name "scene_root"
|
---|
204 | item_actor "group_player"
|
---|
205 | item_name "body:scene_root"
|
---|
206 | }
|
---|
207 | }
|
---|
208 | {
|
---|
209 | ident "kit_engobj.itemeye"
|
---|
210 | param
|
---|
211 | {
|
---|
212 | name "camera"
|
---|
213 | item_actor "group_player"
|
---|
214 | item_name "simplepos:camera"
|
---|
215 | }
|
---|
216 | }
|
---|
217 | {
|
---|
218 | ident "kit_engobj.itemeye"
|
---|
219 | param
|
---|
220 | {
|
---|
221 | name "playerbody"
|
---|
222 | item_actor "group_player"
|
---|
223 | item_name "body:scene_root"
|
---|
224 | }
|
---|
225 | }
|
---|
226 | {
|
---|
227 | ident "kit_engobj.itemeye"
|
---|
228 | param
|
---|
229 | {
|
---|
230 | name "gear"
|
---|
231 | item_actor "group_player"
|
---|
232 | item_name "gear:gear"
|
---|
233 | }
|
---|
234 | }
|
---|
235 | {
|
---|
236 | ident "kit_base.obj"
|
---|
237 | param
|
---|
238 | {
|
---|
239 | // Create the position of the godplayer
|
---|
240 | // (spawn at (0,0,0) for now).
|
---|
241 | name "god_vehicleobj"
|
---|
242 | obj_suppl "^stdsuppl"
|
---|
243 | obj_ident "simplepos:"
|
---|
244 | obj_param
|
---|
245 | {
|
---|
246 | env "^^env"
|
---|
247 | }
|
---|
248 | }
|
---|
249 | }
|
---|
250 | {
|
---|
251 | // Select the position of the godmode-player
|
---|
252 | // (we want the position, not the wrapping actor,
|
---|
253 | // so "unwrap" it).
|
---|
254 | ident "kit_engobj.itemeye"
|
---|
255 | param
|
---|
256 | {
|
---|
257 | name "god_vehicle"
|
---|
258 | item_actor "god_vehicleobj"
|
---|
259 | item_name ""
|
---|
260 | }
|
---|
261 | }
|
---|
262 | {
|
---|
263 | // Create a camera-position for the godmode-player
|
---|
264 | // mounted on the godmode-player's position
|
---|
265 | // (i.e. camera moves relatively to player-position).
|
---|
266 | ident "kit_base.obj"
|
---|
267 | param
|
---|
268 | {
|
---|
269 | name "god_camobj"
|
---|
270 | obj_suppl "^stdsuppl"
|
---|
271 | obj_ident "simplepos:"
|
---|
272 | obj_param
|
---|
273 | {
|
---|
274 | env "^^env"
|
---|
275 | parent "god_vehicle"
|
---|
276 | }
|
---|
277 | }
|
---|
278 | }
|
---|
279 | {
|
---|
280 | // Select the position of the godmode-camera
|
---|
281 | // (we want the position, not the wrapping actor,
|
---|
282 | // so "unwrap" it).
|
---|
283 | ident "kit_engobj.itemeye"
|
---|
284 | param
|
---|
285 | {
|
---|
286 | name "god_cam"
|
---|
287 | //item_actor "^god_spawn"
|
---|
288 | item_actor "god_camobj"
|
---|
289 | item_name ""
|
---|
290 | }
|
---|
291 | }
|
---|
292 | {
|
---|
293 | // The godplayer moves different than the normal player
|
---|
294 | // so pass the movement to this godmode-control actor.
|
---|
295 | ident "kit_engobj.godctrl"
|
---|
296 | param
|
---|
297 | {
|
---|
298 | active 1
|
---|
299 | name "godctrl"
|
---|
300 | move_dir 0.0 1.0 0.0
|
---|
301 | move_also 1.0 0.0 0.0
|
---|
302 | cam_dir 0.0 0.0 1.0
|
---|
303 | cam_also 1.0 0.0 0.0
|
---|
304 | god_vehicle "god_vehicle"
|
---|
305 | god_cam "god_cam"
|
---|
306 | player_vehicle "playerbody"
|
---|
307 | player_cam "camera"
|
---|
308 | }
|
---|
309 | }
|
---|
310 | {
|
---|
311 | ident "kit_engobj.motionlook"
|
---|
312 | param
|
---|
313 | {
|
---|
314 | name "motionlook"
|
---|
315 | look_actor "camera"
|
---|
316 | look_target "camera"
|
---|
317 | look_get_cmd "get_transf"
|
---|
318 | look_set_cmd "set_transf"
|
---|
319 | other_target "dispatch_export"
|
---|
320 | other_cmd "add_motion_to_gear"
|
---|
321 | axis 1.0 0.0 0.0
|
---|
322 | min_angle -170.0
|
---|
323 | max_angle -10.0
|
---|
324 | }
|
---|
325 | }
|
---|
326 | {
|
---|
327 | ident "kit_engobj.motionlook"
|
---|
328 | param
|
---|
329 | {
|
---|
330 | name "godmotionlook"
|
---|
331 | look_actor "god_cam"
|
---|
332 | look_target "god_cam"
|
---|
333 | look_get_cmd "get_transf"
|
---|
334 | look_set_cmd "set_transf"
|
---|
335 | other_target "godctrl"
|
---|
336 | other_cmd "add_motion"
|
---|
337 | axis 1.0 0.0 0.0
|
---|
338 | min_angle -170.0
|
---|
339 | max_angle -10.0
|
---|
340 | }
|
---|
341 | }
|
---|
342 | {
|
---|
343 | ident "kit_base.deleg"
|
---|
344 | param
|
---|
345 | {
|
---|
346 | name "player_deleg_actor"
|
---|
347 | deleg_name "player_deleg"
|
---|
348 | deleg_target "motionlook"
|
---|
349 | enabled 1
|
---|
350 | allow_no_target 1
|
---|
351 | }
|
---|
352 | }
|
---|
353 | {
|
---|
354 | ident "kit_base.deleg"
|
---|
355 | param
|
---|
356 | {
|
---|
357 | name "godplayer_deleg_actor"
|
---|
358 | deleg_name "godplayer_deleg"
|
---|
359 | deleg_target "godmotionlook"
|
---|
360 | enabled 0
|
---|
361 | allow_no_target 1
|
---|
362 | }
|
---|
363 | }
|
---|
364 | {
|
---|
365 | ident "kit_engobj.oninform"
|
---|
366 | param
|
---|
367 | {
|
---|
368 | // Tell the client about performing
|
---|
369 | // the level change.
|
---|
370 | name "oninform_changelevel"
|
---|
371 | cmd "changelevel_perform"
|
---|
372 | }
|
---|
373 | }
|
---|
374 | {
|
---|
375 | ident "kit_engobj.oninformobj"
|
---|
376 | param
|
---|
377 | {
|
---|
378 | name "oninform_gfxmgr"
|
---|
379 | cmd "set_gfxmgr_level"
|
---|
380 | param "^gfxmgr"
|
---|
381 | }
|
---|
382 | }
|
---|
383 | {
|
---|
384 | ident "kit_engobj.oninformobj"
|
---|
385 | param
|
---|
386 | {
|
---|
387 | name "oninform_sndmgr"
|
---|
388 | cmd "set_sndmgr_level"
|
---|
389 | param "^sndmgr"
|
---|
390 | }
|
---|
391 | }
|
---|
392 | {
|
---|
393 | ident "kit_engobj.oninformobj"
|
---|
394 | param
|
---|
395 | {
|
---|
396 | name "oninform_world"
|
---|
397 | cmd "set_state_world"
|
---|
398 | param "^state_world"
|
---|
399 | }
|
---|
400 | }
|
---|
401 | {
|
---|
402 | ident "kit_engobj.oninformobj"
|
---|
403 | param
|
---|
404 | {
|
---|
405 | name "oninform_sky"
|
---|
406 | cmd "set_state_sky"
|
---|
407 | param "^state_sky"
|
---|
408 | }
|
---|
409 | }
|
---|
410 | {
|
---|
411 | ident "kit_engobj.oninformobj"
|
---|
412 | param
|
---|
413 | {
|
---|
414 | name "oninform_sim"
|
---|
415 | cmd "set_sim_world"
|
---|
416 | param "^sim_world"
|
---|
417 | }
|
---|
418 | }
|
---|
419 | {
|
---|
420 | ident "kit_engobj.oninformobj"
|
---|
421 | param
|
---|
422 | {
|
---|
423 | name "oninform_noise"
|
---|
424 | cmd "set_noise_world"
|
---|
425 | param "^noise_world"
|
---|
426 | }
|
---|
427 | }
|
---|
428 | {
|
---|
429 | ident "kit_engobj.oninformobj"
|
---|
430 | param
|
---|
431 | {
|
---|
432 | name "oninform_sensorstate"
|
---|
433 | cmd "set_sensorstate_world"
|
---|
434 | param "^sensorstate_world"
|
---|
435 | }
|
---|
436 | }
|
---|
437 | {
|
---|
438 | ident "kit_engobj.oninformobj"
|
---|
439 | param
|
---|
440 | {
|
---|
441 | name "oninform_maincamera"
|
---|
442 | cmd "set_camera"
|
---|
443 | param "camera"
|
---|
444 | }
|
---|
445 | }
|
---|
446 | {
|
---|
447 | ident "kit_engobj.oninformobj"
|
---|
448 | param
|
---|
449 | {
|
---|
450 | name "oninform_godcamera"
|
---|
451 | cmd "set_camera"
|
---|
452 | param "god_cam"
|
---|
453 | }
|
---|
454 | }
|
---|
455 | {
|
---|
456 | // This actor is used to switch between the main
|
---|
457 | // camera and the test camera.
|
---|
458 | // This actor switches between different actors
|
---|
459 | // which get the "assign_inform" or "set_inform"
|
---|
460 | // command with the current inform-actor, whereas
|
---|
461 | // all other disabled actors get a "assign_inform" or
|
---|
462 | // "set_inform" with 0 as argument.
|
---|
463 | ident "kit_engobj.oninformswitch"
|
---|
464 | param
|
---|
465 | {
|
---|
466 | name "maininform_switch"
|
---|
467 | deleg_name "maininform"
|
---|
468 | target "oninform_maincamera"
|
---|
469 | entry_array
|
---|
470 | {
|
---|
471 | cmd "select_godmode"
|
---|
472 | target "oninform_godcamera"
|
---|
473 | }
|
---|
474 | {
|
---|
475 | cmd "select_normalmode"
|
---|
476 | target "oninform_maincamera"
|
---|
477 | }
|
---|
478 | }
|
---|
479 | }
|
---|
480 | {
|
---|
481 | ident "kit_engobj.itemeye"
|
---|
482 | param
|
---|
483 | {
|
---|
484 | name "sensortrig_pos"
|
---|
485 | item_actor "group_player"
|
---|
486 | item_name "simplepos:sensortrig"
|
---|
487 | }
|
---|
488 | }
|
---|
489 | {
|
---|
490 | ident "kit_base.obj"
|
---|
491 | param
|
---|
492 | {
|
---|
493 | name "sensortrig_elem"
|
---|
494 | obj_suppl "^^envcompsuppl"
|
---|
495 | obj_ident "eng_sensor_std.sensortrig"
|
---|
496 | obj_param
|
---|
497 | {
|
---|
498 | env "^^env"
|
---|
499 | sensorstate "^sensorstate_world"
|
---|
500 | pos "sensortrig_pos"
|
---|
501 | }
|
---|
502 | }
|
---|
503 | }
|
---|
504 | {
|
---|
505 | ident "kit_engobj.sensortrig"
|
---|
506 | param
|
---|
507 | {
|
---|
508 | name "sensortrig_world"
|
---|
509 | sensorelem_actor "sensortrig_elem"
|
---|
510 | sensorelem_name ""
|
---|
511 | enter_cmd "player_enter"
|
---|
512 | leave_cmd "player_leave"
|
---|
513 | sender "capsule_deleg"
|
---|
514 | }
|
---|
515 | }
|
---|
516 | {
|
---|
517 | ident "kit_base.onaction"
|
---|
518 | param
|
---|
519 | {
|
---|
520 | active 1
|
---|
521 | target "sensortrig_world"
|
---|
522 | cmd "update"
|
---|
523 | }
|
---|
524 | }
|
---|
525 | {
|
---|
526 | ident "kit_engbase.netreproduce"
|
---|
527 | param
|
---|
528 | {
|
---|
529 | name "reproduce"
|
---|
530 | producer "inform"
|
---|
531 | charge "capsule_deleg"
|
---|
532 | reproduce_cmd "reproduce"
|
---|
533 | }
|
---|
534 | }
|
---|
535 | }
|
---|