Various modding questions and answers

Started by ItchyFlea, February 19, 2014, 07:40:33 PM

Previous topic - Next topic

SlimeCrusher

I have a quick question, will the pawns be fixed on Alpha 3? You know, the graphical error, even when the texture is on the folder and the direction is ok, that it randomizes a texture even though everything is ok.
Also, we will be able to do hostile pawns right? I tried changing my <defaultTeam> on my Blob mod, it attacks, but it mostly wanders around without attacking anyone with squirrel/boomrat/torso graphics lol.

Hexxagon

A little texture question, Tynan; how did you make the Wall_Blueprint_Atlas? Did you make it with filters out of the original?? Or manually?

Tynan

Quote from: Hexxagon on March 01, 2014, 01:54:11 PM
A little texture question, Tynan; how did you make the Wall_Blueprint_Atlas? Did you make it with filters out of the original?? Or manually?

I think I just took the original wall and colored/hid some of the layers. It's the black outline layer, changed to white, with some other ghosty stuff added. I can't fully remember.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Hexxagon

Quote from: Tynan on March 01, 2014, 01:55:38 PM
Quote from: Hexxagon on March 01, 2014, 01:54:11 PM
A little texture question, Tynan; how did you make the Wall_Blueprint_Atlas? Did you make it with filters out of the original?? Or manually?

I think I just took the original wall and colored/hid some of the layers. It's the black outline layer, changed to white, with some other ghosty stuff added. I can't fully remember.

Thanks, I´ll try that :D

Hexxagon

How do I define the LinkFlag to my table? I tried ModularTable  for defName, Building_Table for eType and Modular Table for label.

rick0

I have a small question that someone will probably know the answer to off the top of their head.

When the new resources I have created get placed in the stockpile they appear as expected in the top left corner with the number beside a picture of them. But the thumbnail just says 'No Resource', how can I get the correct texture to show?

Tynan

Quote from: rick0 on March 02, 2014, 10:13:48 AM
I have a small question that someone will probably know the answer to off the top of their head.

When the new resources I have created get placed in the stockpile they appear as expected in the top left corner with the number beside a picture of them. But the thumbnail just says 'No Resource', how can I get the correct texture to show?

It probably needs a <label> tag.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

rick0

A little mistake, I meant to say 'Missing Content' instead of 'No Resource'.

Thanks for the reply Tynan, but I'm still having trouble.

This is my code for watermelons for example, pretty much identical to potatoes but with some modified values.

<ThingDef ParentName="ResourceBase">
<defName>RawWatermelons</defName>
<label>Watermelons</label>
<description>Raw watermelons.</description>
<textureFolderPath>Things/Item/Resource/PlantFoodRaw/Watermelons</textureFolderPath>
<interactSound>FoodDrop</interactSound>
<basePrice>2.5</basePrice>
<food>
<quality>Raw</quality>
<nutrition>15</nutrition>
<eatenDirectThought>AteRawFood</eatenDirectThought>
<eatEffect>EatVegetarian</eatEffect>
</food>
<storeCategories>
<li>PlantFoodRaw</li>
</storeCategories>
</ThingDef>


I have the label in place already because I copied potatoes from the core but can't figure out why it won't work, how does label tag relate to the thumbnail? Is it the naming of my textures or perhaps the <textureFolderPath> maybe?

Tynan

