Modify

Ticket #254 (closed task: fixed)

Opened 10 years ago

Last modified 9 years ago

Allow setting NPCs inventory from the map file

Reported by: b0rland_parpg Owned by: parpg
Priority: major Milestone: Release: Techdemo 2
Component: scripts Version: trunk
Keywords: Cc:
Blocked By: Blocking:
Department:

Description (last modified by b0rland_parpg) (diff)

We need to be able to add items to NPCs inventories right from the map files. So the support for this should be added to map loaders and a map editor. Figure out the file structure that would be useful for that and implement support for it.

Note that inventory items should be Carryable GameObjects?, not just strings.

Attachments

Change History

comment:1 Changed 10 years ago by b0rland_parpg

  • Description modified (diff)

comment:2 Changed 10 years ago by beliar

It looks like the important Attributes for a CarryableItem? are ID, name and image. So currently all three of them would have to be in the map file (actually image can be left out but then it gets the generic image).

I suggest to put the inventories into (a) different file(s) or as content in the tag of the object in the map file - that is between ">" and "<", or maybe make so both is possible.

I'd say that the yaml-format is just perfect for such kind of data.

If no one has problems with this approach i will at least do the loading part and probably the editor part too though i need to take a look at pychan for that first.

comment:3 Changed 10 years ago by b0rland_parpg

I'm hoping that it will be enough to specify 'class' instead of name and image in future (see #185), but currently what you say about CarryableItem? is true.

As for the rest: I like the idea of putting inventory inside the object entity as sub-entities instead of attributes. That's more xml-ish in my opinion. As for splitting it into separate files, this needs to be discussed extensively.

The intermediate result we arrived at during the previous discussion was the plan to minimize the amount of logical entities that store objects' properties. Ideally there should be three: so called 'objects DB' for properties shared by the class of objects, map file for overriding properties for individual objects and quest scripts for runtime tweaks and quest-related items. I think inventory should be kept inside the same 3 logical entities. We may decide to split the logical entity 'map' into several physical files, but I'd rather have it as a conscious and weighted decision.

comment:4 Changed 9 years ago by beliar

  • Status changed from new to closed
  • Resolution set to fixed

This was done in revision[540]

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.