[WIP] Furniture Storage mod

Post your mods and custom content here

[WIP] Furniture Storage mod

Postby warlocke » Sun Dec 15, 2013 3:34 am

Is there a way to store furniture in containers? I am using towns++ 14b and I am not seeing a container for furniture other than decorative, I am looking for something for beds, benches and such. If there isnt, can someone show me a simple way to make one and I can do the leg work. Thanks all


EDIT 12/16/13

I have figured out the storage system and am working on getting all items made to work with it. I am planning on a furniture barrel/chest, A construction chest (walls, doors, etc.) and maybe a road chest.

If you have other ideas let me know.
Last edited by warlocke on Tue Dec 17, 2013 3:35 am, edited 2 times in total.
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: Furniture Storage?

Postby warlocke » Sun Dec 15, 2013 3:45 am

Also should note, I am looking through the files and am not seeing code for the barrels referring to what they store.
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: Furniture Storage?

Postby warlocke » Sun Dec 15, 2013 5:25 am

ok, after looking at a few other mods and finding a version of an old mod to get an idea of how stuff is done, I am trying to get one working, I am getting this error

[Dec 14, 2013 11:19:38 PM][ActionManager] Error reading [C:\Users\Warlocke\.towns\mods\More Barrels Test\data/actions.xml] [qfurniturechest][Error reading queue [Error loading pick/pickLiving/move/create/lock [furniturechest]]]


I copied queue from the rmbarrel from the default items.xml, any ideas?
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: Furniture Storage?

Postby warlocke » Sun Dec 15, 2013 5:31 am

warlocke wrote:ok, after looking at a few other mods and finding a version of an old mod to get an idea of how stuff is done, I am trying to get one working, I am getting this error

[Dec 14, 2013 11:19:38 PM][ActionManager] Error reading [C:\Users\Warlocke\.towns\mods\More Barrels Test\data/actions.xml] [qfurniturechest][Error reading queue [Error loading pick/pickLiving/move/create/lock [furniturechest]]]


I copied queue from the rmbarrel from the default items.xml, any ideas?

Doh, meant to post the actions.xml

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<actions>

   <!-- Items -->
   <!-- Containers -->
   <action>
      <id>qfurniturechest</id>

      <priorityID>itemconstruction</priorityID>

      <queue>
         <lock>carpentrybench</lock>
         <pick>rmwood</pick>
         <move>carpentrybench</move>
         <wait>20</wait>
         <destroyItem />
         <pick>rmwood</pick>
         <move>carpentrybench</move>
         <wait>20</wait>
         <destroyItem />
         <unlock />
         <pick>rmwood</pick>
         <move>wooddetailer</move>
         <wait>32</wait>
         <destroyItem />
         <unlock />
         <createItem>furniturechest</createItem>
      </queue>
   </action>
</actions>
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: [HELP] Furniture Storage mod

Postby YetiChow » Sun Dec 15, 2013 5:56 am

