Kaejer Posted July 6, 2012 Author Share Posted July 6, 2012 Hey again, well I actually hit something that I have no idea how to debug. I made 2 resource trees next to each other on a map and the server crashed and reported Run-time error 9: Subscript out of range.Here is the line of code it pointed to:```ResourceCache(mapnum).ResourceData(Resource_Count).cur_health = Resource(Map(mapnum).Tile(x, y).Data1).health```Any idea on how to fix it? I do have a decent amount of resources if there's a max somewhere for that on an entire game. Actually, switching it from 100 to 500 max, it still gives the same error.Worst case scenario I could just delete the map, I suppose.Figured it out. I had to edit this code in server and client:```Public Const TILE_TYPE_RESOURCE As Byte = 7```EDIT: Nevermind, all it did was allow it to run and then it crashed when I tried to make a resource again. Link to comment Share on other sites More sharing options...
zerohero Posted July 6, 2012 Share Posted July 6, 2012 Heya do you have any custom code installed on your game, such as a skill system or resource experience? Link to comment Share on other sites More sharing options...
Joyce Posted July 6, 2012 Share Posted July 6, 2012 I do believe this has to do with you changing something in the data storage, but not having converted over the files or everything else accordingly. It's trying to read memory where it doesn't exist, or assign it so it just throws up this error, at least in my experience. Link to comment Share on other sites More sharing options...
Kaejer Posted July 6, 2012 Author Share Posted July 6, 2012 Zerohero: I don't have any custom code that deals with resources or skills. The only code that I have that really deals with any data is something that changes sprites based on HP, but it's been in there for a while with no errors.Joyce: I'm not sure where I could have done that, but how would I find out if that's the case?I dunno if this matters to the error, but when I came back the one time the map didn't have either of the resources I had placed earlier.EDIT: I edited this line of code:```Public Const TILE_TYPE_RESOURCE As Byte = 7```and made it 70 instead of 7 the first time and it worked. This time I switched it back to 7 and it worked again. I don't feel like making another resource to see if it'll crash again unless anyone has any ideas on how to fix it. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted July 6, 2012 Share Posted July 6, 2012 @Kaejer:> and made it 70 instead of 7 the first time and it worked. This time I switched it back to 7 and it worked again. I don't feel like making another resource to see if it'll crash again unless anyone has any ideas on how to fix it.I think this error occurs when you put down a resource without selecting a resource number (i.e., you place a resource tile down without clicking "OK" on the popup box). It's probably just a quick fix in the source code, or even just making the selection box vbModal.If you want, you could go create a test map, try to replicate it, and then send the map to me via PM. I made a tool to fix it back when this error was popping up every other week. Link to comment Share on other sites More sharing options...
Kaejer Posted July 6, 2012 Author Share Posted July 6, 2012 Sure, I could do that. I was pretty sure I was choosing a resource number, but maybe sometimes I didn't on accident. It was kind of late. Link to comment Share on other sites More sharing options...
Kaejer Posted July 7, 2012 Author Share Posted July 7, 2012 Ok now all of the sudden I can't replicate the bug. Before all I did was put down 2 resources and it exploded. Now I can't get it to crash. If I have the problem again I'll pm you with a map that contains the error (which appears to be temporary some how?) Link to comment Share on other sites More sharing options...
Joyce Posted July 7, 2012 Share Posted July 7, 2012 It's a very random and elusive error that can usually be fixed by deleting your maps, I haven't a proper clue how, where or why it appears. But it does when you do something you shouldn't.But glad to know it's sorted. :] Link to comment Share on other sites More sharing options...
DopeyBiach Posted September 26, 2012 Share Posted September 26, 2012 It happens to me each and every time I add a new map layer, literally if I just add one more line under Fringe2 in enumerations I get it ![-_-](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/sleep.png)Humbug..![](http://i50.tinypic.com/14av0v4.png) Link to comment Share on other sites More sharing options...
Joyce Posted September 26, 2012 Share Posted September 26, 2012 If you add a new layer, delete all your maps. It loads it in a linear order from pre-allocated memory.. So suddenly adding data in the middle of it all will cause issues. Link to comment Share on other sites More sharing options...
DopeyBiach Posted September 26, 2012 Share Posted September 26, 2012 Nvm.. I forgot to remove the layer I orginally wanted to add but couldn't, over-reacted, freaked.. (I've done 2 all nighters in the past 3 days working on my project).. I'm shattered, sorry for the hassle.. But omg, did I REALLY just do that.. LOOOOOOOOOOOOOOOOOOOOOOOOOOOOL!!!!1 ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) 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