Author Topic: [MODULE] SingleCursor 1.1  (Read 4159 times)

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
[MODULE] SingleCursor 1.1
« on: 12 Sep 2011, 16:54 »
Since I can't seem to post in the Modules board anymore, here goes:

Following this thread there seemed to be a demand for an updated single-cursor / two-click interface, also known as Broken Sword / BASS controls, and since I've scripted several permutations of it for my own projects I thought I'd compile it all into an easy-to-use module for you guys.

With LMB you perform the WalkTo/Interact/Talk action, and with RMB the LookAt action. There is also an optional extention for when you have a custom inventory, which puts select/combine on your LMB and deselect/examine on your RMB. If you want you can also swap this configuration around.

Download

After you import the module, follow these three steps to get everything working:

1. Remove the entire on_mouse_click function from your Globalscript.asc (or at least any code related to walk/talk/interact/look if you have other stuff in there).
2. Make sure you have one GUI with an inv window called InventoryWindow1 AND at least one inventory item or the whole thing will not work.
3. Use the bool SC_SwapLeftRight = true/false and the function CustomInv(true/false) in your game_start function to modify the controls.

The custom inventory thing could use some more testing, so let me know how it works for you or if you have any requests for additional configurations.
« Last Edit: 12 Jun 2013, 19:40 by hedgefield »

DangerDinosaur

  • Posts: 2
Re: [MODULE] SingleCursor 1.0
« Reply #1 on: 12 Sep 2011, 19:46 »
Hi,

Thank you for doing this - really appreciated - but the link's not working for me. It just takes me to your site with a lot of broken images. Would it be possible to host it somewhere else?

Thanks again.

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.0
« Reply #2 on: 12 Sep 2011, 19:51 »
Oh woops sorry, put it in the wrong directory. Fixed.

Kweepa

  • Posts: 3,331
  • Mutated Guano Deviser
    • Best Innovation Award Winner 2009, for his modules and plugins
    • Kweepa worked on a game that was nominated for an AGS Award!
Re: [MODULE] SingleCursor 1.0
« Reply #3 on: 13 Sep 2011, 00:14 »
Since I can't seem to post in the Modules board anymore, here goes:

Only moderators can. Your topic will be moved to Modules etc when deemed worthy :=
Still waiting for Purity of the Surf II

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.0
« Reply #4 on: 13 Sep 2011, 00:35 »
Hm, I was semi-convinced I had posted there before. I guess those must have been inceptions. :)

Grim

  • Posts: 911
  • *Dreamer Of The Day*
    • Grim worked on a game that was nominated for an AGS Award!
Re: [MODULE] SingleCursor 1.0
« Reply #5 on: 15 Sep 2011, 14:04 »
I'm struggling with setting up a working inventory... How about going one step further and adding a fully functional inventory?... Pretty pretty please?... ;)

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.0
« Reply #6 on: 15 Sep 2011, 15:15 »
Ha well I could, but that might complicate things. Then you get the matter of resolutionsss, and inventory styles and functions are often a matter of taste. But making one is not that hard if you keep it simple. Just make a new GUI, any size or shape you want, and add the inventory window element to it (click the button drag a box), that's it! By default it should have the right name for my module to work.
If you really want I could include my inventory bar as a seperate add-on, but it's not much more than what I just described plus some screen-edge-toggle magic. :)

Mati256

  • Posts: 369
  • Hello there!
    • I can help with play testing
    • I can help with PR
    • I can help with translating
Re: [MODULE] SingleCursor 1.0
« Reply #7 on: 10 Jun 2013, 02:40 »
Hi. I'm trying to use this module, but when I click in an inventory item, nothing happens.
When I click on an inventory item, my mouse should change to that item but that does not happen. Am I missing something?
My Blog! (En Espa�ol)

Crimson Wizard

  • Posts: 8,723
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [MODULE] SingleCursor 1.0
« Reply #8 on: 10 Jun 2013, 09:00 »
Hi. I'm trying to use this module, but when I click in an inventory item, nothing happens.
When I click on an inventory item, my mouse should change to that item but that does not happen. Am I missing something?
I have never seen this module before, but I guess it is worth to check "Override built-in inventory window click handling" global setting (should be TRUE).

