Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 05:54
So after finding a bug with how agk deletes images, I tried to go for a much more object-oriented solution(yay!).

Now the game crashes before it even gets going.

It crashes at the first assignment statement:



If this isn't a bug, some explanation would help.
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 06:04
More info, in case it's needed:

szID has values for the location and file name of one of the images I'm trying to load and value 'a'

It also appears to be the first item it's trying to load, which would make sense, because I can't place any breakpoints before the crash happens, so it apparently occurs before the Begin function is executed.
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 11:54
And just to be sure, I've now gotten the latest version of AGK...still crashes
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 12:01
Hey, I'm nothing if not persistent...

It happens when I check to see if a file exists.
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 12:15
If I decide not to go the safe route, and just load up whatever image comes along, it crashes at the same location.

Also, if I decide to pass a literal instead of a variable, it crashes on that as well.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Nov 2011 12:52
What's the HashIndex() function doing?

-- Jim
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 26th Nov 2011 12:54
Wish I knew. I think, I'm slowly tracking it down though.

Being a bit of a novice with C++, apparently, you cannot make really complex commands during initialization of an object.

I moved the complex commands to a different function, so I have an initialization, and then a setup. This has removed the bug for now...we'll see if it's a solution...
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 27th Nov 2011 01:28 Edited at: 27th Nov 2011 01:31
i don't like hash tables. It looks like you somehow going off the array somehow. If you use a vector instead of a hash table you can resize the vector accordingly. The problem I find with hash tables are they are static and not dynamic.
or you can change
cHashedItem *pItem = m_pHashedItems[ index ];
to
cHashedItem *pItem = m_pHashedItems[ index+1 ];

Go through yourself at a wall.
ManOfActionTM
13
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 27th Nov 2011 06:56
Yeah, the hash table was part of AGK's code, not mine.

But no worried (for now) I have worked around it by not putting so much complex code in the class initializer.

Login to post a reply

Server time is: 2024-11-22 15:00:44
Your offset time is: 2024-11-22 15:00:44