First of all: what goes into a container is determined by the "type" it stores; the same type as listed in the <type> tag AFAIK. The idea behind this automated system (instead of making the container listed under a different type - e.g. the barrel is a "decorative" but stores food - is to keep the barrel with what it stores when you're making a stockpile).

In that case, all you'd have to do to store beds etc. is to make your container have the same <type> as what you want it to store.

As for the error, I can't see what's causing that... the action itself looks right, no apparent typos or anything, although it might be the way you've set it up as a mod? Have you tried the code manually inside the .xml, or did you go straight into modloader-ready format?
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: [HELP] Furniture Storage mod

Postby warlocke » Sun Dec 15, 2013 6:16 am

I dont use a modloader other than towns default, I did not think of injecting it direct into the games actions file.
Code: Select all
   <furniturechest>
      <name>Furniture Barrel</name>
      <type>furniture</type>
      <container>true</container>
      <containerSize>50</containerSize>
      <value>90</value>
   </furniturechest>


There is the items.xml info. Copied that again, from the default file using rmbarrel as a base, changed rawmaterials to furniture.

Also injected direct in games actions file and got the same error
[Dec 15, 2013 12:17:46 AM][ActionManager] Error reading [data/actions.xml] [qfurniturechest][Error reading queue [Error loading pick/pickLiving/move/create/lock [furniturechest]]]
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: [HELP] Furniture Storage mod

Postby Project 06 » Sun Dec 15, 2013 7:40 am

I beleive the issue may having something to do with beds and other furniture NOT being stackable, i have a series of custom containers but never thought about furniture, but i made a custom bed.

Code: Select all
   <elegantbed>
      <name>Elegant bed</name>

      <type>furniture.te</type>

      <usedToSleep>true</usedToSleep>
      <happiness>2</happiness>
      <alwaysOperative>false</alwaysOperative>
      
      <canBeRotated>true</canBeRotated>

      <zone>zpersonal</zone>
      <zone>ztavernroom</zone>
      <zone>zhospital</zone>
      <zone>zbarracks</zone>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <value>350</value>
   </elegantbed>


note that my type for the custom container is <furniture> even though this bed uses <furniture.te> the ".te" is to have better organization among my modded items. In my modded crate i didnt see vanilla beds, so i assume its because no furniture in vanilla Towns is stackable, just go through all the furniture type items and add this:

Code: Select all
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>


That should let them show up.
Project 06
 
Posts: 22
Joined: Fri Nov 22, 2013 7:06 am

Re: [HELP] Furniture Storage mod

Postby YetiChow » Sun Dec 15, 2013 3:16 pm

^ had not even considered stackable size as a factor, but this is indeed what is going on.

What happens is that the game tests out the "pick up a bed and take it to the chest" action at startup, but the "overall" task in that action is to lock the barrel. Since that's the first step, that's what the action manager recognises as the "action in progress" and hence why it spits an error to the seemingly unrelated place.

It's probably not a bad idea to package in a tweak to make beds etc. stackable along with this mod; and if I understand correctly then the barrel only stores the previously un-store-able furniture anyway... so if you don't include either that or custom furniture to use with the barrels then there wouldn't be anything to put in them anyway :lol:

On another note, you would probably be able to apply the same thing to wall blocks if you give them a stackable size. It would work really well if you also added a "pre construction" panel to the autoproduction menu, in the vain of the furniture sales mod - make "unlocked"/"unplaced" furniture, walls etc. using the AP menu and possibly a different form of the <create> tag, so players can build a heap of blocks and then have the townies place them as needed for the project.
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: [HELP] Furniture Storage mod

Postby warlocke » Sun Dec 15, 2013 3:33 pm

I will try this here in a bit, I did not think of that last night, finally gave up and went to bed lol. thanks ill let ya know
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Re: [HELP] Furniture Storage mod

Postby warlocke » Sun Dec 15, 2013 3:57 pm

ok, so I copied the woodenbed from the games items file to the items.xml of what i am trying to get working and now have another error.

Heres the items file.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>   
   <!-- CONTAINERS -->
   <furniturechest>
      <name>Furniture Barrel</name>
      <type>furniture</type>
      <container>true</container>
      <containerSize>50</containerSize>
      <value>90</value>
   </furniturechest>
   <!-- /CONTAINERS -->
   
   <!-- /FURNITURE -->
   <woodenbed>
      <name esES="Cama de madera">Wooden bed</name>

      <type>furniture.beds</type>

      <usedToSleep>true</usedToSleep>
      <happiness>5</happiness>
      <alwaysOperative>false</alwaysOperative>

      <zone>zpersonal</zone>
      <zone>ztavernroom</zone>
      <zone>zhospital</zone>
      <zone>zbarracks</zone>

      <value>102</value>
      <stackable>true</stackable>
      <stackableSize>1</stackableSize>
      <action>del_woodenbed</action>
   </woodenbed>


heres the new error
[Dec 15, 2013 9:49:11 AM][ItemManager] Error obtaining values from C:\Users\Warlocke\.towns\mods\More Barrels Test\data/items.xml file [org.xml.sax.SAXParseException; systemId: file:/C:/Users/Warlocke/.towns/mods/More%20Barrels%20Test/data/items.xml; lineNumber: 13; columnNumber: 3; The markup in the document following the root element must be well-formed.]
warlocke
 
Posts: 14
Joined: Sun Dec 15, 2013 3:32 am

Next

Return to Modding

Who is online

Users browsing this forum: No registered users and 4 guests