Basic Inventory Item - Cursor Question

  • #1, by AlzasFriday, 04. July 2014, 11:55 11 years ago
    Hello everyone.

    I am new to VS and i just started creating my first game. I have read a lot of the documentation and seen all the tutorials (at least i think so) , but still i have a very simple question about inventory items. I am sorry if you have already answered that but i can't find an answer somewhere. So here it is:

    I create an item and in this items's action menu i create 2 actions. One 'right click' to diplay a text (describe the item) and one for the left click ( i am using one button click interface) to Set Item. I have my item to my inventory (which is a slide out interface already thanks to your templates -great job btw-) and i left click it. So i set it as active item (it works) and what i want -the pretty obvious-, is that after the mouse leaves the inventory area the cursor is set to the image of the item. As far as i understand this is not done automatically and i need to use 'Set Cursor' in the same action when i use the 'Set Item'. That would mean of course that i need to create as many cursors as items. Is that correct or i am missing something?

    To get rid of the inventory item with a right click and return the cursor to it's defailt state, i guess we need to create a 'Right Click' Action under the main character, telling him to drop current item and change cursor back to default. Is that right?

    Thanks a lot in Advance

    Newbie

    21 Posts


  • #2, by afrlmeFriday, 04. July 2014, 12:33 11 years ago
    You can manually set the currently held item with the set item action part but you would need to create cursors for each item if you want it to also change the cursor to the currently selected item.

    Seeing as you said you are using a single command interface I assume that means you are controlling the mouse cursors that will be displayed when mouse cursor enters & leaves scene objects etc? If this is the case then you should probably consider creating a condition "item_held" that will should be set to true whenever you select an item & should be reset to false after you use/remove the currently held item.

    So in your object mouse over/out actions you would need to wrap the set cursor action inside of an if query...
    if condition "item_held" is false
     set cursor...
    end if
    

    ... to prevent it changing cursor on mouse enter leave unless an item is currently not being held.

    Um you do know that there is a dragged item system no? Inside of the game tab is an option to "allow dragging of items from inventory". The "items can be dragged with this command" option inside of the buttons command properties tab. What this will do is automatically change the cursor to the item image/animation & will change back to default once dropped or after you right click to clear.

    As for the right click action: That would be created in the mouse properties tab under game.

    Imperator

    7285 Posts

  • #3, by AlzasFriday, 04. July 2014, 12:55 11 years ago
    Hello AFRLme.

    Thanks for your reply.

    I will try everything you suggested when i get back home.

    I have seen this dragging system, and tried once but i couldn't get it to work. Also i was under the impression that dragging items out of the inventory with this system, means that the user will have to keep the left mouse button clicked while moving the cursor about. I am starting to thing that it may not be the case and that i am an utter fool.

    Many thanks again.

    Newbie

    21 Posts

  • #4, by afrlmeFriday, 04. July 2014, 13:19 11 years ago
    I thought it meant the same thing as well... it does rather make it sound like it literally means to click & drag, but it just means after you left click on an item that it should be set as currently held (dragged) item which can then be dropped on other items, scene objects & characters.

    Imperator

    7285 Posts

  • #5, by AlzasFriday, 04. July 2014, 13:28 11 years ago
    Ok, so i guess i will have to properly setup this option and then everything will be fine!

    Thanks for your time AFRLme.
    Have a nice weekend.


    Newbie

    21 Posts