Author Topic: MODULE: Control Modes (BASS, SCUMM, Sierra All in One module)  (Read 4607 times)  Share 

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Well, here have this(you can set any possible interface and combinations of them with this module).

Abstract:
You can set BASS,


 SCUMM



or Sierra interface



to your game, fast and easy with this module. You can even have combinations of those three. Example: Have BASS interface and Sierra like GUI.


Downloads
Control Modes V1.0a
« Last Edit: 26 Jan 2010, 19:29 by Dualnames »

Rex Mundane

  • Second-Biggest Dairy Farmer you've ever seen
Trying to use the BASS module I ran into a problem with scrolling rooms, where I couldnt walk further to the right than the screenwidth coordinate. Ended up replacing "player.Walk(mouse.x, mouse.y, eNoBlock, eWalkableAreas);" with "ProcessClick(mouse.x,mouse.y,eModeWalkto);" and that fixed it. Just thought you should now if you wanted to update the module.

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Trying to use the BASS module I ran into a problem with scrolling rooms, where I couldnt walk further to the right than the screenwidth coordinate. Ended up replacing "player.Walk(mouse.x, mouse.y, eNoBlock, eWalkableAreas);" with "ProcessClick(mouse.x,mouse.y,eModeWalkto);" and that fixed it. Just thought you should now if you wanted to update the module.

Someone is using this module! Great I'll update it. Btw is 42 just a random number or ... you know..

Quote
bicilotti: Never say numbers near 42 in Dual's presence.

