[1.2] Apparello v2.2.2 Dawn of newer deluxier edition [02/03/2021]

Started by Shinzy, July 30, 2014, 08:19:27 AM

Previous topic - Next topic

nmid

Quote from: sparda666 on June 06, 2015, 12:14:10 AM
Ive just started using this and I think its amazing, but there are so many apparel items that I have no idea what any of them are or how to craft them. Is there some kind of guide or document showing the stats for each item?

Im hoping there is something easier than writing XSLT to render the xml files from the mod. I'm loving the items, but its just so overwhelming to figure out how or what to make

How true.. I have the apperello thingsdef folder opened in sublime and I keep alt-tabbing to check on various items, using the search button.

Do you have an easier work-around?
I just google searched XSLT.. do you have a working example that I can see and understand :) ?
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

sparda666

XSLT is a language that is used to trasform xml (most commonly into html to render in a browser).
Im not that familiar with the thingdef structure but I did make a very simple proof of concept in a couple minutes before figuring out that it doesnt quite solve my problem.

With this, you can probably make a table with names and stats, but I want to know what the item looks like, and what is needed to craft it. the crafting defs are in a different file and it looks like a good amount of items in Apparello (namely all the cool hats that I want) dont seem to be craftable. I cant find them in the recipe defs

Im attaching a simple XSLT proof of concept here. For this, I added a single line to one of the XML files that references the XSL file, which contains the "code" to render the XML (I highly suggest copying the Apparello folder somewhere else when experimenting so you dont mess up your mod). Below is that one line.

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="Transform.xsl"?>
<ThingDefs>


You should be able to save both files in the same directory and then open the XMLfile with any web browser. Open the XSL file with notepad or wordpad or sublime or whatever to check out how it works. Its pretty simple. You are just for-each-ing to loop through all the thingdefs and grabbing inner tags. Mess around with it if you want.



[attachment deleted due to age]

nmid

Quote from: sparda666 on June 06, 2015, 01:13:00 AM
XSLT is a language that is used to trasform xml (most commonly into html to render in a browser).
Im not that familiar with the thingdef structure but I did make a very simple proof of concept in a couple minutes before figuring out that it doesnt quite solve my problem.

With this, you can probably make a table with names and stats, but I want to know what the item looks like, and what is needed to craft it. the crafting defs are in a different file and it looks like a good amount of items in Apparello (namely all the cool hats that I want) dont seem to be craftable. I cant find them in the recipe defs

Im attaching a simple XSLT proof of concept here. For this, I added a single line to one of the XML files that references the XSL file, which contains the "code" to render the XML (I highly suggest copying the Apparello folder somewhere else when experimenting so you dont mess up your mod). Below is that one line.

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="Transform.xsl"?>
<ThingDefs>


You should be able to save both files in the same directory and then open the XMLfile with any web browser. Open the XSL file with notepad or wordpad or sublime or whatever to check out how it works. Its pretty simple. You are just for-each-ing to loop through all the thingdefs and grabbing inner tags. Mess around with it if you want.

I'll check on Sunday.. ty for your help! :)

As for sublime, it shows me what I need. Took a bit of time to get used to everything, but it works for me.

For eg, I made
<ThingDef ParentName="ApparelMakeableBase"> <!-- ApparelBase -->
    <defName>Apparello_Suspender</defName>

which basically turned the stablehand trousers into a tailorable item for me :p

It was earlier

<ThingDef ParentName="ApparelBase">
    <defName>Apparello_Suspender</defName>
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

nmid

