Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Scorpiorus

#1
Quote from: monkey_05_06 on Sat 11/12/2004 13:47:34Proskrito's code works, and although I don't like the fact that I have to manually store the maximum number of characters, but, it works...
Btw, AGS 2.62 introduced a way to get the number of characters. See a GetGameParameter function in the manual for more info.
#2
I know what you are talking about and must to say that's been happening since Ags2.61 came out(when you load an old game/template). I think it can be considered as a bug. For example, a test game from the snow/rain plugin behaves like that.
#3
Quote from: Mr Flibble on Mon 21/06/2004 19:21:33So Scorpius, it is possible to use the verb coin on the inventory, just difficult?
It's not difficult but can be of some hassle since the on_mouse_click function isn't invoked on clicking on a GUI. Handling mouse clicks in script option doesn't help much since in that case the on_mouse_click is called after a mouse button was released whereas on standart LEFT and RIGHT events it's triggered when a button is pressed. So, you have to handle mouse clicks either via the repeatedly execute function or also with a help of the on_event's GUI_MDOWN event.

QuoteI'm gonna go take a crack at it, but in the mean time, does anyone else know how to do this?
Take a look in that thread for how a verbcoin working with inventory items can be implemented http://www.agsforums.com/yabb/index.php?topic=5799
#4
Quote from: Mr Flibble on Sat 12/06/2004 19:33:53Still 3 problems;
1. I can't use an item with a room or something in it
2. I can't use an item on another inv item
Ah, yeah, a little modification to the on_mouse_click function:

function on_mouse_click(int button) {
   // called when a mouse button is clicked. button is either LEFT or RIGHT

   if (button==RIGHTINV) RunInventoryInteraction(game.inv_activated, MODE_LOOK);
   else if (button==LEFTINV) {
      if (character[GetPlayerCharacter()].activeinv!=-1) RunInventoryInteraction(game.inv_activated, MODE_USEINV);
      else SetActiveInventory(game.inv_activated);
   }
   else if (button==LEFT) {
      if (character[GetPlayerCharacter()].activeinv!=-1) ProcessClick(mouse.x, mouse.y, MODE_USEINV);
   }
   else if (button==RIGHT) {
      if (character[GetPlayerCharacter()].activeinv!=-1) SetActiveInventory(-1);
   }


   if (IsGamePaused() == 1) {
      // Game is paused, so do nothing (ie. don't allow mouse click)
   }
   else if (button==RIGHT) {
   ...
   ...
   ...


Quote3. I still can't use the verb coin on inv items.
That one would result in more sagnificant changes around the whole script. Maybe rewriting the whole verbcoin pop up routine.
#5
After Skimbleshanks became unfrozen I downloaded 2ma2's VerbCoin template to look into the implementation. As the author says there is no yet support for verbcoins for the inventory items and that's one of the TODOs for the next version. Unfortunately, due to how the on_mouse_click() event function works it would require to rewrite some parts in order for the inventory verbcoin to become possible.
As for making an item appear as the active one the following modification should do the trick:

1. On the general settings pane tick: Handle inventory clicks in script

2. Put the addition code within the on_mouse_click function:

function on_mouse_click(int button) {
   // called when a mouse button is clicked. button is either LEFT or RIGHT
   if (button==RIGHTINV) RunInventoryInteraction(game.inv_activated, MODE_LOOK);
   else if (button==LEFTINV) SetActiveInventory(game.inv_activated);


   if (IsGamePaused() == 1) {
      // Game is paused, so do nothing (ie. don't allow mouse click)
   }
   else if (button==RIGHT) {
   ...
   ...
   ...
#6
The exact code would be very helpful. ;)
#7
Handling clicks over GUIs requires additional script to be added. See Dorcan's tutorial on how to achieve that sort of thing:Ã,  http://www.digitalmindstudio.ch/script.php?id=1

I'm not, however, sure that the verb coin would work with the inventory items without an extra code added. What's the complete code of the on_mouse_click() function?
SMF spam blocked by CleanTalk