Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ubel on Thu 05/05/2005 14:52:24

Title: Changin order of cursor modes.
Post by: Ubel on Thu 05/05/2005 14:52:24
I'm working on a MAGS game and I want to have these different cursor modes in it: walk, look, use, take, talk. I know how to make new cursor modes and how to use them. But if I make a new one, it will appear after the use inventory mode. So when I right click my mouse, the cursor modes come like this: walk-look-use-talk-active inventory item-take. I want to change the place of take mode before the active item. I remember Darth Mandarbs "A Friend Indeed" had same kind of problem and it was pretty annoying.

I hope you understand what I mean.
Title: Re: Changin order of cursor modes.
Post by: strazer on Thu 05/05/2005 15:01:54
You could replace
  SetNextCursorMode();
with

  if (GetCursorMode() == 2) // if in interact mode
    SetCursorMode(5); // switch to pick up mode
  else if (GetCursorMode() == 5) // if in pick up mode
    SetCursorMode(3); // switch to talk mode
  else if (GetCursorMode() == 3) // if in talk mode
    SetCursorMode(0); // switch to walk mode
  else SetNextCursorMode();

for example.
Remember to check "Standard cursor mode" for the pick up cursor.
Title: Re: Changin order of cursor modes.
Post by: Ubel on Thu 05/05/2005 15:16:42
Thanks for replying.

That could work but now it's not switching to use_inv mode with the right mouse button at all.
Title: Re: Changin order of cursor modes.
Post by: strazer on Thu 05/05/2005 15:25:46
I thought you didn't want that:

Quotewalk, look, use, take, talk

Do you mean use=use inv?
Or should the use inv mode be after the talk mode?

If so, just change

  else if (GetCursorMode() == 3) // if in talk mode
    SetCursorMode(0); // switch to walk mode

to

  else if (GetCursorMode() == 4) // if in use inv mode
    SetCursorMode(0); // switch to walk mode
Title: Re: Changin order of cursor modes.
Post by: Ubel on Thu 05/05/2005 15:35:55
Yes, thats what I meant. Thank you for your help. :) And sorry if the first post wasn't very clear. :P

EDIT: Wait a minute. That didn't work as it was supposed to. If I have chosen an inventory item, the cycle goes like this: Walk, look, use, take, talk, active inventory. That is correct. But if I haven't chosen an item, it goes like this: Walk, look, use, take, talk, take, talk, take, talk...etc. What should I do?
Title: Re: Changin order of cursor modes.
Post by: strazer on Thu 05/05/2005 15:51:03
Ah, right, of course the use inv mode is disabled when no inventory item is active, so (using AGS v2.7 code):


  if (mouse.Mode == 2) // if in interact mode
    mouse.Mode = 5; // switch to pick up mode
  else if (mouse.Mode == 5) // if in pick up mode
    mouse.Mode = 3; // switch to talk mode
  else if ((mouse.Mode == 3) && (player.ActiveInventory == null)) // if in talk mode and no inv item is active
    mouse.Mode = 0; // switch to walk mode
  }
  else if (mouse.Mode == 4) { // if in use inv mode
    mouse.Mode = 0; // switch to walk mode
  }
  else mouse.SelectNextMode();


You can replace the numbers with the enums generated by your cursor mode names to make it more readable.
Title: Re: Changin order of cursor modes.
Post by: Ubel on Thu 05/05/2005 16:22:24
Now it works! Thank you (again)! And sorry for taking your time this much.
Title: Re: Changin order of cursor modes.
Post by: strazer on Thu 05/05/2005 17:02:32
No worries, I'm always happy to help. :)