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 - bx83

#361
Yep, it's a boolean :P

Okay - a real error. I've noticed a strange transition flicker. This didn't happen in ags 3.5.0. b5:

https://redrom.ltd/img/noclick.mp4

but does happen in b6:

https://redrom.ltd/img/clickb6.mp4

Same code; room transitions for every room (except doing instant transition occasionally) are affected. I've done nothing except set the room transition to Crossfade in General Settings, and instantiated with .ChangeRoom; no other code.

I'm using openGL for my compiled exe and debug mode game.
#362
Just a small question, probably staring me in the face: what is function RemoveActiveInventory()?
Can't find any documentation on it, can't find any posts on it, seems self-explanatory, but when I type it in I just get "parse error at lines 123". That's it.
Works the same as RemoveActiveInventory (no functiopn brackets).
Is it just the same thing as cCharacter.ActiveInentory=null?
#363
Also: It ignores 'SetMultitaskingMode(0);' - clicking outside the window doesn't pause the game.
#364
And (just to ask yet more questions), is there a way to set volumes for each sound type? Eg. Music, Sounds, ExtraSounds, Footprints, SomeOtherTypeIMadeUp, etc..
#365
Is there a way to amplify sound that's already there?
If I have a slider, can I set it to 200 and have the volume in/decrease from 100%?
Or is 100% the max, no amplification?
#366
https://redrom.ltd/img/room27.zip

No scaling set in script, except under conditions of a variable not set at the time.
#367
I changed the shape of my walkable area several times, running the game to check each time. It was always on continuous, but perhaps I flipped it to non-continuous scaling, then back again. At some point, continuous scaling didn't work anymore. It didn't matter if I left the room and returned, or saved the room, exited the editor, then went back again.
I changed the walkable area to 2, from 1, copied the continuous scaling values to it, and it worked again.
#368
Continuous scaling on one of my walkable areas failed and I had to change ID (from 1 to 2) to get it back. Heads up.
#369
I've solved it, mainly for seeing there was an error in UpdateMouseGraphic() which replaced it each time with a newly initiated int (which I thought always had a default value assigned somewhere in the function, but only in the if mode==something blocks).

Basically this system will:

Outside the inventory:
cycle up and down the inventory icons of activeinventory, walkto, lookat, use, and talk to with mousewheelup/down
Right clicking does nothing.
Left clicking applies the mouse mode to the surface below the cursor; or, if there is no surfaces you click on that will respond to this mode, then you walk there (same as Sam and Max and probably 400 other adventure games)

Inside inventory:
Left click looks at inventory items and give you a description of them
Right click will load an item as the activeinventory; then you can Left click on another item, it will runs the target item's itarget_useinv(), and then return the cursor to 'look at' and make activeinveory = null (right clicking with an activeinventory!=null does nothing)

