MF99K Posted January 24, 2017 Share Posted January 24, 2017 I've been adding birds to this mod. It was working about an hour ago but now it crashes occasionally. I believe the problem is around lines 165-170 in modmain.lua, but I can't figure out what specifically is causing the crash since I assume it's a specific bird spawning that's causing the crashing. (most likely the bluebird) could anyone take a look and give me some suggestions? birds.zip Link to comment Share on other sites More sharing options...
RedHairedHero Posted January 24, 2017 Share Posted January 24, 2017 Are you able to provide the crash log as well for more details? Link to comment Share on other sites More sharing options...
Renamon Posted January 24, 2017 Share Posted January 24, 2017 as red said, if you could provide the crash log we can look into the issue more Link to comment Share on other sites More sharing options...
MF99K Posted January 25, 2017 Author Share Posted January 25, 2017 (edited) all the crash log says is that it can't index field "bird" on lines 168 and 170 in modmain.lua. I --'ed the lines out and got the same error message. The part of the code that's supposedly causing the crash hasn't been edited between the time the mod was working and between the bugged version, other than the --s I added after it started complaining. In other words, I edited extrabirds.lua and that caused an error in modmain.lua but the crash log can't determine what wen't wrong with the other file since the error happens when modmain.lua tries to access it So I didn't change anything but the code is fine now so? I'm just gonna assume there was a compiler glitch. You guys can ignore this nope ok so there is definitely something wrong with the bluebird code because when the game tries to spawn it I get the attempt to index local "bird" on lines 168 and 170 in modmain.lua crash. Every other bird spawns fine and spawning the bluebird with console is fine. Basically, the code with the problem is not the code causing the crash therefore I can't figure out which line of code is the actual issue. Edited January 25, 2017 by mf99k Link to comment Share on other sites More sharing options...
CarlZalph Posted January 25, 2017 Share Posted January 25, 2017 6 hours ago, mf99k said: so there is definitely something wrong with the bluebird code because when the game tries to spawn it I get the attempt to index local "bird" on lines 168 and 170 in modmain.lua crash. Every other bird spawns fine and spawning the bluebird with console is fine. Basically, the code with the problem is not the code causing the crash therefore I can't figure out which line of code is the actual issue. "bluebird" prefab doesn't exist. Bird prefabs defined in extrabirds.lua: hoopoe, mag, phoebe, blue, waxwing, phoenix. So change "bluebird" to "blue". That being said, "blue" is a very generic nondescript name for a prefab; it is an adjective which is not a noun. Link to comment Share on other sites More sharing options...
MF99K Posted January 25, 2017 Author Share Posted January 25, 2017 3 hours ago, CarlZalph said: "bluebird" prefab doesn't exist. Bird prefabs defined in extrabirds.lua: hoopoe, mag, phoebe, blue, waxwing, phoenix. So change "bluebird" to "blue". That being said, "blue" is a very generic nondescript name for a prefab; it is an adjective which is not a noun. thanks, I had a feeling it was something like that. Originally everything was bluebird and not blue but there were some issues involving that name so I took the lazy solution instead of fixing the actual root of the problem. I'll go ahead and change everything back to "bluebird" and fix the initial problem. Link to comment Share on other sites More sharing options...
CarlZalph Posted January 26, 2017 Share Posted January 26, 2017 8 hours ago, mf99k said: thanks, I had a feeling it was something like that. Originally everything was bluebird and not blue but there were some issues involving that name so I took the lazy solution instead of fixing the actual root of the problem. I'll go ahead and change everything back to "bluebird" and fix the initial problem. If anything you could always put on a prefix or suffix to ensure the prefab name is unique. Like "mf99k_bluebird" or "bluebird_mf99k" etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now