Reading futher, a clarification...
the thingsdef folder has everything in it, that you ideally want to know (about crafting costs and offsets - effects the item has.

For eg, lets take stablehand trousers again.
  <ThingDef ParentName="ApparelMakeableBase"> <!-- ApparelBase -->
    <defName>Apparello_Suspender</defName>
    <label>Stablehand trousers</label>
    <description>Ain't a chap on earf lookin' as honest as one wearin' these. With these equipped one should feel more comfortable wading through mud and filth and therefore more inclined to get the job done without distractions</description>
    <graphicPath>Apparel/Suspenders/Suspenders</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
     <costStuffCount>35</costStuffCount>
    <stuffCategories>
      <li>Fabric</li>
      <li>Leathery</li>
    </stuffCategories>
    <statBases>
      <WorkToMake>2500</WorkToMake>
      <Insulation_Cold>-3</Insulation_Cold>
      <MarketValue>50</MarketValue>
    </statBases>
    <equippedStatOffsets>
      <WorkSpeedGlobal>0.06</WorkSpeedGlobal>
      <!--<SocialImpact>0.1</SocialImpact>--> <!-- Suspenders make you look smart, smart people get more respect. -Iggy --> <!-- Not if they've been wading through horse droppings all day long! ~Shinz -->
    </equippedStatOffsets>
    <apparel>
      <bodyPartGroups>
        <li>Legs</li>
      </bodyPartGroups>
      <worngraphicPath>Apparel/Suspenders/Suspenders</worngraphicPath>
      <layers>
        <li>Middle</li>
      </layers>
      <commonality>1</commonality>
      <tags>
        <li>Outlander</li>
        <li>SetWorker</li>
      </tags>
      <defaultOutfitTags>
        <li>Worker</li>
      </defaultOutfitTags>
    </apparel>
<colorGenerator Class="ColorGenerator_Options">
<options>
<li>
<weight>10</weight>
<only>RGBA(0.4,0.3,0.15,1)</only>
</li>
<li>
<weight>15</weight>
<only>RGBA(0.6,0.45,0.18,1)</only>
</li>
<li>
<weight>20</weight>
<only>RGBA(0.8,0.6,0.23,1)</only>
</li>
<li>
<weight>6</weight>
<max>RGBA(1,1,0.90,1)</max>
<min>RGBA(1,0.90,0.75,1)</min>
</li>
</options>
</colorGenerator>
  </ThingDef>


I can search for Stablehand trouser in the entire folder in sublime ( a fancy text editor) and it will show me which xml file it is in.
Apparel_Western.xml


     <costStuffCount>35</costStuffCount>
tells me it costs 35 units of

    <stuffCategories>
      <li>Fabric</li>
      <li>Leathery</li>
    </stuffCategories>

any fabric or leather.

and this is what it does


    <statBases>
      <WorkToMake>2500</WorkToMake>
      <Insulation_Cold>-3</Insulation_Cold>
      <MarketValue>50</MarketValue>

    <equippedStatOffsets>
      <WorkSpeedGlobal>0.06</WorkSpeedGlobal>

A bit of juggling around, alt-tabbing, comparing information in game and restarting the game shows me what scale the values are used at.


edit - yea, I added leather myself :D


I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

sparda666

Quote from: nmid on June 06, 2015, 01:37:35 AM

For eg, I made
<ThingDef ParentName="ApparelMakeableBase"> <!-- ApparelBase -->
    <defName>Apparello_Suspender</defName>

which basically turned the stablehand trousers into a tailorable item for me :p

It was earlier

<ThingDef ParentName="ApparelBase">
    <defName>Apparello_Suspender</defName>

wait, just adding that <!-- ApparelBase --> tag to the thingdef makes it available on the tailoring bench? what defines the crafting materials?

nmid

Quote from: sparda666 on June 06, 2015, 01:50:45 AM
Quote from: nmid on June 06, 2015, 01:37:35 AM

For eg, I made
<ThingDef ParentName="ApparelMakeableBase"> <!-- ApparelBase -->
    <defName>Apparello_Suspender</defName>

which basically turned the stablehand trousers into a tailorable item for me :p

It was earlier

<ThingDef ParentName="ApparelBase">
    <defName>Apparello_Suspender</defName>

wait, just adding that <!-- ApparelBase --> tag to the thingdef makes it available on the tailoring bench? what defines the crafting materials?

No, I changed ApparelBase  to ApparelMakeableBase
and commented out
ApparelBase  using
<!-- -->
which is the equivalent of  // in xml

Check my next post / (previous post). We posted around the same time :)
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

sparda666

Quote from: nmid on June 06, 2015, 01:54:46 AM
No, I changed ApparelBase  to ApparelMakeableBase
and commented out
ApparelBase  using
<!-- -->
which is the equivalent of  // in xml

Check my next post / (previous post). We posted around the same time :)
haha yeah I didnt notice the change in the ParentName attribute. I thought it somehow was taking comments into account.
Okay I see what you did there. This helps me a lot. Now that I understand the structure of these files I think I can make anything craftable now (and probably make certain things that I probably wont build uncraftable so that list of stuff isnt so gosh darn long lol). Thanks again!

Shinzy

