Cursor Modification wont allow me to use inventory item

Started by Zany, Wed 11/10/2017 10:03:23

Previous topic - Next topic

Zany

I modified my cursor so that it has only 2 views, 1 general and 1 which changes when I hover over a hotspot. The problem that I'm having is that when I need to take an emblem(inventory item) out of my inventory and place it somewhere it doesn't actually with hold the emblem(inventory item).

Slasher

Have you got this in general settings set to true?
Override built-in inventory window click handling
try setting it to false if not already.

Also, check that your inventory window height and width of items are set ok and that the hotspots of your inv items are positioned ok so the mouse interacts with them OK.


Khris

How exactly did you modify the cursors? Which cursor modes is your game using?
If inventory clicks are handled by the engine (the default setting) the proper cursor mode to pick up an inventory item is eModeInteract.

Zany

Okay checked those and it all looks in order...

I'm using this:
function repeatedly_execute() {
 
  if (IsGamePaused() == 1) return;
 
  UpdateMouseGraphic();
  CustomizeIconBar();
 
  int mm = mouse.Mode;
  int nm; // newMode
 
  Hotspot *h;
  Object *o;
 
  int lt = GetLocationType(mouse.x,  mouse.y);
 
  if (nm != eModeUseinv){
    if(lt == eLocationNothing) nm = eModeWalkto;
      if(lt == eLocationHotspot){
        h = Hotspot.GetAtScreenXY(mouse.x,  mouse.y);
        nm = h.GetProperty("def_curs");
      }
      if(lt == eLocationObject){
        o = Object.GetAtScreenXY(mouse.x,  mouse.y);
        nm = o.GetProperty("def_curs");
      }
      if(lt == eLocationCharacter){
        nm = eModeTalkto;
      }
      if(nm != mm)mouse.Mode = nm;

dayowlron

could be wrong but I think your testing new mode whether is it eModeUseinv. If you just change that line to:
if (mm != eModeUseinv){
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell


Khris

That code looks suspiciously like something I may have written; did you get that from the forum? Because if that error is in the original code, I'd like to fix it.

Mandle

Quote from: Khris on Thu 12/10/2017 14:08:24
That code looks suspiciously like something I may have written; did you get that from the forum? Because if that error is in the original code, I'd like to fix it.

Is it this one:

http://www.adventuregamestudio.co.uk/forums/index.php?topic=46959.msg631494#msg631494

Probably not but kind of on the right track maybe?

Zany

Yes I did get the code from the forum lolz and yes you did post it previously, your code is really helpful. Thanks

SMF spam blocked by CleanTalk