Jump to content


Photo

Soldier Equipment


  • Please log in to reply
3 replies to this topic

#1 M4st3r

M4st3r

    Squaddie

  • Xenocide Recruit
  • 7 posts

Posted 15 February 2006 - 12:52 PM

Previous post version :

I've just done data side soldier stats (it's on SVN), and now I want to make the inventory. In my opinion it should hold :

- List of containers (l\r shoulder,hands,backpack, belt)
- It's weight

Basic draft :

Inventory - class
Inventory::parts - containers

Container - class
map - map of the container, so we can make irregular shapes (like X-COM's belt) and for easy checking is field X,Y free
name - container name (for example Backpack)
movetimes - how much TUs takes a move from container X (Need for battlescape)

Field - class
Container's map is made of fields
pos - field's position in container
item - item which is located on this field (also used for marking free space)

Item - class
size
start - position of first Field of item
name - item name (for example Assault Rifle)
weight

It surely needs some modifications, so I ask you to take a look at this draft.

TIA, M4st3r.


Found there is existing inventory :P, and if it exists, it means that somebody is\was working on that, so if he does other things, I can take the inventory. Are you OK with that ?

Edited by M4st3r, 15 February 2006 - 02:07 PM.


#2 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 15 February 2006 - 06:06 PM

Previous post version :

I've just done data side soldier stats (it's on SVN), and now I want to make the inventory. In my opinion it should hold :

- List of containers (l\r shoulder,hands,backpack, belt)
- It's weight

Basic draft :

Inventory - class
Inventory::parts - containers

Container - class
map - map of the container, so we can make irregular shapes (like X-COM's belt) and for easy checking is field X,Y free
name - container name (for example Backpack)
movetimes - how much TUs takes a move from container X (Need for battlescape)

Field - class
Container's map is made of fields
pos - field's position in container
item - item which is located on this field (also used for marking free space)

Item - class
size
start - position of first Field of item
name - item name (for example Assault Rifle)
weight

It surely needs some modifications, so I ask you to take a look at this draft.

TIA, M4st3r.


Found there is existing inventory :P, and if it exists, it means that somebody is\was working on that, so if he does other things, I can take the inventory. Are you OK with that ?

<{POST_SNAPBACK}>

The someone was me. By all means feel free to work on this.

I should give you a couple of cautions though.

1. The inventory and items code was really a "first attempt" at trying to solve the problem, and I'm not convinced that it's satisfactory.
2. The base classes here are Inventory and Item. For soldiers, they get an InventoryTroop. My thought was that for troopers, you would want to specialise the RackDistinct, to track not only the item but the position of each item. (The inventory used by a trooper is conceptually similar to the inventory a craft would use. - A collection of distinct items, that also records the position of each item.)

Edit. Oh yes, items caried by troopers derive from ItemTroop, which have most of the attributes you've listed.

Edit. Have a look at this thread for more details on how it all hangs together.
http://www.xcomufo.c...=242024522&st=0

Edited by dteviot, 15 February 2006 - 06:11 PM.

Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#3 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 15 February 2006 - 06:49 PM

Additional note, before working on the equiping soldiers, you might like to work on equiping craft. I think the problem there is similar, but simpler.
Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.

#4 dteviot

dteviot

    Programming Department

  • [Xenocide Senior Members]
  • 1,479 posts

Posted 15 February 2006 - 10:06 PM

And of course, before writing any code, you should visit this thread and write up the what you're planning on doing.

http://www.xcomufo.c...topic=242024914
Saving the world from the scum of the universe is hard work. Especially when you have to create the scum to begin with.