Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: deltamatrix on Fri 19/09/2003 02:03:17

Title: unhandled_event bug (I hope)
Post by: deltamatrix on Fri 19/09/2003 02:03:17
I've found a possible bug with the unhandled_event function where the Interact type ain't being called if the hotspot has an Any Click function working.

EDIT: Hmmm. Come to think of it. This is redundant.

I've been trying to design my own lucasarts style GUI and I've been using different cursor modes. I've also added two new cursor modes but you can't set up an interaction for them.

Can this soon be possible?
Title: Re:unhandled_event bug (I hope)
Post by: Ishmael on Fri 19/09/2003 10:47:31
Isn't the unhaldeled_event called only when the hotspot or object or so has no interaction for the current cursor mode, and if it has a 'any click' interaction, it serves for all cursor modes, so the unhandeled_event isn't meant to be called.

To get the extra cursor modes, say you use GlobalInt 80 to keep track on which mode is used, you just need to put

if (GetGlobalInt(80)==1) { // if, say, 'Push' mode is number 1, and the user clicked on the hotspot with the Push mode
DisplaySpeech(EGO,"I can't move it");
}

or something.
Title: Re:unhandled_event bug (I hope)
Post by: deltamatrix on Fri 19/09/2003 14:08:59
Never mind. I don't usz Any Click no more.

I now use hotspot property text for those extra cursormodes

Heres the code for the actions Move, Smell and Kill.

function on_mouse_click(int button) {
 int hotty;
 string buffer;
 hotty = GetHotspotAt(mouse.x, mouse.y);
 
 if (IsGamePaused() == 1) {
 }
 else if (button==LEFT) {
   ProcessClick(mouse.x, mouse.y, GetCursorMode() );
   if (GetCursorMode()== 6 && GetLocationType(mouse.x,mouse.y)!= 0) {
     GetHotspotPropertyText(hotty, "kill", buffer);
   if (StrComp(buffer, "0")==1) DisplaySpeech(EGO, buffer);
   else DisplaySpeech(EGO, "That would be totally stupid");
   }
   if (GetCursorMode()== 10 && GetLocationType(mouse.x,mouse.y)!= 0) {
     GetHotspotPropertyText(hotty, "move", buffer);
   if (StrComp(buffer, "0")==1) DisplaySpeech(EGO, buffer);
   else DisplaySpeech(EGO, "I can't move it");
   }
       
   if (GetCursorMode()== 11 && GetLocationType(mouse.x,mouse.y)!= 0) {
     GetHotspotPropertyText(hotty, "smell", buffer);
   if (StrComp(buffer, "0")==1) DisplaySpeech(EGO, buffer);
   else DisplaySpeech(EGO, "It doesn't smell of anything");
   }
       
   SetCursorMode(0);
 }
}

The only thing that ain't done yet is actions. But this addresses the unhandled_event issue.