Ранг: Разведчик
Сообщений: 158
Награды: 5
Репутация: 29
Регистрация: 27.06.2012
Город: Холмск
|
короче дела такие: [spoiler] файл y_level: function create_level_changer( p_story_id, -- STORY_ID нового level_changer (понадобится нам позже) p_position, -- вектор, координаты точки, в которой будет располагаться центр нового level_changer p_lvertex_id, -- level_vertext_id - идентифицируют уровень, на котором будет создан level_changer p_gvertex_id, -- game_vertext_id
p_dest_lv, -- level_vertex_id - идентифицируют уровень, на который level_changer будет перебрасывать игрока p_dest_gv, -- game_vertex_id p_dest_pos, -- координаты точки, в которой на новом уровне окажется игрок p_dest_dir, -- направрение взгляда игрока p_dest_level, -- название уровня, например "L11_Pripyat" p_silent -- следует задать 1, чтобы подавить вопрос о смене уровня (автоматический переход) ) local obj = alife():create("level_changer", p_position, p_lvertex_id, p_gvertex_id)
level.map_add_object_spot(obj.id, "level_changer", "")
local packet = net_packet() obj:STATE_Write(packet)
-- свойства cse_alife_object local game_vertex_id = packet:r_u16() local cse_alife_object__unk1_f32 = packet:r_float() local cse_alife_object__unk2_u32 = packet:r_u32() local level_vertex_id = packet:r_u32() local object_flags = packet:r_u32() local custom_data = packet:r_stringZ() local story_id = packet:r_u32() local spawn_story_id = packet:r_u32()
-- свойства cse_shape local shape_count = packet:r_u8() for i=1,shape_count do local shape_type = packet:r_u8() if shape_type == 0 then -- sphere local center = packet:r_vec3() local radius = packet:r_float() else -- box local axis_x_x = packet:r_float() local axis_x_y = packet:r_float() local axis_x_z = packet:r_float() local axis_y_x = packet:r_float() local axis_y_y = packet:r_float() local axis_y_z = packet:r_float() local axis_z_x = packet:r_float() local axis_z_y = packet:r_float() local axis_z_z = packet:r_float() local offset_x = packet:r_float() local offset_y = packet:r_float() local offset_z = packet:r_float() end end
-- свойства cse_alife_space_restrictor local restrictor_type = packet:r_u8()
-- свойства cse_level_changer local dest_game_vertex_id = packet:r_u16() local dest_level_vertex_id = packet:r_u32() local dest_position = packet:r_vec3() local dest_direction = packet:r_vec3() local dest_level_name = packet:r_stringZ() local dest_graph_point = packet:r_stringZ() local silent_mode = packet:r_u8()
packet:w_begin(game_vertex_id) -- game_vertex_id packet:w_float(cse_alife_object__unk1_f32) packet:w_u32(cse_alife_object__unk2_u32) packet:w_u32(level_vertex_id) -- level_vertex_id packet:w_u32( bit_not(193) ) -- object_flags = -193 = 0xFFFFFF3E packet:w_stringZ(custom_data) packet:w_u32(p_story_id) -- story_id packet:w_u32(spawn_story_id)
packet:w_u8(1) -- количество фигур -- packet:w_u8(0) -- тип фигуры: сфера -- packet:w_vec3(vector():set(0, 0, 0)) -- sphere_center -- packet:w_float(3.0) packet:w_u8(1) -- тип фигуры: box packet:w_float(2) -- axis_x_x packet:w_float(0) -- axis_x_y packet:w_float(0) -- axis_x_z packet:w_float(0) -- axis_y_x packet:w_float(4) -- axis_y_y packet:w_float(0) -- axis_y_z packet:w_float(0) -- axis_z_x packet:w_float(0) -- axis_z_y packet:w_float(4) -- axis_z_z packet:w_float(0) -- offset_x packet:w_float(0) -- offset_y packet:w_float(0) -- offset_z
packet:w_u8(3) -- restrictor_type
packet:w_u16(p_dest_gv) -- destination game_vertex_id packet:w_s32(p_dest_lv) -- destination level_vertex_id packet:w_vec3(p_dest_pos) -- destination position packet:w_vec3(p_dest_dir) -- destination direction (направление взгляда) packet:w_stringZ(p_dest_level) -- destination level name packet:w_stringZ("start_actor_02") -- some string, always const packet:w_u8(p_silent) -- 1 for silent level changing
packet:r_seek(0) obj:STATE_Read(packet, packet:w_tell()) news_manager.send_tip(db.actor, "Новый путь", nil, nil, 20000) end function create_l26_pripyat_cop() -- создается переход c Центральной Припяти в Восточную if (not has_alife_info( "teleport_to_l26_pripyat_cop" )) then y_level.create_level_changer(5256, vector():set(189.497,-2.115,233.149),259791,2149, 176155, 3760, vector():set( -30.785,-0.596,347.353 ), vector():set( 0.0,-1.58,-1.0),"l26_pripyat_cop",0) db.actor:give_info_portion("teleport_to_l26_pripyat_cop") send_tip("Припять -> Восточная Припять", "Новый путь!", 2, 25, "pda_icon") end -- создается переход ИЗ Восточной части в Центральную if (not has_alife_info( "teleport_from_l26_pripyat_cop" )) then y_level.create_level_changer(5257, vector():set(-22.476,-0.491,306.534),167535,3760, 257147, 2149, vector():set(180.800,-2.205,233.571), vector():set(0.0,1.56,-1.0),"l11_pripyat",0) db.actor:give_info_portion("teleport_from_l26_pripyat_cop") end end
файл level_tasks: local level_scripts = { escape_tasks, garbage_tasks, agroprom_tasks, darkvalley_tasks, bar_rostok_tasks, yantar_tasks, mil_tasks, radar_tasks, pripyat_tasks }
local jump_level_by_name = { l01_escape = "l02_garbage", l02_garbage = "l03_agroprom", l03_agroprom = "l03u_agr_underground", l03u_agr_underground = "l04_darkvalley", l04_darkvalley = "l04u_labx18", l04u_labx18 = "l05_bar", l05_bar = "l06_rostok", l06_rostok = "l07_military", l07_military = "l08_yantar", l08_yantar = "l08u_brainlab", l08u_brainlab = "l10_radar", l10_radar = "l10u_bunker", l10u_bunker = "l11_pripyat", l11_pripyat = "l12_stancia", l12_stancia = "l12u_sarcofag", l12u_sarcofag = "l12u_control_monolith", l12u_control_monolith = "l12_stancia_2", l12_stancia_2 = "l01_escape" }
function proceed() if db.actor == nil then return end for k, v in pairs( level_scripts ) do v.proceed() end
if db.actor:has_info("autojump_enabled") then local jname = jump_level_by_name[level.name()] if jname ~= nil then get_console():execute("flush") get_console():execute("jump_to_level "..jname) end end end
function autojump() db.actor:give_info_portion("autojump_enabled") end
function process_info_portion(info_id) if db.actor == nil then return end for k, v in pairs( level_scripts ) do if v.process_info_portion(info_id) then return end end end
function add_location(sid, location, hint) local sim = alife() if sim then local obj = sim:story_object(sid) if obj then if hint then level.map_add_object_spot(obj.id, location, hint) else level.map_add_object_spot(obj.id, location, "") end end end end
function remove_location(sid, location) local sim = alife() if sim then local obj = sim:story_object(sid) if obj and level.map_has_object_spot(obj.id, location) then level.map_remove_object_spot(obj.id, location) end end end
function remove_location_safe(sid, location) local sim = alife() if sim then local obj = sim:story_object(sid) if obj then for a = 1, level.map_has_object_spot(obj.id, location), 1 do level.map_remove_object_spot(obj.id, location) end end end end
function is_map_spot_present(sid, location) local sim = alife() if sim then local obj = sim:story_object(sid) if obj and level.map_has_object_spot(obj.id, location) ~= 0 then return true end end return false end
function add_lchanger_location() local sim = alife() if sim then -- escape local obj = sim:story_object(91) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end
-- garbage obj = sim:story_object(191) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_agroprom") end obj = sim:story_object(192) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_agroprom") end obj = sim:story_object(193) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_escape") end obj = sim:story_object(194) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_bar") end obj = sim:story_object(195) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_darkvalley") end obj = sim:story_object(196) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_darkvalley") end -- agroprom obj = sim:story_object(391) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end obj = sim:story_object(392) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end
-- darkvalley obj = sim:story_object(415) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end obj = sim:story_object(416) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end obj = sim:story_object(417) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_escape") end
-- rostok obj = sim:story_object(608) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_yantar") end -- bar obj = sim:story_object(592) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_military") end obj = sim:story_object(593) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_garbage") end obj = sim:story_object(594) if obj then level.map_add_object_spot(obj.id, "level_changer", "bar_rostok") end
-- military obj = sim:story_object(771) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_bar") end obj = sim:story_object(773) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_radar") end
-- yantar obj = sim:story_object(925) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_rostok") end
-- radar obj = sim:story_object(1007) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_pripyat") end obj = sim:story_object(1008) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_military") end
-- pripyat obj = sim:story_object(833) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_radar") end obj = sim:story_object(832) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_aes") end obj = sim:story_object(823) if obj then level.map_add_object_spot(obj.id, "level_changer", "teleport_to_l26_pripyat_cop") end obj = sim:story_object(5256) if obj then level.map_add_object_spot(obj.id, "level_changer", "teleport_to_l26_pripyat_cop") end obj = sim:story_object(5257) if obj then level.map_add_object_spot(obj.id, "level_changer", "teleport_from_l26_pripyat_cop") end
-- aes obj = sim:story_object(31410) if obj then level.map_add_object_spot(obj.id, "level_changer", "to_pripyat") end end end
function set_task_state(id_state, id_task, id_subtask) if db.actor then db.actor:set_task_state(id_state, id_task, id_subtask) end end
function notify_new_task() end Если у тебя ещё мозг не взорвался, то я продолжу: вот файл в config game_maps_single: [level_maps_single] L01_escape L02_garbage L03_agroprom L03u_agr_underground l04_darkvalley l04u_LabX18 L05_bar L06_rostok l07_military l08_yantar l10_radar l11_pripyat l12_stancia l12_stancia_2 l26_pripyat_cop l12u_control_monolith l12u_sarcofag l08u_brainlab
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [level_music_tracks] music\amb01 = 0, 12, 0.5, 10,20 music\amb03 = 0, 12, 0.5, 10,15 music\amb07 = 12,24, 1.0, 5, 25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [global_map] texture = ui\ui_global_map bound_rect = 0.0,0.0, 1024, 2634.0 max_zoom = 6.0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l01_escape] texture = map\map_escape bound_rect = -317.164, -633.718, 404.880, 811.627 global_rect = 355.0,2011.0, 576.0,2453.000000 weathers = default music_tracks = l01_escape_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [L02_garbage] texture = map\map_garbage bound_rect = -322.334, -347.225, 321.685, 318.000 global_rect = 371.0,1767.0,561.0,1963.256226 weathers = default music_tracks = l02_garbage_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l03_agroprom] texture = map\map_agroprom bound_rect = -266.505, -355.611, 331.388, 213.838 global_rect = 161.0, 1834.0, 344.0,2008.293945 weathers = default ;music_tracks = l03_agroprom_musics music_tracks = l01_escape_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l03u_agr_underground] texture = map\map_agr_underground bound_rect = -137.000, -147.000, -35.302, 50.254 global_rect = 255.0, 1900.0, 257.0, 1903.879150 weathers = indoor music_tracks = l03u_agr_underground_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l04_darkvalley] texture = map\map_darkvalley bound_rect = -445.320, -663.867, 449.864, 231.317 global_rect = 567.0, 1608.0, 1003.0,2044.338 weathers = pripyat music_tracks = l04_darkvalley_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l04u_LabX18] texture = map\map_labx18_map bound_rect = -51.236, -37.911, 47.999, 81.159 global_rect = 788.0, 1144.0, 790.0, 1146.399780 weathers = indoor_x18 ;music_tracks = l04_labx18_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [L05_bar] texture = map\map_bar bound_rect = 0.000, -512.030, 512.000, 512.001 global_rect = 407.0,1414.0,556.0,1712 weathers = default ;music_tracks = l05_bar_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [L06_rostok] texture = map\map_rostok bound_rect = -512.000, -512.030, 0.000, 512.001 global_rect = 258.0,1414.0,407.0,1712 weathers = default music_tracks = l06_rostok_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l07_military] texture = map\map_military bound_rect = -443.567, -130.466, 196.434, 509.534 global_rect = 414.0,1217.0,604,1406.999756 weathers = default music_tracks = l07_military_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l08_yantar] texture = map\map_yantar bound_rect = -282.869, -432.963, 287.342, 138.271 global_rect = 93.0,1566.0,256.0,1729.292480 weathers = yantar music_tracks = l08_yantar_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l08u_brainlab] texture = map\map_mind bound_rect = -146.670, -41.626, 153.227, 21.611 global_rect = 172.0,1612.0,174.0,1614.0 weathers = indoor music_tracks = l08u_brainlab_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [L10_radar] texture = map\map_radar bound_rect = -136.256, -503.108, 714.384, 353.524 global_rect = 527.0,975.0,769.0,1218.704712 weathers = radar music_tracks = l10_radar_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l10u_bunker] global_rect = 588.0, 1082.0, 590.0, 1084.0 weathers = indoor music_tracks = l10u_bunker_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l11_pripyat] texture = map\map_pripyat bound_rect = -529.399, -457.516, 574.854, 769.050 global_rect = 457.0, 586.0, 798.0, 964.770996 weathers = pripyat music_tracks = l11_pripyat_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l12_stancia] texture = map\map_aes_1 bound_rect = -256.776, -747.782, 1398.440, 850.523 global_rect = 253.0, 74.0, 737.0,541.358704 weathers = stancia music_tracks = l12_stancia_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l12u_sarcofag] global_rect = 440.0, 333.0, 442.0, 335.0 weathers = sarkofag music_tracks = l12u_sarcofag_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l12u_control_monolith] global_rect = 440.0, 333.0, 442.0, 335.0 weathers = indoor music_tracks = l12u_control_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l12_stancia_2] texture = map\map_aes_1 bound_rect = -256.776, -747.782, 1398.440, 850.523 global_rect = 253.0, 74.0, 737.0,541.358704 weathers = stancia2 music_tracks = l12_stancia_2_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l26_pripyat_cop] texture = map\map_l26_pripyat_cop bound_rect = -550.000000,-550.000000,550.000000,550.000000 global_rect = 730,600.62,1080,950.62 weathers = l26_pripyat_cop music_tracks = l26_pripyat_cop_musics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [l06u_labx16] global_rect = 767.0, 1827.0, 855.0,1978.0 ;texture = ui\ui_global_map ;bound_rect = 0.0,0.0, 5000.0,10000.0 weathers = indoor
[l09_deadcity] global_rect = -6,1220.0, 248.0,1481.0 texture = map\map_deadcity bound_rect = -502.148,-412.284,379.976,474,479 weathers = mrachno
[andy_test] texture = map\map_andy_test global_rect = 100.0,900.0, 209.563507,982.172606 bound_rect = -150.000,-100.000, 50.000,50.000 ;weathers = test weathers = default ;weathers = indoor ;weathers = indoor_x18 ;weathers = yantar ;weathers = radar ;weathers = pripyat
;weathers = stancia
;weathers = sarkofag ;weathers = stancia2 music_tracks = l01_escape_musics
[ai_test] texture = map\map_test bound_rect = -150.000, -100.000, 52.927, 50.000 global_rect = 156.0,833.0,365.691223,988.0 music_tracks = l03_agroprom_musics
Жив ещё?
Хороший стрелок тот, у кого ствол говорит только по делу
|