How make The Dig (LucasArts) interface? ???

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
First import the module.
Then you need is to find your mouse_on_click section in the globalscript script (not the header) and place only this (it should look like this, and there shouldn't be another on_mouse_click on the globalscript except for this)


[code]
function on_mouse_click(MouseButton *button) {
BASSFunctions.mouse_click(button,false);//exception on BASS: if you want left and right click reversed set reverse as true.
}
[/code]

NOTE: BASS should have HandleInventoryScripts as false in the General Settings

I haven't played the dig, so I don't recall its interface. If it's similar to BASS somehow and someone might explain it to me, I'd be happy to implement it.

NOTE: BASS should have HandleInventoryScripts as false in the General Settings

I assume you mean "Override built-in inventory window click handling" by that, Dual?

I'm running into a problem with the module. I suspect it's me not understanding how this works properly, so help would be appreciated. AGS version 3.2.0 by the way. Using BASS mode with the buttons reversed.

http://sslaxx.twu.net/Tester.7z - this is what I'm doing.

So, the game's set to change the pointer to eModeInteract on entering room 1. Fine, seems to work so far. Go to inventory, select the blue mug, click on OK, then click on the player. The cursor changes to eWalkTo, and then the inventory item(s) seem to become unselectable.

Help?
Stuart "Sslaxx" Moore.

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Insert this at line 97 of ControlModes.asc:

[code]      mouse.Mode = eModeInteract;[/code]

What happened is that upon de-selecting the inventory item, AGS moved to the next default cursor mode, in this case eModeWalk. Since you can't change the mode (as e.g. by right-clicking in the default game), you're stuck.

The problem is that you're using the reverse button order, i.e. if an inventory item is selected, you are supposed to right-click to use it and left-click to loose it (really unintuitive I'd say; I'd stick with a left click to interact/use items and a right click to examine/deselect the active inv). You left clicked to use the cup on Roger and actually de-selected the cup.

It's also worth noting that the module always calls the TalkTo event for characters, not the Interact event (I saw the interact roger test event).

---

Another way to deal with this problem is disabling eModeWalk.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Insert this at line 97 of ControlModes.asc:

[code]      mouse.Mode = eModeInteract;[/code]

What happened is that upon de-selecting the inventory item, AGS moved to the next default cursor mode, in this case eModeWalk. Since you can't change the mode (as e.g. by right-clicking in the default game), you're stuck.

The problem is that you're using the reverse button order, i.e. if an inventory item is selected, you are supposed to right-click to use it and left-click to loose it (really unintuitive I'd say; I'd stick with a left click to interact/use items and a right click to examine/deselect the active inv). You left clicked to use the cup on Roger and actually de-selected the cup.

It's also worth noting that the module always calls the TalkTo event for characters, not the Interact event (I saw the interact roger test event).
Thanks for that, Khris! I shall bear that in mind. And that change works nicely!
Stuart "Sslaxx" Moore.

Dumb question time - how do you go about coding an object's interaction with another object to work with the left mouse button?

OK:

[code] if ((reverse==false) && (click==eMouseLeft)|| (reverse==true) && (click==eMouseRight))
 {
  if (player.ActiveInventory!=null)
  {
   ProcessClick(mouse.x, mouse.y, eModeUseinv); 
   return;
  }
  ProcessClick(mouse.x, mouse.y, eModeLookat); 
 }
[/code]

So swapping the eMouseLeft and eMouseRight conditions should work as I want, so let's give it a go... and no, it doesn't appear to work. I'm not entirely sure why, any ideas anyone?
« Last Edit: 17 Nov 2010, 23:20 by Sslaxx »
Stuart "Sslaxx" Moore.

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Dumb question time - how do you go about coding an object's interaction with another object to work with the left mouse button?

OK:

[code] if ((reverse==false) && (click==eMouseLeft)|| (reverse==true) && (click==eMouseRight))
 {
  if (player.ActiveInventory!=null)
  {
   ProcessClick(mouse.x, mouse.y, eModeUseinv); 
   return;
  }
  ProcessClick(mouse.x, mouse.y, eModeLookat); 
 }
[/code]

So swapping the eMouseLeft and eMouseRight conditions should work as I want, so let's give it a go... and no, it doesn't appear to work. I'm not entirely sure why, any ideas anyone?

This is the module's internal code. Can I have your code?

I'd like to rule that out now. First I haven't touched that module for like ages, and I did a small fix. I'm using it for hourgames, and never had a problem with that, but that doesn't mean jack shit. So well, what I'm trying to say, is that I barely recall it anymore, but I recall after some tests that everything worked fine.

I also have no idea, what is it you want to do.
This code is run with either the left or right mouse button. If you want this to run with the left mouse button that means you need to set reverse to false.
If you have an item, you'll get the useinv interaction instead.

This is the module's internal code. Can I have your code?

I'd like to rule that out now. First I haven't touched that module for like ages, and I did a small fix. I'm using it for hourgames, and never had a problem with that, but that doesn't mean jack shit. So well, what I'm trying to say, is that I barely recall it anymore, but I recall after some tests that everything worked fine.

I also have no idea, what is it you want to do.
This code is run with either the left or right mouse button. If you want this to run with the left mouse button that means you need to set reverse to false.
If you have an item, you'll get the useinv interaction instead.
What do I want to do? As it stands, with the module, if I want to use an inventory item on another item I have to right-click on it - even though I've told the module to use the reversed BASS-type control system and would, therefore, expect left clicking to work (as left clicking == interacting).

http://sslaxx.twu.net/ControlModesTest.7z is the code if you want to take a closer look (AGS 3.2.0). Note I made the change to your code that Khris suggested.
Stuart "Sslaxx" Moore.

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
There fixed. That who the function inside the module should be. So replace. I've included the whole function. Also override built-in inventory window click handling on General Settings should be set to true.

Quote
However, if you enable this option, then clicking on an inventory item in an Inventory Window will call your on_mouse_click function with eMouseLeftInv, eMouseMiddleInv or eMouseRightInv

That means because you had it the false, the code wasn't even being runned as i checked. But regardless it needed a fix.

[code]
static function BASSFunctions::mouse_click(MouseButton click, bool reverse){
 //handle true
 Hotspot*htsp=Hotspot.GetAtScreenXY(mouse.x, mouse.y);
 InventoryItem*invitem=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
 if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y) != null) {
  if ((reverse==false) && (click==eMouseLeftInv) || (reverse==true) && (click==eMouseRightInv)){
   invitem.RunInteraction (eModeLookat);
  }
  if ((reverse==false) && (click==eMouseRightInv) || (reverse==true) && (click==eMouseLeftInv)){
  if (player.ActiveInventory!=null) {
  invitem.RunInteraction(eModeUseinv);
  }
  mouse.Mode=eModeUseinv;
   player.ActiveInventory=invitem;
  }
  return;
 }
 if ((reverse==false) && (click==eMouseRight)|| (reverse==true) && (click==eMouseLeft)) {
  if (player.ActiveInventory != null)  {
   ProcessClick(mouse.x, mouse.y, eModeUseinv); 
   return;
  }
  if (Character.GetAtScreenXY(mouse.x, mouse.y) != null)  {
   ProcessClick(mouse.x,mouse.y,eModeTalkto);  
   return;
  }
  if ((htsp!=null) && (htsp.ID>0) || (Object.GetAtScreenXY(mouse.x, mouse.y)!=null))  {
   ProcessClick(mouse.x,mouse.y,eModeInteract);  
   return;
  }
  ProcessClick(mouse.x,mouse.y,eModeWalkto);
 }
 if ((reverse==false) && (click==eMouseLeft) || (reverse==true) && (click==eMouseRight)) {
  if (player.ActiveInventory != null)  {
   player.ActiveInventory=null;
   mouse.Mode = eModeInteract;
   return;
  }  
ProcessClick(mouse.x, mouse.y, eModeLookat);  
 }
}
[/code]
« Last Edit: 18 Nov 2010, 19:21 by Dualnames »