Mati256

  • Posts: 369
  • Hello there!
    • I can help with play testing
    • I can help with PR
    • I can help with translating
Re: [MODULE] SingleCursor 1.0
« Reply #9 on: 10 Jun 2013, 11:20 »
Thank you CW. That was False, I changed it to true but it's still not working.
My Blog! (En Espa�ol)

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.0
« Reply #10 on: 10 Jun 2013, 13:09 »
Hey Mati, I'm looking through the module script now (it's been a long time since I worked on it ha) and I see at the top some instructions that might help you. Did you:

- Make sure you have one GUI named gInventory with one inv window called InventoryWindow1 AND one existing inventory item?
- Put SC_CustomInvClicks = true; in your globalscript game_start function?

I hope either solves the problem, otherwise let me know and I'll spend an afternoon refamiliarizing myself with how this thing works exactly so I can better help you out.

Mati256

  • Posts: 369
  • Hello there!
    • I can help with play testing
    • I can help with PR
    • I can help with translating
Re: [MODULE] SingleCursor 1.0
« Reply #11 on: 10 Jun 2013, 22:21 »
Thank you! That was it. I missed that part of the instructions.
My Blog! (En Espa�ol)

Phemar

  • Posts: 2,445
Re: [MODULE] SingleCursor 1.0
« Reply #12 on: 12 Jun 2013, 13:36 »
Why use repeatedly_execute to check EVERY game loop if the player has changed the option? From the looks of it it only runs once when the game starts.
You could just make it a function: eg. SC.SetOption (eSC_CustomInvClicks, true); or SC.SetOption (eSC_SwapLeftRight, false); etc.

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.0
« Reply #13 on: 12 Jun 2013, 14:57 »
You have an excellent point, looking through this old code now I was surprised I even did it that way. Changing repeatedly_execute to game_start or making it a function should work just fine and save some processing power yes.

Phemar

  • Posts: 2,445
Re: [MODULE] SingleCursor 1.0
« Reply #14 on: 12 Jun 2013, 18:36 »
Well I wouldn't put it in game_start, since the module's game_start will run before the global script's game_start and the player's change to the variable would register after you've checked its state.

hedgefield

  • Posts: 619
  • Oh snap!
    • I can help with play testing
    • I can help with translating
    • I can help with voice acting
Re: [MODULE] SingleCursor 1.1
« Reply #15 on: 12 Jun 2013, 19:45 »
Right you are, script order and everything! I'm a little rusty :) For those interested I updated the module to reflect this suggestion. Instead of the bool SC_CustomInvClicks there is now the function CustomInv(bool); I left the other one as a bool since that one didn't require any checking from the rep_ex, you can just set it directly. Further instructions and download link in the OP.

Imc7r

  • Posts: 36
Re: [MODULE] SingleCursor 1.1
« Reply #16 on: 24 Feb 2018, 17:42 »
Sorry to bump but anyone knows why I get compilation error (All solved now)

SingleCursor.asc(31): Error (line 31): Undefined token 'ProcessClick' (I found answer here )

When using the script? Also what is meant by

- Make sure you have one GUI named gInventory with one inv window called InventoryWindow1 AND one existing inventory item? Where do I find this InventoryWindow1 window? Yes by default there is a gInventory GUI (ok I got this one too, just selecting and then renaming the window consisting of 4 vertices within the gInventory to InventoryWindow1 then the code would give more errors but renaming the old name of the inventory window to InventoryWindow1 in the below code in the global script compiles without an error.


Code: Adventure Game Studio
  1. function btnInvUp_Click(GUIControl *control, MouseButton button) {
  2.   InventoryWindow1.ScrollUp();
  3. }
  4.  
  5. function btnInvDown_Click(GUIControl *control, MouseButton button) {
  6.   InventoryWindow1.ScrollDown();
}
« Last Edit: 24 Feb 2018, 20:09 by Imc7r »