UFO: Alien Invasion Issue Tracker
star_faded.png
Please log in to bookmark issues
enhancement_small.png
OPEN  Submit Patch #4756  -  misc_inventory edict support
Posted Oct 03, 2011 - updated Jan 28, 2013
bayo-fr (bayo-fr) has been working on this issue since January 28, 2013 (20:51)
Issue details
  • Type of issue
    Submit Patch
  • Status
     
    Open
  • Assigned to
     bayo-fr
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     mattn
  • Owned by
    Not owned by anyone
  • Category
    General
  • Priority
    3. Normal
  • Targetted for
    icon_milestones.png Not determined
Issue description
Item 629 imported from sourceforge.net tracker on 2013-01-28 20:46:59

    * introduced misc_inventory edict
    
    * this edict allows us to equip actors in mission, there is no longer a need to do that before you enter the mission.
    * NOTE: this is currently mainly for multiplayer
    * TODO: the ui script for the inventory management is not yet done
    * TODO: the scrollable container support must be added to the network protocol


Comments Ported from Sourceforge  ⇑ top
tlh2000 (2011-10-03 17:53:55)  ⇑ top
 
tlh2000 (2011-10-03 17:54:25)  ⇑ top
i've assigned this to you bayo, because i need some help with the scrollable container stuff.
tlh2000 (2011-10-03 17:55:29)  ⇑ top
testmap - walk close to the wall, it will get highlighted, hit backspace
bayo-fr (2011-10-03 21:17:40)  ⇑ top
you must init the "ui_inventory" global var with the list of your items, and it should work.

baseInventoryNode do not yet use a ref to a base, then you can use it without base. Which make me think linking this node to a base is not the right way... anyway it is another problem smileys/2.png
tlh2000 (2011-10-04 05:46:53)  ⇑ top
the list is shown perfectly - the drag works, too, but the drop is not.

I'm getting this error when dropping the item: Error: INVSH_SearchInInventory: Scrollable containers (9:equip) are not supported by this function

I suppose we have to extend the net protocol to let scrollable containers work on battlescape (which is my primary goal in the misc_inventory branch)
bayo-fr (2011-10-04 06:13:03)  ⇑ top
I dont check your patch (... i should) But imo we should not interleave network and gui code.

If i understand right your feature it is before the battlescape?

  • server send list of items to client
  • client do what he want with it
  • client validate his choice
  • client send his choice to the server
  • server can check everything is right


Or you want something fully interactive? where spectator can view player selecting thinks...? Or people from the sameteam share the same items, or thing like that? Anyway, i remember all inventory structure is a mess, i must check, but i am not sure i can help a lot.
tlh2000 (2011-10-04 12:06:19)  ⇑ top
no, i want soldiers to be equipped on the battlescape. i'm currently doing this by adding a new entity called misc_inventory. this can be triggered by a trigger_touch (e.g.)

once you are in the trigger zone, you can use it (as you would open a door - key=backspace)

when you use it, you should be able to equip your soldier from the equipment definition that is connected with the misc_inventory entity. this way we can have special (server-based) equipments for multiplayer games (it also would allow us to implement campaign maps where we can e.g. loot the alien weapon chamber).
tlh2000 (2011-10-04 12:13:52)  ⇑ top
i won't directly link ui to net of course

the problem is in UI_ContainerNodeDNDFinished - if (CL_BattlescapeRunning()) { .... } this is called with fromX and fromY paramters - that won't work for scrollable containers. to we have to adopt this.
tlh2000 (2011-10-04 13:20:58)  ⇑ top
http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=commitdiff;h=104b4fe969f3126b0bf85b2e899fc8429ed204a7
bayo-fr (2011-10-04 19:24:12)  ⇑ top
hoooo sourceforge login is really bad...

before losing my comment, i said: I dont understand the difference between what you want to do and the floor container.

Plus, "scrollable" should be hiden foe CL_ code. It dont care about scrolling or not. Maybe, fromX and fromY should support a "i dont care" value. But, i think all the item structure is quite magic, no body know anymore how does it works. If you have time to create an uml diagram class of all this data structures, it can be very usefull.