There fixed. That who the function inside the module should be. So replace. I've included the whole function. Also override built-in inventory window click handling on General Settings should be set to true.

Quote
However, if you enable this option, then clicking on an inventory item in an Inventory Window will call your on_mouse_click function with eMouseLeftInv, eMouseMiddleInv or eMouseRightInv

That means because you had it the false, the code wasn't even being runned as i checked. But regardless it needed a fix.

NOTE: BASS should have HandleInventoryScripts as false in the General Settings
You said this earlier. But this refers to the same setting.

More pertinently, this still does not address the issue I've raised about interactions with inventory objects being inconsistent using the reversed BASS control system. To summarise:
* Left click to interact/talk to/walk to, right click to examine (with the reversed BASS control system).
* Logically, interacting with a hotspot with an inventory object should therefore use the left mouse button, yes?
* But it does not. It uses the right mouse button (examine) instead. This is not intuitive regarding the buttons functions.
« Last Edit: 18 Nov 2010, 13:17 by Sslaxx »
Stuart "Sslaxx" Moore.

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
Oh, sorry man, Xenogia also contacted me about this like 2 months ago, and I set up the module to his needs. Okay, see the code above your post. I've edited, so replace. It should work just fine now.

Hello!

I would like to use reversed BASS control. Everything are fine... .... except with the inventory :/
Right click(examine) is okay, but left click(interact) is not. When I interact with an item on my inventory, the cursor totally disappears. I set to "true" the "Override built-in inventory window click handling" in the general settings. The problem still here, the cursor disappears when I click on an item in my inventory :(

Anyway, I use AGS 3.2, and my game is very simple. I just use a default game to test this module.

Try replacing ControlModes.asc and ControlModes.ash with the files from http://sslaxx.twu.net/ControlModes.zip and see what happens, RoliX.
Stuart "Sslaxx" Moore.

Try replacing ControlModes.asc and ControlModes.ash with the files from http://sslaxx.twu.net/ControlModes.zip and see what happens, RoliX.

I replaced them with your files, but it still doesn't work :/  I have totally no clue about the issue..
Here is my source files if you're interested: http://www.sendspace.com/file/qv9rj5

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
RoliX, doesn't this http://www.bigbluecup.com/yabb/index.php?topic=38762.msg559900#msg559900 , solve your problem?

EDIT: I just saw your source files.
« Last Edit: 02 Mar 2011, 23:49 by Dualnames »

I've already tried that, but still doesn't work properly. I spent hours to fix that, but not much success... I can't see what's the problem, I'm beginner in scripting :/

Dualnames

  • Local Moderator
  • Dualnames worked on a game that was nominated for an AGS Award!
I've already tried that, but still doesn't work properly. I spent hours to fix that, but not much success... I can't see what's the problem, I'm beginner in scripting :/

Okay, it appears there's no problem. When you left click on an item, it changes the item to that cursor's image. Now, if that's not what you want let me know, but anyhow. So since that item (the blue cup) has no cursor image assigned to it. It makes the mouse cursor completely invisible. All you need to do therefore is set an image.