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?
try checking out Mouse Functions and Properties in the AGS help file. Theres a lot of things in there that you may find useful.
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.
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:
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
}
So where's the check for player.ActiveInventory being != null?
Whoops, I deleted because it wasn't working. Forgot to put it in on here.
I tried this:
if(!GetRoomProperty("Title Screen") && !IsGamePaused() && player.ActiveInventory == null)
Although never having made an interface from scratch, it was just educated guessing.
Sorry to bump this, but I still haven't worked it out and it's been really bugging me D: Can anyone help?