Срочно помогите, кто может! Что делать с этим вылетом? Я уже и не знаю даже где я косякнул.
Expression : ai().game_graph().header().levels().end() != I Function : CALifeGraphRegistry::setup_current_level File : D:\prog_repository\sources\trunk\xrGame\alife_graph_registry.cpp Line : 87 Description : Graph point level ID not found!
Всем привет. Я вытянул из примочек Вергаса скриптовые функции: Обьекты локаций нужно исследовать (чтобы появился кружочек, с названием обьекта при навождении на него.) Вырезал эту фитчу удачно (нету вылетов), но осталась проблема: В пда все обьекты локаций уже открыты (кружоче, опять же хы), но при приходе на онные обькты, выходит сообщение "Исследован обьект локации: Скадовск."
Сам вопрос: Что надо сделать, чтобы кружочков обьектов локаций не было с начала игры(функция появления кружочка обьекта есть, нужно кружочки наф убрать, но не в файлах textures/ui)?
Выложу все, что есть в скриптах по исследованию локаций: bind_stalker :
-- Апдейт доступности для симуляции. simulation_objects.get_sim_obj_registry():update_avaliability(alife():actor())
if not self.loaded then get_console():execute("dump_infos") self.loaded = true end treasure_manager.get_treasure_manager():update()
if not(primary_objects_filled) then pda.fill_primary_objects() --Vergas ----------------------------ON--------------------------- search_of_locations.fill_primary_objects() --Vergas ----------------------------OFF-------------------------- primary_objects_filled = true end pda.fill_sleep_zones()
--Vergas ----------------------------ON--------------------------- vergas_lib.gg_update() if primary_objects_filled then search_of_locations.find_primary_objects() end --Vergas ----------------------------OFF-------------------------- end
сам скрипт search_of_locations
--Lotions from Vergas---------------------------- -- разведка объектов на локации ----------------------------------------------------- local primary_objects_tbl local value_if_not_found local time_find local delta_time = 6 local zone_radius = 50 --100
--заполняю переменную value_if_not_found value_if_not_found = "" for i = 1,54 do if i<54 then value_if_not_found = value_if_not_found.."0|" else value_if_not_found = value_if_not_found.."0" end end
find_tmp = vergas_lib.str_explode("|",vergas_lib.load_variable("find_locations", value_if_not_found),true) vergas_lib.del_variable("find_locations") --дополняю таблицу объектов for i = 1,table.getn(primary_objects_tbl) do primary_objects_tbl[i].find = tonumber(find_tmp[i]) end
--ставлю метки на карте for k,v in pairs(primary_objects_tbl) do local obj_id = get_story_object_id(v.target) if(obj_id) then if(obj_id and db.storage[obj_id] and db.storage[obj_id].object) then if v.find == 1 and level.map_has_object_spot(obj_id, v.hint)==0 then level.map_add_object_spot(obj_id, "primary_object", v.hint) end end end end time_find = time_global()/1000 end
function find_primary_objects() local current_time = time_global()/1000 if current_time - time_find < delta_time then return end time_find = current_time for k,v in pairs(primary_objects_tbl) do if v.find == 0 then local obj_id = get_story_object_id(v.target) if(obj_id) then if(obj_id and db.storage[obj_id] and db.storage[obj_id].object) then if (db.storage[obj_id].object:position():distance_to(db.actor:position())<=zone_radius and level.map_has_object_spot(obj_id, v.hint)==0) then level.map_add_object_spot(obj_id, "primary_object", v.hint) v.find = 1 send_new_object(game.translate_string(v.hint)) end end end end end end
function send_new_object(news_content) local news_caption news_caption = game.translate_string("st_mr_Dektyarev") news_content = "Найден новый объект района: "..news_content xr_sound.set_sound_play(db.actor:id(), "pda_tips") db.actor:give_game_news(news_caption, news_content, "ui_inGame2_PD_Svoy_paren", 0, 5000) end
function save_primary_objects() local str = "" for i = 1,table.getn(primary_objects_tbl) do if i<54 then str = str..tostring(primary_objects_tbl[i].find).."|" else str = str..tostring(primary_objects_tbl[i].find) end end vergas_lib.save_variable("find_locations", str) end
vergas_lib:
--Lotions from Vergas---------------------------- -- библиотека функций общего назначения ---------------------------------------------------- local medical ----------------------Выгрузка переменных при записи игры-------------------------------- function game_save() search_of_locations.save_primary_objects() end ---------------------------------------------------------------------------------------- ---------------------Загрузка переменных при старте игры------------------------------- function game_load() end ---------------------------------------------------------------------------------------- ------------------Сохранение переменных-------------------------------------- function save_variable(variable_name, value) --variable_name - имя переменной в которую сохраняю --value - переменная, которую сохраняю if value==nil then del_variable(variable_name) else xr_logic.pstor_store(db.actor, variable_name, value) end end
function load_variable(variable_name, value_if_not_found) --variable_name - имя сохраненной переменной --value_if_not_found - значение, котророе передается, если такой переменной не найдено return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found) end
function del_variable(variable_name) --variable_name - име ранее сохраненной и удаляемой переменной if db.storage[db.actor:id()].pstor[variable_name] then db.storage[db.actor:id()].pstor[variable_name] = nil end end -------------------------------------------------------------------------------- ----------------------разобрать строку на составляющие-------------------------- function str_explode(div,str,clear) --Разбивает инфо-строку на составляющие и выводит в виде таблицы -- div - разделитель -- str - разбираемая строка -- clear ставим равное true local t={} local cpt = string.find (str, div, 1, true) if cpt then repeat if clear then table.insert( t, trim(string.sub(str, 1, cpt-1)) ) else table.insert( t, string.sub(str, 1, cpt-1) ) end str = string.sub( str, cpt+string.len(div) ) cpt = string.find (str, div, 1, true) until cpt==nil end if clear then table.insert(t, trim(str)) else table.insert(t, str) end
return t end
function trim (s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end -------------------------------------------------------------------------------- ----------------------Обновление главного героя-------------------------------- function gg_update() end ---------------------------------------------------------------------------------------
Сообщение отредактировал Creon - Вторник, 22.05.2012, 15:23
6poHR777, Подобный вылет говорит о том, что в игре инициализируется некий объект, у которого в параметрах присутствует некорректное значение (например нулевое). Лечение: искать в конфигах некорректно прописанную строку.
Сообщение отредактировал FaLcon - Вторник, 22.05.2012, 18:26