Add a item to right click mouse in middle game

Started by Mehrdad, Wed 13/01/2010 06:03:42

Previous topic - Next topic

Mehrdad

Hi
I want add a item to right click moue in middle game(not mean Inventory).for instance player find a pistol and add this item to right mouse in continue.
is it possible?
My official site: http://www.pershaland.com/

monkey0506

It might, but I don't honestly know what you're asking.

You say you want to "add" the item, but not to the inventory?

It sounds like you might be asking if there's a way to set it such that a right-click with "use" an (equipped) item, such as a pistol, without that item actually appearing in the inventory.

That would be possible (if that's what you mean). I might store a variable such as:

Code: ags
bool hasPistol = false;


Then when the player finds the pistol, set the value appropriately:

Code: ags
  hasPistol = true;


And then in on_mouse_click:

Code: ags
  else if (button == eMouseRight) {
    if (hasPistol) {
      // shoot pistol
    }
    else mouse.SelectNextMode(); // or whatever else you might do here
  }


Again, it was unclear, but that's about the best I can gather from what you said, sorry if I misunderstood.

Mehrdad

#2
sorry my english is bad.
in right click mouse,we have walk,talk,.....and now I want add a another Item to this cycle in middle game,no at start game.this appear when i found a pistol(for instance).

sorry if i talk bad english.
My official site: http://www.pershaland.com/

Khris

Add the cursor, set it as being a standard cursor mode, then "Mouse.DisableMode(eModeShoot);" in game_start.
Later, after the player found the pistol or whatever, call "Mouse.EnableMode(eModeShoot);"

Mehrdad

My official site: http://www.pershaland.com/

SMF spam blocked by CleanTalk