[1.3] Miscellaneous w MAI+Robots

Started by Haplo, May 16, 2014, 05:54:01 AM

Previous topic - Next topic

m33n


WereCat88

Does the ammo system from Combat Realism still work on turreted guns?
I am The Primal Mammelon

Haplo

No, I haven't made a patch for CR yet. Just didn't have the time for it, so as long as I haven't patched it, it won't work with CR.
This is valid for the WeaponBase, the Training Facilities and MAI. And also Robots if you make a combat version..

RagingLoony

Quote from: Haplo on May 26, 2016, 04:34:56 PM
No, I haven't made a patch for CR yet. Just didn't have the time for it, so as long as I haven't patched it, it won't work with CR.
This is valid for the WeaponBase, the Training Facilities and MAI. And also Robots if you make a combat version..

training facilities work fine, I'm using them along with CR, just fyi.

Techgenius

AI Pawn is appearing as a.. "meat" option, MAIs have human meat, so they are synths indeed? :P

Haplo

#1445
Tutorial for adding a new Robot using the Robots Xtension as a base
This is a short tutorial describing how you can make a robot for Cooking while using the the files from the Gardener Robot ( which should really be renamed in Woodcutter ;) ).


1st
We need the DefName of the Cooking-WorkTag. For this we go into Mods/Core/Defs/WorkTypeDefs/WorkTypeDefs.xml. (Open with a texteditor of your choice, like Notepad++ or similiar.)

I've attached the changed Xtension-Mod that has the cooking robot as a second robot.
Here you can take a look at the final result of our changes.

In this file we find this entry:

  <WorkTypeDef>
    <defName>Cooking</defName>
    <labelShort>Cook</labelShort>
    <pawnLabel>Cook</pawnLabel>
    <gerundLabel>Cooking</gerundLabel>
    <description>Prepare meals and butcher meat.</description>
    <verb>Cook</verb>
    <naturalPriority>1000</naturalPriority>
    <relevantSkills>
      <li>Cooking</li>
    </relevantSkills>
    <workTags>
      <li>Cooking</li>
      <li>ManualSkilled</li>
    </workTags>
  </WorkTypeDef>


For our robot we need the following Infos:
The defName itself (here: Cooking)
<defName>Cooking</defName>
And the workTags (here: Cooking and ManualSkilled)
    <workTags>
      <li>Cooking</li>
      <li>ManualSkilled</li>
    </workTags>


Now we need the numbers associated with the workTags. These can be found in this table which I've extracted from the Assembly file:

[Flags]
public enum WorkTags
{
None = 0,
Intellectual = 2,
ManualDumb = 4,
ManualSkilled = 8,
Violent = 16,
Caring = 32,
Social = 64,
Scary = 128,
Animals = 256,
Artistic = 512,
Crafting = 1024,
Cooking = 2048,
Firefighting = 4096,
Cleaning = 8192,
Hauling = 16384,
PlantWork = 32768,
Mining = 65536
}

So here we are: Cooking has 2048 and ManualSkilled has 8.
So our needed number for the workTag-Entry is: 2048 + 8 = 2056

Now that we have the needed info it is time to make changes to the Gardening Robot File.
Open the file Mods\Miscellaneous_Robots_Xtension\Defs\ThingDefs\AIRobot_Races.xml

First change the defName and the description. Caution: The defName MUST be unique! So don't use the same name twice!
Original:

    <defName>AIRobot_GardenerBot</defName>
    <label>Gardener Bot</label>
    <description>A robot for gardening work (like cutting trees).</description>



New:

    <defName>AIRobot_MyCookingBot_Race</defName>
    <label>Cooking Bot</label>
    <description>A robot chef for all your little snacks in between.</description>


And now on to the definition of the active Work-Areas:

Original:

<passionLevel>0</passionLevel>
<startingSkillLevel>4</startingSkillLevel>
.
.
.
<workTag>32780</workTag>
<workTypeDefs>
<li>PlantCutting</li>
</workTypeDefs>


New: (Add here the found values: WorkTypeDef: Cooking // WorkTag: 2056 // And I've changed the starting skill to 12 just for fun )

<passionLevel>0</passionLevel>
<startingSkillLevel>12</startingSkillLevel>
.
.
.
<workTag>2056</workTag>
<workTypeDefs>
<li>Cooking</li>
</workTypeDefs>





2nd
We need to define the PawnKind:
Open the file Mods\Miscellaneous_Robots_Xtension\Defs\PawnKindDefs\AIRobot_PawnKinds.xml
Here we need to change the defName and the race:
Original:

<defName>AIRobot_GardenerBot</defName>
<label>GardenerBot</label>
<race>AIRobot_GardenerBot</race>



<defName>AIRobot_MyCookingBot</defName>
<label>CookingBot</label>
<race>AIRobot_MyCookingBot_Race</race>



If you want to change how the robot looks
Add your Textures next to the three files Mods\Miscellaneous_Robots_Xtension\Textures\Things\AIRobot\GardenerBot_xxxx.png
Then reopen the file Mods\Miscellaneous_Robots_Xtension\Defs\PawnKindDefs\AIRobot_PawnKinds.xml
In here change the following path entry to point to your added files (Note the missing Textures and the missing _xxxx.png!):

<lifeStages>
<li>
<bodyGraphicData>
<texPath>Things/AIRobot/GardenerBot</texPath>



3rd
All that is missing now is its own RechargeStation:
Open the file Mods\Miscellaneous_Robots_Xtension\Defs\ThingDefs\AIRobot_Buildings_RechargeStation.xml

Change the defName and co to your liking:
Original:

    <defName>AIRobot_RechargeStation_GardenerBot</defName>
    <label>GardenerBot Base Station</label>
    <description>This station comes equipped with a specialized robot.</description>


New:

    <defName>AIRobot_RechargeStation_MyCookingBot</defName>
    <label>CookingBot Base Station</label>
    <description>This station comes equipped with a specialized robot.</description>


and don't forget to set your new robot as the attached robot:
Original:

<spawnThingDef>AIRobot_GardenerBot</spawnThingDef>


New:

<spawnThingDef>AIRobot_MyCookingBot</spawnThingDef>


Save and close all files.

Now, if you start a new game, the robot or exotic trader may have your new robot in his collection 8)
(Or you can place the recharge station with the Development-Tool Tool: Try place direct thing..)

