object.Move command problem

Started by Klytos, Tue 14/04/2009 10:02:47

Previous topic - Next topic

Klytos

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x004400DE ; program pointer is +77, ACI version 2.72.920, gtags (8,80)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

in Room 19 script (line 534)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------

This may seem like a simple problem, but it's driving me nuts because as far as I can see, there's no reason for it to be happening.

Line 534 is
object[5].Move(232, 154, 4, eBlock, eAnywhere);

As you can see, there's nothing wrong with the code.

Here's how this problem started. I did nothing on this game for about 6 months, I had clean bill of health (ie it all worked properly and normally) prior to me doing nothing on it. I loaded it up again a week ago and some, not all, just some seemingly random object.Move commands are causing the game to crash. There are rooms where objects move and the game still works fine, and some other room, like this one I recorded the crash at, where it has started crashing. I really don't know how to define why this is happening, because it's started and I've done SFA to cause it, as far as I know.

I can block out that one line and the script runs fine. Yes the object is visible, and it's assigned to a legitimate view and loop.

Sorry if I sound grumpy, this is pissing me off.

~ Shawn

Gilbert

Hmmmm. Odd. I cannot come up with an explanation yet (maybe CJ knows better). The problem is, V2.72 is a bit old now so it may not be easy to find the true cause. Maybe it's fixed in V3. Maybe it's not. (I understand your position as the game has been started some time ago and yeah it may not be always safe to upgrade to V3 in such a case.)

My only advices at the moment are 1) check if you can find out what other stuff may be happening at the same time as that "move" (character animating, etc.), 2) try changing the parameters (the coordinates, the "eBlock", etc. parameters; you may even try leaving out some of the "e-" parameters to let the engine use the defaults) to the call and see if it makes any difference.

Also, in what place is this line located? (In a function of an interaction? Or in rep.exe, etc.?)

Klytos

(1) I'll have a look at that. Good suggestion. Thanks.
(2) I've previously changed all the parameters, and I've removed all the optional parameters. Nadda.
(3) It's in the "Use Inventory on Object" function. Here's the entire section code :

SetTimer(16, 0);
GiveScore(5);
cEgo.LockView(50);
cEgo.Animate(3, 5, eOnce, eBlock, eForwards);
cEgo.UnlockView();
cEgo.FaceCharacter(cHunter, eBlock);
object[5].Visible = true;
object[5].Move(232, 154, 4, eBlock, eAnywhere);
object[5].SetView(24, 11);
object[5].Animate(11, 5, eOnce, eBlock, eForwards);
cEgo.LoseInventory(iSpore);
cHunter.LockViewAligned(60, 5, eAlignLeft);
cHunter.Animate(5, 5, eOnce, eBlock, eForwards);
Display("&1793 Upon impact with the ground, the spore opens and spews its dust into the air. The hunter falls to the ground paralyzed.");
object[7].Clickable = false;
cHunter.Clickable = false;
object[8].Clickable = true;
cHunter.Solid = false;
SetTimer(17, 2000);

Gilbert

That's quite odd. The only thing I can think of at the moment is to try adding a Wait(1) after setting the object to Visible and before that move line. Maybe there will be problems when you move an invisible object (the Wait ensures the object is really visible before moving). I'm not sure about it and it's not likely to be the problem, it wouldn't hurt trying anyway.

Klytos

Wow. That was absolutely crazy stuff. Note to self and anyone wanting hints and tips about game development. Game developing is stupid. Do something else. Like talk to women. In real life.

I had decided to create a special mini-game about 5 months ago, one which I had completely forgotten about in the meantime. It was a GUI with arrow keys moving stuff, anyway, that's not important, what's important is that this module I had cleverly developed was a piece of crap and I am forever grateful that I went through my global script a module at a time before I went through it a line at a time.

Honestly though, I have no idea why this particular module (completely unrelated to these particular screens) would crash the game. Oh well, I just don't care now.

Pumaman

As Gilbet says, 2.72 is no longer supported but if you were getting a crash like that in AGS 3.x I would be keen to investigate the cause.

Anyway, glad you solved it.

SMF spam blocked by CleanTalk