Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rocco on Sun 25/04/2004 16:31:45

Title: Problem - BUG?
Post by: Rocco on Sun 25/04/2004 16:31:45
I have some action, where i wanted the player only to watch for this reason.
Initally this action start with an inventory is used on a hotspot.
then the action is running, and i place this code after:

DisableCursorMode(0);
DisableCursorMode(1);
DisableCursorMode(2);
DisableCursorMode(3);
SetMouseCursor(6);

Now i have the the pointer, but if im klicking on a hotspot i get the inventory item i used before and the playercharacter reacts on this, which is not good.
so im inserting:

SetActiveInventory(-1);

but then the game chrashes and i get this error-message if i klick on a hotspot with the pointer.

(ACI version 2.61.730)

(Global script line 321)
Error: GetInvName: invalid inventory item specified

Title: Re:Problem - BUG?
Post by: on Sun 25/04/2004 16:38:26
SetMouseCursor(); only changes the cursor graphic, not the mode.

DisableCursorMode(0);
DisableCursorMode(1);
DisableCursorMode(2);
DisableCursorMode(3);
SetCursorMode(6);

should do the trick. If not, what does it actually say on line 321, as that's causing the crash.
Title: Re:Problem - BUG?
Post by: Do0kie on Sun 02/05/2004 00:11:01
Actually, I get this error all the time and it's slowly but surely freaking me out. However I noticed this error is a bit random. It can happen now, and the next time I try the exact same thing I get no error. :o
Guess I'll have to check the script line next time the error shows up.
Title: Re: Problem - BUG?
Post by: Pumaman on Sun 02/05/2004 13:57:26
If you do SetActiveInventory(-1), and then you later try to get the current inventory name with GetInvName, this error will happen since there is no inventory item.

Post the your script around line 321 and we can probably tell you how to fix it.
Title: Re: Problem - BUG?
Post by: Akumayo on Mon 03/05/2004 23:58:48
I have noticed some random errors as well (though not this one) like sometimes, while adding script to a function, when I save, I get a nested functions not supported error, but if I delete the function, and rewrite the same script, it works!

That was all one sentence!
Title: Re: Problem - BUG?
Post by: Pumaman on Tue 04/05/2004 20:39:16
That usually happens if you forget a closing brace }  in your function.