[attachment deleted by admin - too old]

berni1212

And if i want to add 1 more do i need to make a New Mod Name like Miscell..........._Miner ???
and copy the things and rename it or is there away to add 2 Bots in 1 File ?
Lost Soul in the World of Rimworld

Demonlord091

Quote from: Haplo on May 01, 2016, 05:56:49 AM
Quote from: Maitri on April 30, 2016, 07:54:31 PM
Unsure if this is a widespread problem but I cannot create new worlds with Miscellaneous Map Generator turned on.

You click 'generate' and then it just blinks and goes back to the world generator screen, creating nothing. With this turned off, it works fine. Took me a while to identify it.
Hmm, I don't know what could be the problem there..
Can you post your output_log.txt file from after you've tried it, please?
You can find it in the folder RimWorld/RimWorldXXXWin_Data/


UPDATE:
I've updated MAI and Robots. This is only a small update to fix the robot trader.
Big thank you to Hiztaar for finding it :)

Furthermore I fixed a ?possible? savegame-breaking bug in Incidents.
This may be the reason why Demonlord091 and ticattack have a destroyed savegame.
The problem is that incidents fires the incident to spawn a new visitor if there isn't anyone nearby.
This spawning was faulty by allowing the colony faction to be a valid faction. This is a problem for the incident handler..
Thanks to Demonlord091 I could identify this big mistake.

I recommend everyone using Misc. Incidents to update to the newest version asap!

Sorry for the inconveniences.  :-[



If you have a savegame that doesn't load because of Incidents, please post it and I'll try to repair it.

If you want, you can also do it yourself:
- open the savegame with a text editor (like notepad++)
- search for <storyteller>
- In there delete all entries in <queuedIncidents> so that it looks like this:
<incidentQueue>
<queuedIncidents />
</incidentQueue>

-save and try to load the game

Sorry it took me so long to get back to you, real life has been...weird lately.

Aside from a few minor hiccups with other mods your tweaks to my save fixed it. Everything is working as it should.
Hell as soon as I loaded your tweaked file I got raided. XD Sort of a "Yay it works!...aw damnit" kind of moment.

Thanks for the help, Haplo. Best of luck.

Haplo

Quote from: berni1212 on May 30, 2016, 08:47:45 PM
And if i want to add 1 more do i need to make a New Mod Name like Miscell..........._Miner ???
and copy the things and rename it or is there away to add 2 Bots in 1 File ?
Take a look inside the attached mod. I've added the new bot to the old one in there.
So yes, you can just expand it.

ramirez333

i'm having something weird happen, cleaner bots would start hauling stuff from across the map even though it says they are incapable of hauling

katjezz

Does anyone of you guys here share their robots? I don't really know how to make them myself tbh.

Also, any chance of items stored in nano storage ever showing up in the resource list on the left?

PaoLorenz

Trying to make it work with a LOT of other mods, still with no success.
As soon as I add it, it crashes telling of incompatibilities.
So far tested it after Core, CCL + Vanilla tweaks, CorePanda, EB Mod Order, EDB Prepare Carefully.

Will test more of this later. Not easy with like 30/40, but I know they worked together fine before this, so I will find out why it doesn't now....

In the meanwhile, any known issues with the ones I listed, witht he exception of the patch for Prepare Carefully (which I have and loaded immediately after the core) ? I will try it without Prepare Carefully, though, just to know if it works.

As soon as I will be able to load it all, I can gladly try some bots and share the code !
:)

Haplo

Prepare Carefully is only incompatible with the MapGenerator.
If you get the errors after adding the mod: did you restart Rimworld? It is a known issue that Rimworld doesn't reload the mods perfectly after you've changed something. Try to close Rimworld and reload. Are the errors still there? If yes, can you provide your output_log.txt file from the RimworldXYZ_Data subfolder?

PaoLorenz

Testing right now.
On LINUX, anyway (did not mention it), and seems the Robot part crashes it all.
It swallows easily the core, map, and others, but adding the Robots causes it to either exit the program or unload all mods for conflicts.
No Logs in the folder you mentioned... i am sure I have to do something to get one, right ?

Weird being a noob and trying to debug a problem in the same time
: )

PaoLorenz

Bingo !
It's the Robot that gives me lots of trouble.
Without that, it exited once, but once reloaded it started just fine creating a new world and colony. Prepare Carefully works fine, and all seems to be in order.
I'll try to redownload the Extended Robots part to check if THAT is the issue.
But so far, everything looks fine(er) !!!