Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - FrozenMonkey86

#2
Hi,

I'm pretty new to scripting and I'm trying to use 2 "on_event" functions in my global script. I've been searching the online help guides and forum posts for most of the day and can't find the answer I'm looking for. I've tried playing around with the function names and variables and nesting the two functions inside each other but nothing seems to work. Anyway, my first on_event returns the mouse pointer to the interact icon after two items have been combined in the inventory (it previously defaulted to WalkTo mode) - This one works fine. My second is to close the inventory screen with a right mouse-click (obviously AGS comes back with on_event already defined).

Code: ags

function on_event(int event, int data) 
{
  if (event == eEventLoseInventory) { //loseInventory
    if ((gInventory.Visible==true) && (mouse.Mode == eModeWalkto)){
        Mouse.Mode=eModeInteract;
        
    }
  }
}

function on_event(int event, int data);
{
  if ((event == eEventGUIMouseDown) && (mouse.IsButtonDown==eMouseRight)){
  gInventory.Visible=false;
  }
}


I know that it makes no sense to have two identically named on_event functions, but I thought it would make it easier to explain what I'm trying to do. Any help would be greatly appreciated!

Thanks,
SMF spam blocked by CleanTalk