ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Crash when moving near Fox during rescue mission

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  09:25:02  16 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
10/16/2012 9:28:35
Messages: 567
Crash when moving near Fox during rescue mission

I am getting a consistent crash whenever I enter the space restrictor near Fox:

http://i.imgur.com/XmLNV.jpg

It contains the code:

[logic]
active = sr_idle

[sr_idle]
on_actor_inside = sr_sound

[sr_sound]
snd = ambient\dogs1
slide_sound_once = true
on_signal = sound_end| nil



The crash log points to this line of code in xr_logic.script, but I am not sure if it is related:

    _G[filename].set_scheme(npc, ini, scheme, section, db.storage[npc_id]["gulag_name"])



Crash log:

Expression    : fatal error
Function      : CScriptEngine::lua_error
File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
Line          : 73
Description   : <no expression>
Arguments     : LUA error: ...shadow of chernobyl\gamedata\scripts\xr_logic.script:375: attempt to index field '?' (a nil value)



Any ideas what might be causing this?
  12:12:12  16 October 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
 

Message edited by:
NatVac
10/16/2012 12:32:52
Messages: 4286
>> attempt to index field '?' (a nil value)

There are more than two attempts to index a field in that statement, _G[filename].set_scheme and db.storage[npc_id]["gulag_name"], which is technically the same as db.storage[npc_id].gulag_name.

I'm pretty sure db is not nil and storage is not nil, but you can check the possibilities by testing each variable for nil:

if filename == nil then abort("filename is nil!") end
if _G[filename] == nil then abort("_G[filename] is nil for "..filename) end
if npc_id == nil then abort("npc_id is nil!") end
if db == nil then abort("db is nil!") end
if db.storage == nil then abort("db.storage is nil!") end

Insert those lines before line 375 in xr_logic.script. You'll need an abort function that prints the error (like the one in the ZRP) instead of something about an invalid arg #2 to format.

My uninformed guess is one of the first two is nil. My reasoned guess is that sr_sound.script is not valid and the second statement above will indicate that. You should be able to tell me why I think that.

You can test if sr_sound.script is valid in a couple of ways. You can place a debug statement that says it is valid at the end of the script in question. Or you can check in another script (say, db.script's add_actor() function) if the script object is valid. For xyz.script, the script object is xyz; if xyz is nil the script didn't parse.

Or, if you have the ZRP as a test base, you can press Esc Z while in-game to bring up the ZRP support utilities dialog*, press X to select the Execute Script Command utility, click in the field and type 'sr_sound' (without quotes) followed by Enter. It would print either nil or table. Table is good.

__________
*ZSU must be enabled with the Execute Script Command utility pre-installed via Modifier > SupportUtilities.cfg; see the Modifier options and docs.
  19:42:54  16 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
NatVac, I don't know where you even come up with this stuff. I would pay good money to hook up a cable between your brain and mine to download all of your STALKER knowledge, Matrix style!

Hm, jee, I don't know why anyone would be messing around with sr_sound

I'll mess around with this stuff and post back.
  20:01:36  16 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
10/16/2012 20:05:44
Messages: 567
I used the execute script utility. sr_sound returned nil.

These are the only changes I made to sr_sound: http://pastebin.com/kmpgP4KW
  23:29:46  16 October 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4286
Thanks for the pastebin. Change the "BEGIN edited"/"END edited" lines and surrounding lines that start with a solitary '-' to start with '--' to denote comment data. Turning those two sections into valid comment blocks should fix the problem if there are no other changes.

Verify first with ZSU. (You don't really need to do this; a crash will tell you that it's still broken. But it will help you get more into the mindset of troubleshooting your problem with tools at your disposal.)
  02:34:03  17 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
10/17/2012 2:46:45
Messages: 567

---QUOTATION---
Thanks for the pastebin. Change the "BEGIN edited"/"END edited" lines and surrounding lines that start with a solitary '-' to start with '--' to denote comment data. Turning those two sections into valid comment blocks should fix the problem if there are no other changes.
---END QUOTATION---


lol, really Daemonion, really?

I love these kind of errors. It works fine, now.
  03:40:18  17 October 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Crash when moving near Fox during rescue mission

I am getting a consistent crash whenever I enter the space restrictor near Fox:

http://i.imgur.com/XmLNV.jpg

It contains the code:

[logic]
active = sr_idle

[sr_idle]
on_actor_inside = sr_sound

[sr_sound]
snd = ambient\dogs1
slide_sound_once = true
on_signal = sound_end| nil



The crash log points to this line of code in xr_logic.script, but I am not sure if it is related:

    _G[filename].set_scheme(npc, ini, scheme, section, db.storage[npc_id]["gulag_name"])



Crash log:

Expression    : fatal error
Function      : CScriptEngine::lua_error
File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
Line          : 73
Description   : <no expression>
Arguments     : LUA error: ...shadow of chernobyl\gamedata\scripts\xr_logic.script:375: attempt to index field '?' (a nil value)



Any ideas what might be causing this?
---END QUOTATION---




The sound reference in the screeshot is not the same from your logic...

dogs1? Or dogs_1?
  03:48:09  17 October 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567

---QUOTATION---
The sound reference in the screeshot is not the same from your logic...

dogs1? Or dogs_1?
---END QUOTATION---


Thanks for the reply, but the problem was already solved (see posts above you).

My comments in the sr_sound.script had only one "-" when I needed two "--" to precede them.

Stupid, silly mistake
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

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


 

Copyright © 1995-2020 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.