function create_level_changer(
p_story_id,
p_position,
p_lvertex_id,
p_gvertex_id, 

p_dest_lv, 
p_dest_gv,
p_dest_pos,
p_dest_dir,
p_dest_level,
p_silent
)
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(1) -- тип фигуры: box
packet:w_float(30) -- 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(10) -- 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(5) -- 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)

packet:w_u16(p_dest_gv)
packet:w_s32(p_dest_lv)
packet:w_vec3(p_dest_pos)
packet:w_vec3(p_dest_dir)
packet:w_stringZ(p_dest_level)
packet:w_stringZ("start_actor_02")
packet:w_u8(p_silent)

packet:r_seek(0)
obj:STATE_Read(packet, packet:w_tell())
 news_manager.send_tip(db.actor, "Открыт переход из Рыжего Леса на АТП!", nil, nil, 20000)
end

function tropa_red_forest_atp()
		-- создается переход c Рыжего Леса на АТП
	if (not has_alife_info("info_red_forest_to_atp")) then
	y_level_red_forest.create_level_changer(15024, vector():set( -16.953,-0.370,-472.689 ),53052,3270,
        43295,
        2793,
        vector():set( -229.450,2.810,-15.016 ),
        vector():set( 0,-1.58000004291534,-1),"atp_for test22",0)
        db.actor:give_info_portion("info_red_forest_to_atp")
	end
end


