ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Single player bugs

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  22:00:06  28 February 2019
profilee-mailreply Message URLTo the Top
On forum: 02/26/2019
Messages: 2

I have a problem when anything dies in my game it crashes to desktop.
Advise on ho to fix this.
[error]Expression : fatal error
[error]Function : CScriptEngine::lua_error
[error]File : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line : 73
[error]Description : <no expression>
[error]Arguments : LUA error: ...w of chernobyl\gamedata\scripts\death_manager.script:138: attempt to index field '?' (a nil value)
  10:27:40  1 March 2019
profilee-mailreply Message URLTo the Top
Senior Resident

On forum: 06/15/2007
Messages: 4302
Well, since line 138 in the vanilla death_manager.script is a comment, you are playing a mod. You might find better help in the Mod Discussion section of the forum.

I can better help you if you post the offending line and the five lines before and the five after. It likely is a mod configuration file problem, though.

Either your mod is not fully tested, or it has been changed, or you are a victim of Virtual Store/Volume Shadow Copy issues. For that, see my post here:

"help with mod crashing"

  18:11:01  1 March 2019
profilee-mailreply Message URLTo the Top
On forum: 02/26/2019

Message edited by:
03/01/2019 18:21:04
Messages: 2

109 class "drop_manager"
110 function drop_manager:__init(npc)
111	self.npc = npc
113 function drop_manager:create_release_item()
114	--' Спрашиваем у серверного объекта генерились ли предметы
115	local se_obj = alife():object(self.npc:id())
116	if se_obj.death_droped == true then
117		return
118	end
119	se_obj.death_droped = true
121    --' Запускаем итератор на удаление предметов
122    self.npc:iterate_inventory(keep_item, self.npc)
124    --' Проверка на отсутствие спауна лута
125    local ini = self.npc:spawn_ini()
127    if ini and ini:section_exist("dont_spawn_loot") then
128        return
129    end
131    --' Доспавниваем необходимое количество итемов:
132    --' Необходимо составить список объектов которые могут быть заспавнены для персонажа
133    local spawn_items = item_by_community[self.npc:character_community()]    
134    for k,v in pairs(spawn_items) do
135        --' По каждому объекту необходимо получить зависимости		
136        if check_item_dependence(self.npc, k) == true then
137            --' По каждому объекту необходимо получить количество
138            local number = math.ceil(math.random(count_by_level[k].min, count_by_level[k].max))
139            --' Необходимо заспавнить нужное количество.
140            create_items(self.npc, k, number, v)
141        end
142    end

BTW i'm using win 10 my system and game drives are separate.
Thank you for helping
  22:49:05  1 March 2019
profilee-mailreply Message URLTo the Top
Senior Resident

On forum: 06/15/2007
Messages: 4302
There is an item that does not have an associated entry in the count_by_level array, as indicated by "attempt to index field '?' (a nil value)" -- you can't get a min or a max value from a missing item.

As a workaround, you can replace line 138:

    local number = math.ceil(math.random(count_by_level[k].min, count_by_level[k].max))

Replace that line with this block of code:

    local number = 0
    if count_by_level[k] then
        number = math.ceil(math.random(count_by_level[k].min or 0, count_by_level[k].max or 0))

This will spawn nothing for that item. My guess is that the section (represented by k) is in the community list of the death_generic.ltx file in gamedata\config\misc, but it is not in the item_count_* lists. Note that death_generic.ltx loads other files at the top of the file (at least in vanilla), one of which is the community list file and one the items count file.

Formatting doesn't matter to Lua, but you can line this code up with the level of indentation used by the original line.

If you want to fix it, you need to be able to display the section or write it to the console log. Most mods have a function to do that, like mylog() or dbglog(). If you see that in your mod, you can use that function to display the section in the variable k. Before the end statement above, you can insert this line:

else print("The missing section is "..k)

Replace the print word with mylog, or dbglog, or whatever your mod uses.

After search the same body in the game again, you can bring down the console with the ` (or ~) key, at the left end of the number row on your keyboard.
You can see if there is a line at the bottom of the console log that says that a file is not found or unknown command, followed by a section name. That section name is the problem here.

If you still have trouble, post in the Mod Discussion thread and mention the mod you are using, and what you tried to change, or if you were previously using any others mods whose leftovers might be affecting this mod.
Each word should be at least 3 characters long.
Search conditions:    - spaces as AND    - spaces as OR   
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Single player bugs

All short dates are in Month-Day-Year format.


Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.