Did you also copy the ResourceBase item from the core Resources.xml? It has to be in your xml file to be used as a parent. Are you getting any console errors on startup? Hit the ` key to see the console.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

rick0

Yeah I've checked the console in game and saw no errors and my xml also has the base item. Everything is working as intended apart from the missing icon where it would show you your stock levels.

SlimeCrusher

#85
Umm ok, i was developing a coffee mod, my objective is to make a drink (aka food textured into a cup) that increases rest a LITTLE bit (20 or 15 only) (Not sure if possible in A2), but im running into a problem, well, first of all, all of that its my objective, ATM i only have the plant and the coffee beans, but i have a problem... Its unhaulable! I tried right-clicking but nothing appears, i also tried putting hauling at first priority, nothing works, it may be the .xml, but its all ok for me, not sure, its not in a completely un-enterable room or anything also, but the strangest thing is... They EAT it! They don't haul it but instead, they EAT it!
Quote<?xml version="1.0" encoding="utf-8" ?>
<Resources>


   <ThingDef Name="ResourceBase" Abstract="True">
      <defName>base_Resource</defName>
      <thingClass>ThingResource</thingClass>
      <label>Unspecified resource</label>
      <category>Item</category>
      <eType>Item</eType>
      <isResource>true</isResource>
      <useStandardHealth>true</useStandardHealth>
      <selectable>true</selectable>
      <maxHealth>100</maxHealth>
      <altitudeLayer>Item</altitudeLayer>
      <stackLimit>75</stackLimit>
      <description>Resource lacks desc.</description>
      <comps>
         <li><compClass>CompForbiddable</compClass></li>
      </comps>
      <beauty>Ugly</beauty>
      <alwaysHaulable>true</alwaysHaulable>
      <drawGUIOverlay>true</drawGUIOverlay>
      <rotatable>false</rotatable>
      <pathCost>15</pathCost>
   </ThingDef>

   <ThingDef ParentName="ResourceBase">
      <defName>CoffeBeans</defName>
      <label>Coffe Beans</label>
      <description>Coffe beans, for making coffe!</description>
      <texturePath>Things/Item/Resource/PlantFoodRaw/CoffeBean</texturePath>
      <interactSound>FoodDrop</interactSound>
      <basePrice>5.5</basePrice>
      <food>
         <quality>Raw</quality>
         <nutrition>3</nutrition>
         <eatenDirectThought>AteRawFood</eatenDirectThought>
         <eatEffect>EatVegetarian</eatEffect>
      </food>
      <storeCategories>
         <li>PlantFoodRaw</li>
      </storeCategories>
   </ThingDef>

</Resources>

It may be me, as really when i opened my Resources.xml file, it was all messed up, not in a list, so i had to manually remove spaces to make it into a list...

BTW, rich0, shouldn't you be able to eat a watermelon without the effect of "Eaten raw food"? Like, "Cooked Watermelon", what the hell is that? :p

Umm.. Also yea, i know "coffee" is misspeled in the resources thingy, i noticed after modifying, english is not my native lenguage lol

WorldOfIllusion

#86
Wondering if there is a way to make something unavailable after a research has been completed? For example, have a research 'advanced batteries' that makes the original kind of battery no long available, but allows a new kind of battery (that is, for example, more efficient) to be built? I tried having my own battery definition with the prerequisite research but it just overrode the original battery meaning no battery could be built until you completed the research.
Also, a second question, what controls what surfaces a plant can grow on? For example poverty grass can grow on sand, whereas bushes can't. However I can't see anything in the XML that specifies this (unless I'm derping and missing something obvious)?
Artistically challenged modder seeking artistically talented texturer's help. Please, please, PM me :)

SlimeCrusher

rick0, i found a solution to your problem AND mine... Not sure how i fixed mine though, it just happened to work, but yours, i know:
Change your <textureFolderPath> to <texturePath>, it should work now, i tried using <textureFolderPath> but it didn't worked, so i tried <texturePath> and it worked, also happened that it actually is haulable!

rick0

Cheers Slimecrusher, I'll try that out and see if it works.

Also, don't you cook your watermelons? :D

Thanks for the help!

Tynan

Quote from: WorldOfIllusion on March 03, 2014, 08:12:36 AM
Wondering if there is a way to make something unavailable after a research has been completed? For example, have a research 'advanced batteries' that makes the original kind of battery no long available, but allows a new kind of battery (that is, for example, more efficient) to be built? I tried having my own battery definition with the prerequisite research but it just overrode the original battery meaning no battery could be built until you completed the research.
Also, a second question, what controls what surfaces a plant can grow on? For example poverty grass can grow on sand, whereas bushes can't. However I can't see anything in the XML that specifies this (unless I'm derping and missing something obvious)?

That's not supported now, but it's a good idea and I'll try to get to it.

As for the texturepath thing, yes, sorry I wasn't around to mention that, but you should use texturePath if you're addressing a single image, and textureFolderPath if you're addressing a folder with a variety of images.
Tynan Sylvester - @TynanSylvester - Tynan's Blog