Problem item in inventory - SOLVED

Started by Kikutaâ„¢, Wed 15/12/2004 01:16:49

Previous topic - Next topic

Kikutaâ„¢

Well, i hate to post thing here, i prefere discorvery myself, but this it's my last resort. As i said in my last post, i made a new inventory GUI. I add a new item to my inventory list, but when i click in it, it doesnt happen anything! It is suppost to "pick up" the item from the list!

I've tried to comment everything on_mouse_click except the part you press the left button ad still doesnt happen. I've seen the code of three diferent games and i dont see any specific funtion to get the item! It is only suppost the left click, and pick the item, right ?

//Edit:

I've discovered. When you pass the mouse into a hotspot, character,inventory item or object, the mouse pointer becames red, so, the mouse didnt pick up the mouse.
Sorry :P

Kikutaâ„¢

I have another problem :(

Well, The last problem i manage to solve, but i'm 2h around this new problem and i cant solve it :(

I want to open a new GUI and inv variable to 1 when the inventory screen (a gui that i made) is open. I've put the Z-order right, but it's still the same, it doesnt appear, and nether the inv is 1.

I've made this in on_mouse_click. I've even tried in unhandled_event, but nothing.

Do you know how to do it ?

Scorpiorus

QuoteI add a new item to my inventory list, but when i click in it, it doesnt happen anything! It is suppost to "pick up" the item from the list!
Unless Handle inventory clicks in scripts game option is ticked, all inventory clicks processed internally:

left click in interact mode (MODE_USE) - selects an item;
right click - runs LOOK AT INV ITEM interaction;

To override this behaviour you can tick the Handle inventory clicks in scripts option and handle mouse clicks via the on_mouse_click function (using special LEFTINV/RIGHTINV values):

function on_mouse_click(int button) {

Ã,  Ã,  if (button == LEFTINV) { ...set active inv item or whatever... }
Ã,  Ã,  else if (button == RIGHTINV) { ...look at inv item or whatever... }

}

QuoteI've made this in on_mouse_click. I've even tried in unhandled_event, but nothing.
What should trigger a new GUI to open? A click on a some GUI button or just a mouse click anywhere? or?

Kikutaâ„¢

#3
i made a Gui like this. One left click off a hotspot , character and object and it makes the character walks. But if the mouse is over a hotspot, character and object, it opens a gui with use,look, and talk (just like that game, the longuest journey). I want to open that same gui if i click over an iventory item.

I will try that thanks :)

Edit : It worked thanks :D

Scorpiorus

You're welcome :)

Btw, take look at a game.inv_activated variable in the manual. You may find it useful as it holds the inventory item number you last clicked on:

if (button == LEFTINV) { SetActiveInventory(game.inv_activated); } // selects an item

Be sure to let us know how it turned out. ;)

Kikutaâ„¢

LOL! Thanks, it worked! That was just the thing i needed :D
Thanks alot, u guys are very helpful.

SMF spam blocked by CleanTalk