My god, guys!
No there is no way to really tell what stuffs the mod contains =P
I tried to make a excel sheet thing containing everything but that was way too much work, the kind of work that I can't bring myself to do ;D

Most of the hats/apparel are uncraftable for a reason! I love the sort of 'gotta catch them all' feeling so, really you'll just need to be lucky =P
plus there's bunch of hats that would become way 'OP' if they'd be available for mass production
and then there'd be the 50+ different craft recipes on a single bench thing ;D

sparda666

Quote from: Shinzy on June 06, 2015, 11:41:09 AM
No there is no way to really tell what stuffs the mod contains =P



Hey Shinzy, Im making a tool to use JavaScript and XSL on an html page to read the Apparello ThingDef files and generate tables containing apparel specific information).

I am attaching it to this post.

Put this in Mods\Apparello\Defs\ThingDefs and then open the Renderer.html in anything other than Internet Explorer (because interet explorer for some reason has different javascript code for inserting text into an html element and right now Im too lazy to figure out how to make it work (also ActiveX is a PoS  :( )).

You can also use this for any other mod.
Put the Transform and Renderer in the ThingDefs folder of another mod
Go in the html file and youll find an xmlArray containing a list of xml files to be transformed. Replace those filenames with the filenames of the other ThingDefs
If you want other types of data in the table, look at the Transform.xsl file and modify (if you can undertand how to read a ThingDef file, modifying this should be easier, but if you have any questions feel free to ask).

Here is a screenshot as a preview of what I get when I run it


Note: It looks like although some items have cost numbers, they dont have a "Work To Make" time value. I am assuming all craftable items have this "Work To Make" tag.


[attachment deleted due to age]

Shinzy

oooh that's very neat!
Yes only the ones using the recipe makers have the 'work to make'
and then some other items that have non stuff ingredients required to make
are done with the recipe defs, those items would also not have the 'work to make' bit in their thing def (i.e. the doctor's brocade seen in your screenshot! that one's made out of brocade vest and some other bits)
well atleast on most cases! my xml's are copypastey mess, Skullywag can attest to that! he'd have me remake all of it if he ever saw them *shudder*

sparda666

Okay so  it looks like the non-stuff craftables dont have the ApparelMakeableBase tag either. Those recipes are stored elsewhere?

Shinzy

Quote from: sparda666 on June 06, 2015, 05:07:48 PM
Okay so  it looks like the non-stuff craftables dont have the ApparelMakeableBase tag either. Those recipes are stored elsewhere?
Aye they're all over the place, some in the RecipeDefs
some use different parentname thingie ApparelMakeableBase is only for the stuffed items, non stuffed items have something like "ApparelloComburthwartle" or "ApparelloLoomins" or so, depending on which workbench they're made on and if they're stuffed or not *shrug*

Told you it's a right mess =P

sparda666

You do a great job though. I understand the structure better now and I think I'm starting to get it.

Adamiks

This tool don't works for me. I used both Chrome and Firefox, in Firefox i get this error
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

In chrome i get nothing.

sparda666

Quote from: Adamiks on June 09, 2015, 10:54:58 AM
This tool don't works for me. I used both Chrome and Firefox, in Firefox i get this error
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

In chrome i get nothing.
did you put both the renderer and transform files in your thingdefs folder?
Open the renderer.html in a text editor and you should see this somewhere in the file:
      var xmlArray =
    [
      "Appasrel_Accessorello.xml",
      "Apparel_Glitter.xml",
      "Apparel_Hightech.xml",
      "Apparel_Industrial.xml",
      "Apparel_Raider.xml",
      "Apparel_Specialty.xml",
      "Apparel_Tribal.xml",
      "Apparel_Urbz.xml",
      "Apparel_Western.xml",
      "Apparel_Wrecked.xml",
      "Hats_Apparello.xml",
      "Hats_ByViperlolello.xml",
      "Hats_Famousello.xml",
      "Hats_FurEyes.xml",
      "Hats_Specialty.xml",
      "Items_Apparello.xml",
      "Production_Apparello.xml",
      "Trinkets_Tinkyslinkies.xml",
      "Weapon_MDK.xml"
    ];


the Access Denied error you are getting usually happens when you try to open a file that you either dont have permissions to access or if the file you are looking for doesnt exist.

if you see that message repeated over and over, it is because I am expecting the above list of xml files in the same directory that the html file is run from. If those xml files are not in the same folder as the renderer and transform, it will not be able to find them