Here's the code:

Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
 
  
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    if (RemoveActiveInventory) {
      player.ActiveInventory=null;
      RemoveActiveInventory=false;
    }
    
    //move up through inventory with mouse wheel
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    //move down through inventory with mouse wheel
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (tInv.IsInteractionAvailable(eModeUseinv)) {
        if (player.ActiveInventory==null) {
          player.ActiveInventory=inventory[game.inv_activated];
          mouse.ChangeModeGraphic(eModeUseinv, inventory[game.inv_activated].CursorGraphic);
        }
      }
    }
   
    if (button == eMouseLeftInv) {
      if (player.ActiveInventory!=null) {
        tInv.RunInteraction(eModeUseinv);
        mouse.Mode=eModeLookat;
        RemoveActiveInventory=true;
      } else {
        mouse.Mode=eModeLookat;
        player.ActiveInventory=null;
        tInv.RunInteraction(eModeLookat);
      }
    }    
    
  } else {                          //if inventory *is not* visible

    if (button == eMouseLeft) {
      if (SamAndMaxInterface) {
        int lt = GetLocationType(mouse.x, mouse.y);
        if (lt == eLocationNothing) {
          Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
        } else {
          if (
            (mouse.Mode==eModeInteract && !IsInteractionAvailable(mouse.x, mouse.y, eModeInteract)) ||
            (mouse.Mode==eModeLookat && !IsInteractionAvailable(mouse.x, mouse.y, eModeLookat)) ||
            (mouse.Mode==eModeTalkto && !IsInteractionAvailable(mouse.x, mouse.y, eModeTalkto))
             )
          {
            Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
          } else {
            Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
          }
        }
      }
    }

    // cycle cursor 'forwards;
    if (button == eMouseWheelSouth) {
      mouse.SelectNextMode();
    }

    // Cycle the cursors 'backwards'
    if (button == eMouseWheelNorth) {
      if (SamAndMaxInterface) {
        if (mouse.Mode > 0) {                                                 // If mode isn't WALK, set the previous mode (notice usage of numbers instead of eNums)
          mouse.Mode = mouse.Mode-1; 
        } else { 
          if (player.ActiveInventory != null) {                               // WALK mode, and the player has a selected inventory item?
            mouse.Mode = eModeUseinv;                                         // Set mouse mode to UseInv
          } else {
            mouse.Mode = eModeTalkto;     // Otherwise just set it to mode TALK (change this line if you add more cursor modes)
          }
        }
      }
    }

  }
  
}


Code: ags

function UpdateMouseGraphic()
{
  int newGraphic;                                               // = 2054;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (gInventory.Visible)
  {
    if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      if (player.ActiveInventory==null) mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }
    
    if (mouse.Mode == eModeLookat) {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        if (player.ActiveInventory==null) {
          newGraphic = 2056;                                    // eye open
        }
      }
    } 
    
    if (mouse.Mode==eModeWalkto) {
      if (newGraphic==0) {
        player.ActiveInventory=null;
        mouse.Mode=eModeLookat;
      }
    }

  } else {
    if (mouse.Mode == eModeUseinv)
    {
    // Display("you clicked an inventory item");
      return;
    }
    if (mouse.Mode == eModeWalkto)
    {
      newGraphic = 3;                                           // stand still
      if (gInventory.Visible == true)
      {
      }
      else
      if (GetWalkableAreaAtRoom(mouse.x, mouse.y)!=0)
      {
        newGraphic = 2054;                                      // walking
      }
    }
    else if (mouse.Mode == eModeLookat)                              // LOOKAT
    {
      newGraphic = 105;                                         // eye close
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    // Looking at item in inventory

      if (gInventory.Visible == true && inve != null)
      {
        if (inve.IsInteractionAvailable(eModeLookat))
        {
          newGraphic = 2056;                                    // eye open
        }
      } else {
        if (lt == eLocationHotspot)
        {
          if (hs != hotspot[0])
          {
            if (hs.GetProperty("hidden") == false)
            {
              if(hs.IsInteractionAvailable(eModeLookat))
              {
                newGraphic = 2056;                              // eye open
              }
            }
          }
        }
        else if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeLookat))
            {
              newGraphic = 2056;
            }
          }
        }
        else if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true)
        {
          newGraphic = 2056;                                    // eye open
        }
      }
    }
    else if (mouse.Mode==eModeInteract)                              // INTERACTION
    {
      newGraphic = 2;                                           // interact off
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    //  Interacting with inventory item

      if (gInventory.Visible == true && inve != null)
      {
        if (inve.IsInteractionAvailable(eModeLookat))
        {
          newGraphic = 286;
        }
      }
      else
      {

    // Interacting with hotspot

        if (hs != hotspot[0])
        {
          if (hs.GetProperty("hidden") == false)
          {
            if (hs.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }

    // Interacting with object
    // else if ((mouse.x <=eLocationObject-5 || mouse.x>=eLocationObject+5) && (mouse.y<=eLocationObject-5 || mouse.y>=eLocationObject+5)) {

        else if (lt == eLocationObject)
        {
          if (ob.Visible)
          {
            if (ob.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }
        
        //interacting with character
        else if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }
      }
    }
    else if (mouse.Mode == eModeTalkto)                                // TALKTO
    {
      newGraphic = 2058;                                          // talk off
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null)
      {
      }
      else
      {
        if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeTalkto))
            {
              if (ch.GetProperty("convodone")==0) {
                newGraphic = 213;                                   // talk on
              }
            }
          }
        }
        else
        if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto))
        {
          if (ob.GetProperty("convodone")==0) {
            newGraphic = 213;
          }
        }
      }
    }
  }

  if (mouse.Mode!=eModeUseinv) {
    if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
      mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
    }
  }
  
}


