/////////////////////////////////////////////////////////////////////////////// // // ## ###### // ###### ### // ## ############### Shark 3D Engine (www.shark3d.com) // ########## # # # // ######## Copyright (c) 1996-2006 Spinor GmbH. // ######### # # # All rights reserved. // ## ########## // ## // /////////////////////////////////////////////////////////////////////////////// // Definition of the player. // // In this case, the player basically only is a main camera // which is linked to a particular object in the world, // and a test camera which can be moved freely around to inspect the level. // // The player is not defined directly, but only a suppl for the player. // The reason for this is that not only one player must be created, // but a new player for every player which logs into the server. // As long as no client logs into a server, no player is created. // Each time a player logs into the server, the player suppl // is used to create a player. actor_ident "kit_base.group" actor_param { active 1 child_array { // This dispatcher dispatches commands coming // from outside the capsule. ident "kit_base.dispatch" param { name "dispatch_export" entry_array // notice_destroy the player: { cmds "destroy" targets "capsule" } { cmds "created_local" targets } { cmds "created_net" targets "reproduce" newcmd "set_blocked" } { cmds "net_traverse" targets } { cmds "net_appear" targets "reproduce" newcmd "rework" } // Inform management: { // Store the inform-actor in "inform": cmds "assign_inform" "set_inform" targets "inform_deleg" newcmd "set_deleg_target" } { // Delegate the inform command: cmds "assign_inform" "set_inform" targets "informanswer" "oninform_gfxmgr" "oninform_sndmgr" "oninform_world" "oninform_sky" "oninform_sim" "oninform_noise" "oninform_sensorstate" "oninform_maincamera" "maininform_switch" } { cmds "search_inform" "search_noinform" targets "informanswer" } { // Set the position of the player. cmds "set_transf" targets "scene_root" } { cmds "add_motion" targets "player_deleg" } { cmds "god" targets "god_switch" newcmd "toggle_switch" } { cmds "god_off" targets "god_switch" newcmd "disable_switch" } { cmds "god_on" targets "god_switch" newcmd "enable_switch" } { cmds "get_light_transl" targets "^lightitem" newcmd "get_transf_transl_xyz" } { cmds "set_light_transl" targets "^lightitem" newcmd "set_transf_transl_xyz" } } } { ident "kit_base.dispatch" param { name "dispatch" entry_array { // Disable god mode: cmds "god_off" targets "maininform_switch" newcmd "select_normalmode" } { // Disable godmode. cmds "god_off" targets "player_deleg_actor" newcmd "disable" } { // Enable godmode. cmds "god_on" targets "maininform_switch" newcmd "select_godmode" } { // Enable godmode. cmds "god_on" targets "player_deleg_actor" newcmd "enable" } { // Enable godmode. cmds "god_on" targets "godctrl" newcmd "player_to_god" } } } { ident "kit_base.deleg" param { name "inform_deleg" deleg_name "inform" deleg_target "" allow_no_target 1 enabled 1 } } { ident "kit_engobj.informanswer" param { name "informanswer" answer_cmd "add_result" answer_actor "capsule_deleg" } } { ident "kit_base.switch" param { name "god_switch" target "dispatch" disable_switch_cmd "god_off" enable_switch_cmd "god_on" val 0 } } { ident "kit_engobj.itemeye" param { name "camera" item_actor "^camposref" item_name "" } } { ident "kit_engobj.item" param { name "god_vehicle" item_suppl "^stdsuppl" item_ident "simplepos:" item_param { env "^^env" } } } { // Select the position of the godmode-camera // (we want the position, not the wrapping actor, // so "unwrap" it). ident "kit_engobj.item" param { name "god_camera" item_suppl "^stdsuppl" item_ident "simplepos:" item_param { env "^^env" parent "god_vehicle" } } } { // The godplayer moves different than the normal player // so pass the movement to this godmode-control actor. ident "kit_engobj.godctrl" param { active 1 name "godctrl" move_dir 0.0 1.0 0.0 move_also 1.0 0.0 0.0 cam_dir 0.0 0.0 1.0 cam_also 1.0 0.0 0.0 god_vehicle "god_vehicle" god_cam "god_camera" player_vehicle "" player_cam "camera" } } { // Split the motion-commands: // up-down look is applied directly to the camera, // rest of movement and rotation ia applied to position // (here via godctrl). // Splitting is necessary // because we don't want the player to tilt backwards // while looking up. ident "kit_engobj.motionlook" param { name "motionlook" look_actor "god_camera" look_target "god_camera" look_get_cmd "get_transf" look_set_cmd "set_transf" other_target "godctrl" other_cmd "add_motion" axis 1.0 0.0 0.0 min_angle -170.0 max_angle -10.0 } } { ident "kit_base.deleg" param { name "player_deleg_actor" deleg_name "player_deleg" deleg_target "motionlook" allow_no_target 1 enabled 0 } } { ident "kit_engobj.oninform" param { // Tell the client about performing // the level change. name "oninform_changelevel" cmd "changelevel_perform" } } { ident "kit_engobj.oninformobj" param { name "oninform_gfxmgr" cmd "set_gfxmgr_level" param "^gfxmgr" } } { ident "kit_engobj.oninformobj" param { name "oninform_sndmgr" cmd "set_sndmgr_level" param "^sndmgr" } } { ident "kit_engobj.oninformobj" param { name "oninform_world" cmd "set_state_world" param "^state_world" } } { ident "kit_engobj.oninformobj" param { name "oninform_sky" cmd "set_state_sky" param "^state_sky" } } { ident "kit_engobj.oninformobj" param { name "oninform_sim" cmd "set_sim_world" param "^sim_world" } } { ident "kit_engobj.oninformobj" param { name "oninform_noise" cmd "set_noise_world" param "^noise_world" } } { ident "kit_engobj.oninformobj" param { name "oninform_sensorstate" cmd "set_sensorstate_world" param "^sensorstate_world" } } { ident "kit_engobj.oninformobj" param { name "oninform_maincamera" cmd "set_camera" param "camera" } } { ident "kit_engobj.oninformobj" param { name "oninform_godcamera" cmd "set_camera" param "god_camera" } } { // This actor is used to switch between the main // camera and the test camera. // This actor switches between different actors // which get the "assign_inform" or "set_inform" // command with the current inform-actor, whereas // all other disabled actors get a "assign_inform" or // "set_inform" with 0 as argument. ident "kit_engobj.oninformswitch" param { name "maininform_switch" deleg_name "maininform" target "oninform_maincamera" entry_array { cmd "select_godmode" target "oninform_godcamera" } { cmd "select_normalmode" target "oninform_maincamera" } } } { ident "kit_engbase.netreproduce" param { name "reproduce" producer "inform" charge "capsule_deleg" reproduce_cmd "reproduce" } } }