Координати
Що потрібно зробити, щоб отримати координати місць для телепортів. Відкриваємо ui_main_menu.script та знаходимо наступні рядки:
if dik == DIK_keys.DIK_Q then self:OnMessageQuitWin ( ) end
змінюємо їх:
if dik == DIK_keys.DIK_Q then self:OnMessageQuitWin ( ) elseif dik==DIK_keys.DIK_W then self:position_info ( ) end
І наприкінці файлу, тобто. після функції
function main_menu:OnMenuReloaded ( ) self:OnButton_options_clicked ( ) self.opt_dlg:OnMenuReloaded ( ) end
вставляємо
function main_menu:position_info ( ) local a = db.actor:position ( ) local vid = db.actor:level_vertex_id ( ) local gvid = db.actor:game_vertex_id ( ) local text = "GPS: \\ nX = " ..ax . " \\ nY=" ..ay. " \ nZ=" ..az. \\ nlevel_vertex= " ..vid.. " \\ ngame_vertex_id = " ..gvid news_manager.send_tip ( db.actor, text, nil , nil , 30000 ) end
та зберігаємо.
Заходимо в гру, добігаємо до місця, де хотіли б бачити телепорт, виходимо в меню, і в тиснемо на W , потім повертаємося в гру і робимо скріншот клавішею F12 . Потім добігаємо до місця, куди вас повинен перенести телепорт і знову робимо скрін.
all.spawn
Відкриваємо файл alife_zaton.ltx з декомпільованого all.spawn і наприкінці додаємо:
[6464] ;обозначает место, где находится телепорт ; cse_abstract properties section_name = space_restrictor name = zat_b20_teleport position = 265.378784,18.411567,526.151062 direction = 0,0,0 ; ; cse_alife_object properties game_vertex_id = 287 distance = 0 level_vertex_id = 1420994 object_flags = 0xffffff3e custom_data = <<END [logic] cfg = scripts\zaton\test_teleport.ltx END ; ; cse_shape properties shapes = shape0 shape0:type = sphere shape0:offset = 0,0,0 shape0:radius = 4.24460601806641 ; ; cse_alife_space_restrictor properties restrictor_type = 3 [6465] ;просто визуал телепорта. т.к сам телепорт невидим, этот визуал его покажет ; cse_abstract properties section_name = zone_teleport name = zat_b20_teleport_horiz position = 265.378784,18.411567,526.151062 direction = 0,0,0 ; ; cse_alife_object properties game_vertex_id = 287 distance = 49 level_vertex_id = 1420994 object_flags = 0xffffff3e ; ; cse_shape properties shapes = shape0 shape0:type = sphere shape0:offset = 0,0,0 shape0:radius = 5.5254921913147 ; ; cse_alife_space_restrictor properties restrictor_type = 3 ; ; cse_alife_custom_zone properties max_power = 0 ; ; cse_alife_anomalous_zone properties offline_interactive_radius = 30 artefact_spawn_count = 32 artefact_position_offset = 0x1ac0
Потім відкриваємо way_zaton.ltx і пишемо:
[ test_teleport_walk ] ; телепортує в потрібне місце _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Зберігаємо, компілюємо all.spawn .
Логіка телепорту
Тепер створимо файл логіки, назвемо його test_teleport.ltx , кинемо в gamedata\configs\scripts\zaton\ і пропишемо в ньому наступне:
[ logic ] active = sr_teleport ; [ sr_teleport ] point1 = test_teleport_walk ;ім'я секції телепорту в way_zaton.ltx look1 = zat_b20_quest_teleport_look
Все, зберігаємо.
Заходимо в гру, завантажуємося... І бачимо - недалеко від вас світиться телепорт, стрибаємо в нього і він вас миттю переносить на Скадовськ.