Inventory advanced options.

  • #1, by ke4Tuesday, 11. November 2014, 11:11 6 years ago
    Hi,

    Can be done these things in visionaire?
    1. Play sound when i dragg item ( for every item different sound ) and 2. make dragged item invisible in inventory.

    Thanks

    Key Killer

    810 Posts


  • #2, by afrlmeTuesday, 11. November 2014, 12:21 6 years ago
    Do you mean remove it from the inventory completely or just to make it invisible while staying in same spot?

    The sound thing shouldn't be a problem. Just apply a play sound action to a left click action inside of each items action section.

    Imperator

    6842 Posts

  • #3, by ke4Tuesday, 11. November 2014, 12:39 6 years ago
    I tried that, but when i did left click action then the item can't be dragged.

    Make it invisible when is dragged in inventory and staying in same spot.

    Key Killer

    810 Posts

  • #4, by afrlmeTuesday, 11. November 2014, 13:49 6 years ago
    ok dokie.

    1. Easy enough to do. Instead of allowing dragging of items via the option in the game tab. You manually set the drag item inside of the items action tab instead. Seeing as you are wanting it to play a different sound on each item selection then I don't see any downside to you having to create an additional action for this.

    2. This involves you creating the item image as an animation instead. You need to create 2 frames. 1 containing the item image & the second containing nothing or a transparent image. You should edit frame 1 & add an execute a script action to the actions list containing...
    ActiveAnimations["item_name"].AnimationFirstFrame = 1
    ActiveAnimations["item_name"].AnimationLastFrame = 1
    1
    2
    3

    ...this will force the animation to only loop frame 1.

    Inside of your left click or whatever command sets the item, you will add another execute a script action, which is exactly the same as the above code block but you will set the frame number to "2".

    Resetting the animation is a little more tricky on item no longer holding... what you could do is store the currently held item name into a value & then have it use said value inside of a reset function or maybe create a loop that runs while item is held that automatically resets item back to default value & unloads loop afterwards when item is no longer held.

    I'm not sure which would be best method off the top of my head without testing. So I will not add that part to this thread at the minute.

    Imperator

    6842 Posts

  • #5, by ke4Tuesday, 11. November 2014, 14:05 6 years ago
    That's seems a bit difficult, i'll try it, but to be sure, in inventory will be a blank frame, but the dragged item will be visible?

    Key Killer

    810 Posts

  • #6, by afrlmeTuesday, 11. November 2014, 14:43 6 years ago
    Good point.... Maybe if you add a static image to the item also? Not sure without testing... I suppose an alternative would be to create a small tile same color as item slot background & have that show up over the selected slot. Would be easier I guess & then you don't have to bother coding anything or using animated items.

    Sorry, sometimes my brain tends to automatically lean towards the more complicated solution first, as it overlooks the simplest solution.

    Imperator

    6842 Posts

  • #7, by ke4Tuesday, 11. November 2014, 15:06 6 years ago
    I guess that wont work, not easily, because the position in inventory of the item is relative.
    Well, thanks a lot. I'll test it out and then will give a feedback.

    Key Killer

    810 Posts

  • #8, by afrlmeTuesday, 11. November 2014, 15:43 6 years ago
    hmm... The slots are always the same... graphics I mean. You could easily create buttons as action areas containing the image that covers each slot & then you can toggle condition to hide & then later on you run a single called by other action or a for loop function to reset all conditions back to false.

    I've not the time to create an example at the minute of what I have in mind. But in theory it should work, providing you can place buttons over the top of buttons containing items. Also the inventory would have to have a solid background, otherwise it wouldn't work.

    Imperator

    6842 Posts

  • #9, by ke4Tuesday, 11. November 2014, 15:49 6 years ago
    I meant that for example your item is on slot 2, but you will use item on slot 1 for something and then item from slot 2 will get to the slot 1. Or i just don't follow you right now.

    Key Killer

    810 Posts

  • #10, by afrlmeTuesday, 11. November 2014, 16:14 6 years ago
    You said to hide the item in the slot where it currently is. So if you are currently holding it then you cover up the slot which you took the item from. If you drop item back into inventory or remove the item from your inventory then you hide the image that was covering the inventory slot.

    I guess we are having a tongue twister match here in explanation & understanding. Everything I said is theoretical & thus it's not easy for me to explain very clearly or in great detail.

    Imperator

    6842 Posts

  • #11, by ke4Tuesday, 11. November 2014, 16:40 6 years ago
    Aha, i get it, okay that's i think easy and nice solution.

    Key Killer

    810 Posts

Write post