Pillars of the Earth style inventory/clues

  • #1, by mrmustard0Tuesday, 06. November 2018, 08:45 5 years ago
    Hi all,

    I am trying to do a inventory/dialogue system like Pillars of the earth, where yo have inventory items on one side of the screen, and conversation clues (also items I guess) on the other side. I just can't figure out how to get a seperated inventory, where clues go in their own area/unventory/interface, and items in the other.

    Is this possible with the standard engine functions ( I'm not at all experienced with scripting/lua). Does anyone have a suggestion? :-)

    Newbie

    6 Posts


  • #2, by sebastianTuesday, 06. November 2018, 09:08 5 years ago
    not sure how it looks like in PoE so i can only assume what you want to do from your description. 

    The standard inventory interface system has only the ability to include all items inside the current characters inventory at once. So you can't separate them there if they have special attributes.

    Like often the solution would be lua based: The items a character can hold would need some internal identificarion (name prefix or condition / value) and you need to  create an own sytsem in your interface to show only specific items on the left or right (and make them possibly scroll separately) . 

    a lua script to separate item items from clue items  could work like this  (pseudo code) :
    --
    get current characters items
    if name begins with "clue_" put item object into "clues" lua table, if not, put it in "items" lua table. 
    --

    When opening the interface, get these tables and for each table, iterate through each item and display it on its own interface action area. 
    When you have 4 slots for clues and 4 slots for items and need scrolling, just iterate through i=startpoint to startpoint +3. Clicking on a "scroll left/right" arrow will change the startpoint -/+ 1 and trigger a rerender of your items. 
    The rendering of items also need to be done in lua because you cant use the default item system here. 
    Clicking on an item or clue will then check whats on the current slot position and sets your item at mouse cursor to that item. 


    Thread Captain

    2346 Posts

  • #3, by esmeraldaTuesday, 06. November 2018, 09:09 5 years ago
    I thought it possible to create a second inventory and decide where to put the item.

    But maybe you would need a second (invisible) character to assign the interface to.

    Key Killer

    508 Posts

  • #4, by sebastianTuesday, 06. November 2018, 09:13 5 years ago
    I thought it possible to create a second inventory and decide where to put the item.

    But maybe you would need a second (invisible) character to assign the interface to.

    But wouldnt the second inventory interface just display the same items? 

    Thread Captain

    2346 Posts

  • #5, by esmeraldaTuesday, 06. November 2018, 09:26 5 years ago
    You are right. If you assigned the second interface to the main character, it would hold the same items.
    But maybe if you used a  invisible character, to which you assigned the interface, you could add the items to this character.
    The tricky part would be how to use these items in a conversation...

    Key Killer

    508 Posts

  • #6, by mrmustard0Tuesday, 06. November 2018, 09:45 5 years ago
    I seem to be in over my head. :-)

    The system in Pillars looks as attached picture. The clues are items, that you can drop on a character, to talk about them.

    Hmm...that lua looks complicated for someone, who has never written a line of code in his life. :-)

    I've tried doing an invisible character, but showing both that characters inventory, along with the controllable character, is not possible I think. And switching to the invisible character, to see his inventory, hides the other inventory. Oh dear. :-)


    Newbie

    6 Posts

  • #7, by esmeraldaTuesday, 06. November 2018, 10:22 5 years ago
    One possibility I can think of would be not to use an inventory with items, but an interface. The items would be represented by images in the iterface, which would be made visible by condition/value. 
    If you click on an image in the interface, you change the cursor to a cursor that represents the item. Would be a lot of work though.

    Edit: I just realised that there is an "set item" action part. So you wouldn't need to create cursors for every clue-item, you would just use set item instead of set cursor. Then you could use the clue like an item. (I'm guessing here, have still to test it)

    Key Killer

    508 Posts

  • #8, by mrmustard0Tuesday, 06. November 2018, 10:44 5 years ago
    I think that could be a way to do it, though the items would be placed at a certain position in the interface, right? So if I pick up items in a random order, there might be "gaps" in the interface/"fake inventory", as the "items"/objects would become active at an absolute position in the interface.

    The items would have to be positioned as an inventory, wehere they "stack" from inventory  button 1 to whatever.

    Does that make sense? :-) I don't know if I am explaining it well enough.

    Newbie

    6 Posts

  • #9, by esmeraldaTuesday, 06. November 2018, 11:08 5 years ago
    Just tested it, it works.
    If you want it to behave like an inventory - meaning no gaps - you need an image / action area for each item at each slot. You can decide via values which image is shown at which slot.
    value for slot 1 = 0  -> slot is empty, 1 = clue 1, ...
    When putting the "item" in the interface, you would check if slot1 is empty (=0), then place the item there, when not empty, check slot 2...

    Same when having used the clue and deleating the clue from the inventory. Then you have to check which slot was holding the item. (if slot1 = 2, set slot1 =0, else if slot2 = 2, set slot 2=0...) (well... and then moving the other clues to close the gap with the next if queries... - if you want to)
    That is managable if you haven't too many slots an clues... 

    I guess it would be much easier with lua, but I can't code myself.

    Key Killer

    508 Posts

  • #10, by mrmustard0Tuesday, 06. November 2018, 11:55 5 years ago
    I'll have to try that out, thanks. :-)

    Am I right in thinking that it is not possible to set an objects position with an action? As I understand it, I would have to make a seperate object with the same image for each "inventory" slot, instead of being able to set the position of a single "item"-object, right?

    Newbie

    6 Posts

  • #11, by afrlmeTuesday, 06. November 2018, 12:16 5 years ago
    You could use animations & force the animation frame numbers based on values. Would need a bunch of if elseif queries too if you only want to use a single button per slot.

    I haven't read all of this thread, but Daedalic tend to make their own custom systems comprised of a mix of interfaces, action parts & Lua script - maybe it's not something you are capable of creating yourself currently, but you can always use something simpler until you have acquired the knowledge to create what you originally wanted or find/hire someone else to sort it out for you. wink

    Imperator

    7278 Posts