Code: ags

function show_inventory_window() 
{
  gInventory.Visible = true;
  PreviousMouseModeOutsideInventory = mouse.Mode;
  if (player.ActiveInventory==null) mouse.Mode=eModeLookat;
}


And also, General Settings -> Inventory -> Override built-in inventory clicking to TRUE

Hope this helps someone - thank you all for your time and problem solving :)
#370
Sorry Khris, I provided lots of documentation about it; I wasn't frustrated, just surprised no one got back to me in a day.
That is basic; I was about to do something like that but thought I'd wait for a response which was going to be 'you forgot a semi colon' after doing hours of deugging last night and thisarvo.

It reports the mode is 4 (useinv) and graphic is 0 (ie. nothing - odd it's not a blue cup, so it must be 'null'). Something is making it 0; I managed to press M at the exact moment I right-clicked, it showed the standard icon and then said mode=4 and graphic=626.
Something is resetting it, I don't know what.
#372
Tried adding the line:
Code: ags

if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      if (player.ActiveInventory==null) mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }

And now coming back out of the inventory, the icon is the useinv activeintentory icon (use rope with plantlife etc.), rather than the last used icon outside of inventory, but the icon is *still blank*.
So the activeinventory icon is being made blank somehow. If I cycle with mousewheelnorth/south outside the inventory, it then goes to the other icons; when I come back to activeinventory icon, the icon is *restored* to the old. God knows why, but this is useful information to someone who isn't me I hope :P

Video: https://redrom.ltd/img/mouseclickdemo2.mp4
#373
Here's a video of it happening.

https://redrom.ltd/img/mouseclickdemo.mp4

I start off by cycling forward and back in the walk/look/use/talk icons, with mouse wheel up/down.
I then demonstrate what happens when I press somewhere: If I press with look on a blank, does-not-have-a-look-interaction surface, Julius (main character) walks there. If I come on a visible surface with look interaction, it does this ('it's a bed of who's who of plant life').
I go to the inventory, and my last icon outside it saved. When I enter the inventory, my icon is Look; click left mouse button, it looks at an inventory item. Or if I right click, the icon goes (for about 20 cycles) to the cursor graphic of the item underneath the mouse, and then blank. If I move it around, I can still run a Use interaction on whatever inventory item I'm over (so, use rope on rope, use rope on knife, etc.) but the icon remains blank. Until I either a) left click something (and it goes back to Look icon), or I b) leave the inventory (in which case it defaults back to the last action I did before entering the inventory.



The Icon for useinv is Blank *anywhere in, around, or near the inventory object* - not just the inventory items:



Something to do with this line in UpdateMouseGraphic(), obviously:
Code: ags

  if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }


Here's my Default Setup:


Here's my General Settings:



As usual, answer's staring my in the face but I don't know what it is :/
#374
Okay here's all the complete functions relating to Inventory stuff:

Code: ags

