Reposted from the one I posted for DA since the file in question is probably identical.
E:
Reupload to make it compatible with Anomaly 1.5.1 - it is required to install the new file
This is a temporary fix for the crashes caused by << xr_reach_task.script:57: attempt to index a nil value >>, which has not seem to have a public fix for it in several years, and apparently is still sometimes encountered in the latest 1.5.1 version especially in A) large maps or B) where there are many NPCs or many squads.
Since this might not be the best solution, I am open to any better methods of solving it. I have only tested this for Dead Air, which works, but it should work in Anomaly also because the error is the exact same.
Some strange behavior is expected to be observed from NPCs or Squads. Keep in mind that the fix is not an end-all solution. But, at least you are looking at NPCs behaving like idiots rather than looking at another error message
E1:
Uploaded version (possibly) compatible with older versions of the mod, such as 1.5.0. The version compatible with 1.5.1 is also included. I currently cannot test it for myself so it is required for potential issues to be reported in the comments section, which I will try to check often.
you are a godsend! I suddely kept having this error, but only at night (or shortly before night). very strange. What exactly did you do to fix it?
The function << formations >> is called in line 57, and sometimes returns a non-indexable value. Trying to index it causes insta-CTD. So this file just has an alternate case for when << formations >> is empty or nil, and assigns the 'default' values of vertexid and directions for that NPC. Let me know if the crash happens again though.
There is an entry in the script called "alan_utils" which is no longer valid in Anomaly. It has been renamed "utils_obj". In Anomaly 1.5.1 there are some scripts that have been renamed but do the same thing. Just for info.
Thanks for the information +1
It has been resolved accordingly
What is this error exactly? it happens on different games with different modpacks, too many npc at work?
either you edited the squad_descr_default_stalkers.ltx our some mods that edits stalker pop.
Hey do you have a response to my problem below?
Any ideas on this? I'm playing the 1.5.0 version. Your file just gave me another random error about this on line 108. But the error below is from the original xr_reach_task from 1.5.0. I constantly get this error in rostok playing as a merc in warfare. Always am_i_reached
! [SCRIPT ERROR]: ...iles (x86)/anomaly\gamedata\scripts\xr_reach_task.script:96: attempt to call method 'am_i_reached' (a nil value)
FATAL ERROR
[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_error
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 191
[error]Description : fatal error
[error]Arguments : LUA error: ...iles (x86)/anomaly\gamedata\scripts\xr_reach_task.script:96: attempt to call method 'am_i_reached' (a nil value)
stack trace:
Anyone have an idea on how to fix this?
Hello, sorry for such a late response. I was busy recently with my studies so I did not notice this message, until now. Anyway, I have modified the file to address this issue, with the same method. I am still going to be busy, so test it out and let me know if it works. Thanks.
Oh and by the way, apparently some changes in 1.5.1 involved the renaming of some functions/classes/etc., as another poster mentioned above. If you are playing 1.5.0, those things are probably named differently (such as utils_obj being named alun_utils) and they will 100% result in issues. As such, I have created a test version of the file with the according name changes. See if that works out better for you. Thanks.
I always get the crash but for xr_reach_task.script: 59. This mod seems to fix it though. So thank you! Hope you can make fixes for other crashes as well.
The file for Anomaly 1.5.1 is slightly different than the same file for the Dead Air mod, which is what I originally made this for. But the issue seems to be the same in this case. Glad to know it works out for you!
same here! work with 1.5.2 version. ty
can you update for 1.5.2?
also when you say strange... do you mean just weird behavior or full on spaghetti people?
Required for 1.5.2 too?
made an account just to say that I'm playing on 1.5.2, i started having the xr_reach_task.script 59 with pretty much random crashes and random areas becoming impossible to enter, and I couldn't for the life of me figure out which mod(s) could be doing it, but this fixed it!