Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Raider on Sun 21/05/2006 05:37:56

Title: Error while picking up object
Post by: Raider on Sun 21/05/2006 05:37:56
I have a problem with the global sript once again.
When I go to pick up an object the game crashes and the error comes up as:

(Global script line 564)
Error: ObjectOff: invalid object specified

The line 564 of my GS is:

/**/  else if (button==LEFT) {
/**/       if (GetCursorMode()==9) ProcessClick(mouse.x,mouse.y,MODE_WALK);
/**/       if (GlobalCondition(2) || GlobalCondition(3) || GlobalCondition(4)) SetMode("default");
/**/       else{
/**/        UpdateActionBar();
/**/        SetLabelColor(ACTION,0,ActionLabelColorHighlighted);
/**/        StrCopy(GSusedmode,GSmode);
/**/        GSagsusedmode=GetCursorMode();
/**/        ProcessClick(mouse.x, mouse.y, GetCursorMode() );
/**/        SetMode("default");
/**/       }
/**/  }

What is wrong with the code?
Title: Re: Error while picking up object
Post by: Gilbert on Sun 21/05/2006 06:12:18
The problem probably lies in the room/object interaction (that ProcessClick() would tell the engine to execute those interactions if any), check them and see if there's an attempt to turn of an inexistent object.