Custom Interface and Inventory woes

Started by Milo87, Thu 24/06/2010 02:19:41

Previous topic - Next topic

Milo87

Hey forum peeps. For my reboot of Dark Lake, I've implemented a completely custom interface based around the Broken Sword model (ie intelligent cursors). This is all well and good, with liberal use of the rep_ex function, but now I've run into problems with a custom inventory.

When I select an inventory object, the cursor doesn't change to the object in question. Handle Inventory Clicks in Script it set to False, which was the first thing I checked. I looked through the basic game template to see how Inventories are handled, but couldn't find anything useful. I also figured it was something to do with my rep_ex, which repeatedly checks what the cursor is over, and changes to the appropriate mode. I tried (player.ActiveInventory == null) before checking whether to change cursor mode, but no joy.

Can anyone help?

DrewCCU

try checking out Mouse Functions and Properties in the AGS help file.  Theres a lot of things in there that you may find useful.
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

Dualnames

You may have "Use inventory sprites as cursor graphics"(or whatever that property is called) set to false. A post of the code would be wise as well.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Milo87

Dualnames, it is set to true, it's one of the things I checked. Forgot to mention that in my first post.

Here's my run_interface script, which is called in rep_ex:

Code: ags
function run_interface()
{
  int locationType = GetLocationType(mouse.x, mouse.y);
  
  if(!GetRoomProperty("Title Screen") && !IsGamePaused())
  {
    if(GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
    {
      Hotspot *hotspotAtMouse = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      
      int dir;
    
      if(hotspotAtMouse.GetProperty("Exit"))
      {
        dir = hotspotAtMouse.GetProperty("Exit Direction");
        mouse.Mode = eModeExit;
        mouse.ChangeModeGraphic(eModeExit, 13+dir);
      }
      else
      {
        mouse.Mode = eModeInteract;
      }
    }
  
    else if(locationType == eLocationCharacter) mouse.Mode = eModeTalkto;
 
    else if(locationType == eLocationObject) mouse.Mode = eModePickup;
  
    else if(locationType == eLocationNothing) mouse.Mode = eModeWalkto;
  }
    
  else
  {
    mouse.Mode = eModePointer;
  }

//And some other stuff, not related to the cursor modes

}

Khris

So where's the check for player.ActiveInventory being != null?

Milo87

Whoops, I deleted because it wasn't working. Forgot to put it in on here.

I tried this:

Code: ags
if(!GetRoomProperty("Title Screen") && !IsGamePaused() && player.ActiveInventory == null)


Although never having made an interface from scratch, it was just educated guessing.

Milo87

Sorry to bump this, but I still haven't worked it out and it's been really bugging me D: Can anyone help?

SMF spam blocked by CleanTalk