function show_inventory_window() 
{
  gInventory.Visible = true;

  PreviousMouseModeOutsideInventory = mouse.Mode;

  mouse.Mode=eModeLookat;
}



Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    //move up through inventory with mouse wheel
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    //move down through inventory with mouse wheel
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (player.ActiveInventory==null) {
        player.ActiveInventory=inventory[game.inv_activated];
      } else {
        tInv.RunInteraction(eModeUseinv);
      }
    }
   
    if (button == eMouseLeftInv) {
      mouse.Mode=eModeLookat;
      player.ActiveInventory=null;
      tInv.RunInteraction(eModeLookat);
    }    

  } else {                          //if inventory *is not* visible

    if (button == eMouseLeft) {
      if (SamAndMaxInterface) {
        int lt = GetLocationType(mouse.x, mouse.y);
        if (lt == eLocationNothing) {
          Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
        } else {
          if (
            (mouse.Mode==eModeInteract && !IsInteractionAvailable(mouse.x, mouse.y, eModeInteract)) ||
            (mouse.Mode==eModeLookat && !IsInteractionAvailable(mouse.x, mouse.y, eModeLookat)) ||
            (mouse.Mode==eModeTalkto && !IsInteractionAvailable(mouse.x, mouse.y, eModeTalkto))
             )
          {
            Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
          } else {
            //if (player.Room!=RM_W_VIL_OS && 
            Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
          }
        }
      }
    }

    // cycle cursor 'forwards;
    if (button == eMouseWheelSouth) {
      mouse.SelectNextMode();
    }

    // Cycle the cursors 'backwards'
    if (button == eMouseWheelNorth) {
      if (SamAndMaxInterface) {
        if (mouse.Mode > 0) {                                                 // If mode isn't WALK, set the previous mode (notice usage of numbers instead of eNums)
          mouse.Mode = mouse.Mode-1; 
        } else { 
          if (player.ActiveInventory != null) {                               // WALK mode, and the player has a selected inventory item?
            mouse.Mode = eModeUseinv;                                         // Set mouse mode to UseInv
          } else {
            mouse.Mode = eModeTalkto;     // Otherwise just set it to mode TALK (change this line if you add more cursor modes)
          }
        }
      }
    }

  }
  
}


Code: ags

function UpdateMouseGraphic()
{
  int newGraphic;                                               // = 2054;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (gInventory.Visible)
  {
    if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }
    
    if (mouse.Mode == eModeLookat) {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 2056;                                    // eye open
      }
    }
    
    if (mouse.Mode==eModeInteract) {                             // INTERACTION
      newGraphic = 2;                                           // interact off
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 286;                                      // interact on
        
      }
    }
  } else {
    if (mouse.Mode == eModeUseinv)
    {
      return;
    }
    if (mouse.Mode == eModeWalkto)
    {
      newGraphic = 3;                                           // stand still
      if (gInventory.Visible == true)
      {
      } else if (GetWalkableAreaAtRoom(mouse.x, mouse.y)!=0) {
        newGraphic = 2054;                                      // walking
      }
    } else
     if (mouse.Mode == eModeLookat)  {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    // Looking at item in inventory

      if (gInventory.Visible == true && inve != null) {
        if (inve.IsInteractionAvailable(eModeLookat)) {
          newGraphic = 2056;                                    // eye open
        }
      } else {
        if (lt == eLocationHotspot) {
          if (hs != hotspot[0]) {
            if (hs.GetProperty("hidden") == false) {
              if(hs.IsInteractionAvailable(eModeLookat)) {
                newGraphic = 2056;                              // eye open
              }
            }
          }
        } else
        if (lt == eLocationCharacter) {
          if (ch != null) {
            if (ch.IsInteractionAvailable(eModeLookat)) {
              newGraphic = 2056;
            }
          }
        } else
           if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true) {
          newGraphic = 2056;                                    // eye open
        }
      }
    } else
      if (mouse.Mode==eModeInteract)  {                            // INTERACTION
      newGraphic = 2;                                           // interact off
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null)  {
        if (inve.IsInteractionAvailable(eModeLookat))  {
          newGraphic = 286;
        }
      } else {

        if (hs != hotspot[0]) {
          if (hs.GetProperty("hidden") == false) {
            if (hs.IsInteractionAvailable(eModeInteract)) {
              newGraphic = 286;
            }
          }
        }

        else if (lt == eLocationObject) {
          if (ob.Visible) {
            if (ob.IsInteractionAvailable(eModeInteract)) {
              newGraphic = 286;
            }
          }
        } else
          if (lt == eLocationCharacter)  {
           if (ch != null)  {
             if (ch.IsInteractionAvailable(eModeInteract)) {
               newGraphic = 286;
             }
           }
         }
       }
    } else
      if (mouse.Mode == eModeTalkto)  {                              // TALKTO
      newGraphic = 2058;                                          // talk off
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null) {
      } else {
        if (lt == eLocationCharacter) {
          if (ch != null)  {
            if (ch.IsInteractionAvailable(eModeTalkto))  {
              if (ch.GetProperty("convodone")==0) {
                newGraphic = 213;                                   // talk on
              }
            }
          }
        }
        else
        if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto))  {
          if (ob.GetProperty("convodone")==0) {
            newGraphic = 213;
          }
        }
      }
    }
  }

  if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
    mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
  }
  
}


