nltp-ashes / Western-Goods

Western Goods is an addon for the game S.T.A.L.K.E.R. Anomaly.
https://discord.gg/7Z8S2qg
Other
11 stars 4 forks source link

[BUG]: Storylines - sim_board.script:140: attempt to index local 'squad' (a nil value) #71

Closed Inchik21 closed 6 months ago

Inchik21 commented 6 months ago

Description

Hello, nltp-ashes! I'm the one who posted the new game issue. Game crashes when I start a new game. Here's a little backstory: I've already installed the very first version of your amazing mod all the way to the latest 2.5.0. When you release an update, what I do is that I uninstall the mod using JSGME, download the update, delete the old version from my mod order and install the updated file. (I don't click on the addon removal in the MCM menu) That might be my biggest mistake. I also installed DLTX/DXML and on my first Merc playthrough, everything goes well. I was able to use the rangefinder and other sweet stuff from your mod. One day, I decided to start a new game as a loner and bam! It crashed. I'll provide the error log below. I read something from a forum that the thing causing this crash which is related to a sim_board script is a mod that is using MCM and that it has to do with a mod that messes with Alife. I have to confirm this to you since you're the author of this mod. When I click addon removal and disable Western goods from my mod order, I can start a new game just fine. There is only one problem... I can't play Stalker without Western Goods. I love this addon to the core and I still have a mission to finish for the Flea market trader. Speaking of which, what boggles me is the error "mil_merc_outpost_squad" because when I tried to launch a new game again just 20 min ago, it now shows as: (ERROR: alife_create | section [simulation_fracture_squad] is invalid!) I hope we can solve this bug together. If you need more info, please kindly hit me up anytime! Thank you and Cheers my good man! I'm sorry for the long description. I just want to help out in any way I can to solve this pesky problem and get back to Stalking as well as get rid of any bugs for ya!

Addon version

v2.5.0

Game version

1.5.2

Log output

Here is the complete log error from the log:

!ERROR: alife_create | section [simulation_fracture_squad] is invalid! ! [LUA] 0 : [C ] __index ! [LUA] 1 : [Lua] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script(140) : create_squad ! [LUA] 2 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1716) : try_respawn ! [LUA] 3 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1253) : ! [LUA] SCRIPT RUNTIME ERROR ! [LUA] 0 : [C ] index ! [LUA] 1 : [Lua] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script(140) : create_squad ! [LUA] 2 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1716) : try_respawn ! [LUA] 3 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1253) : ! [LUA] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script:140: attempt to index local 'squad' (a nil value) ! [LUA] 0 : [C ] index ! [LUA] 1 : [Lua] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script(140) : create_squad ! [LUA] 2 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1716) : try_respawn ! [LUA] 3 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1253) : ! [SCRIPT ERROR]: ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script:140: attempt to index local 'squad' (a nil value)

FATAL ERROR

[error]Expression : [error]Function : CScriptEngine::lua_pcall_failed [error]File : D:\a\xray-monolith\xray-monolith\src\xrServerEntities\script_engine.cpp [error]Line : 262 [error]Description : fatal error [error]Arguments : 1 : [Lua] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script(140) : create_squad

LUA error: ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script:140: attempt to index local 'squad' (a nil value)

Check log for details

stack trace:

! [LUA] 0 : [C ] __index ! [LUA] 1 : [Lua] ... stalker anomaly 1.5.2\gamedata\scripts\sim_board.script(140) : create_squad ! [LUA] 2 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1716) : try_respawn ! [LUA] 3 : [Lua] ...lker anomaly 1.5.2\gamedata\scripts\smart_terrain.script(1253) :

Illustrations

No response

Contact

Moddb: tan_gem21 / Github: Inchik21

Confirmation

nltp-ashes commented 6 months ago

Hey @Inchik21 !

Thank you for sticking around with the addon for so long. It warms my heart to see you enjoy all the hard work I have poured into this addon over the months, and now years :)

This error is really confusing. Let me explain. The game is trying to spawn a squad (squads are a code structure made to group NPCs together to make the A-Life simulation less expensive to compute). What is happening here is the squad the game tries to spawn does not exist in the game file, so unsurprisingly, something somewhere fails.

Now the odd part is, I always code things to be as compatible as possible with the vanilla game, as well as other addons. To this end, Western Goods adds squads using new files. It does not change, nor overwrite anything from vanilla or other addons. So the fact that removing my addon helps the game find a squad is really odd, because this should have no effect on the issue.

I would ask you to check if Western Goods has any file-based conflicts with other addons, but you're using JSGME, and it does not allow to check that (other mod managers do).

So yeah, I do not really know what to tell you. I understand the problem but not how it can happen, and especially not why removing my addon fixes it.

One thing though. mil_merc_outpost_squad is not a section from my addon, but it isn't a vanilla section either. Maybe you can try to perform a full-text search over your MODS folder to see which addon uses it. Could give us a lead.

PS : Unless specified (in update announcements, or in the changelog), you do not need to use the addon removal between updates. Most updates so far have been compatible if you had the addon before. So do not worry, you made no mistake, and updated the addon correctly :)

Inchik21 commented 6 months ago

Hello! @nltp-ashes!

I finally got to the source of the problem and it's not Western Goods. It's a mod that I installed before which I disabled cause it spawns a lot of squads at Army Warehouses which kills FPS. It's REDONE Army Warehouses & Dead City by eAkman. I found the "mil_merc_outpost_squad" inside the files of that mod under squad_desc script. I was able to start a new game just fine after I enabled that mod again and the best part is that I was able to play Stalker with Western Goods as well! I would like to sincerely apologize for the wrong information regarding your mod. Western Goods is the bomb and it works perfectly! I made a mistake of not being able to see that REDONE army warehouse is disabled thus causing the crashes in the first place. I have no idea why disabling Western Goods before solved the problem momentarily but it might just be a coincidence. I'm just glad that the whole problem is not from your mod. Thank you so much for an awesome support and being with patient with the bug reports brother! I really appreciate it. Best of luck and see you somewhere in the Zone bratan! You the man! :)

nltp-ashes commented 6 months ago

Hi @Inchik21 !

No problem. All that matters is that your issue is resolved.

See you in the Zone ;)