I think that's it, if you want me to post other functions I will.
ps SamAndMaxInterface is a variable which is always true, it shouldn't be there now, but whatevs.
#375
All suggestions welcome, I'm afk for 8 hours sleeping in the darkened, freezing nighttime of Sydney Australia.
#376
Perhaps I should have a mouse.Mode==eModeUseInv in UpdateMouseGraphic() below eModeInteract block?
#377
The game now works, except right clicking something in the inventory (when activeitem==null) will cause the cursor to change to the inventory item cursor graphic, and then disappear .5 of a second later. It still runs UseInv on whatever else you click in the inventory; but the mouse cursor is nothing until you get out of inventory.

on_mouse_click:
Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
 
  
  } else
  if (gInventory.Visible) {                                             // if inventory is visible...
    
    //move up through inventory with mouse wheel
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    //move down through inventory with mouse wheel
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (player.ActiveInventory==null) {
        player.ActiveInventory=inventory[game.inv_activated];
      } else {
        tInv.RunInteraction(eModeUseinv);
      }
    }
   
    if (button == eMouseLeftInv) {
      mouse.Mode=eModeLookat;
      player.ActiveInventory=null;
      tInv.RunInteraction(eModeLookat);
    }


UpdateMouseGraphic (which I call whenever the mouse moves):
Code: ags

function UpdateMouseGraphic()
{
  int newGraphic;                                               // = 2054;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (gInventory.Visible)
  {
    if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }
    
    if (mouse.Mode == eModeLookat) {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 2056;                                    // eye open
      }
    }
    
    
    if (mouse.Mode==eModeInteract) {                             // INTERACTION
      newGraphic = 2;                                           // interact off
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 286;                                      // interact on
      }
    }

  } else {


The only other place that mentions UseInv is:
Code: ags

function btnIconCurInv_Click(GUIControl* control, MouseButton button)
{
  if (player.ActiveInventory != null) mouse.Mode = eModeUseinv;
}


Basically, I want to know why running ModeUseInv or loading the .CursorGraphic (as the cursor) of the target inventory item would make it *not have any mouse graphic at all*.

#378
But why don't the lines:
Code: ags

      if (player.ActiveInventory==null) {
        if (tInv.IsInteractionAvailable(eModeInteract)) {
          tInv.RunInteraction(eModeInteract);

do anything? Surely they should make the inventory item you just right-clicked on the ActiveInventory?
#379
Oh woops :P

Okay well now left mouse button works (look at).
But the right mouse button does nothing. At all.
#380
Okay will try this.
I've goth this:
Code: ags

function on_mouse_click(MouseButton button)
{

...

    InventoryItem *tInv;
   
    if (button == eMouseRightInv) {
      tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
      if (player.ActiveInventory==null) {
        if (tInv.IsInteractionAvailable(eModeInteract)) {
          tInv.RunInteraction(eModeInteract);
        }
      } else if (player.ActiveInventory!=null) {
        player.ActiveInventory==null;
      }
    }
   
    if (button == eMouseLeftInv) {
      tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
      
      if (tInv.IsInteractionAvailable(eModeLookat)) {
        tInv.RunInteraction(eModeLookat);
      }
    } 


...but there's an error on line 15: GlobalScript.asc(1708): Error (line 1708): PE04: parse error at 'player'
Works in if, but not on it's own.


SMF spam blocked by CleanTalk