STEAM GROUP
State of Decay Modding Crew SoDModding
STEAM GROUP
State of Decay Modding Crew SoDModding
19
IN-GAME
180
ONLINE
Founded
22 September, 2013
Language
English
Showing 81-86 of 86 entries
6
Editing .cdr files
Here's a more friendly version of that code snippet with some added comments, if it helps.

I think it might be better to change the subject of this post to "Editing .CDF Files" since we're modifying the CDF for which CHRs it points to, rather than CHRs themselves. Should help with search engine optimization as the other would be misleading, no?

I'd also recommend Notepad++ (a free, and full featured, code editor) to open the files, then change the language in the language menu to XML so it is much more readable with the color coding.


=========================
.CDF File Contents Start Here
=========================
<!--Note: This code can be pasted straight into a file, if needed; this comment, and other comments, are XML-based and thus won't cause any trouble.-->

<?xml version="1.0" ?>

<!-- Start of character information -->
<CharacterDefinition>

<!-- Which skeleton to apply the materials and meshes to -->
<Model File="characters/female/human/skeleton/skeleton.chr" Material="characters/female/human/skeleton/skeleton"/>

<!-- Start attachments (Components that make up the parts of the character to be rendered -->
<AttachmentList>

<!-- All the pieces go here -->

<!-- Torso -->
<Attachment AName="body" Binding="characters/female/human/body/leatherjacket_leggings/leatherjacket_leggings.chr" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN" Material="characters/female/human/story_characters/maya_torres.mtl"/>

<!-- Leggy bits -->
<Attachment AName="legs" Binding="characters/female/human/legs/leggings/leggings.chr" Material="characters/female/human/legs/leggings/variant/v01.mtl" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>

<!-- The skin for all of the body except the skull and front of the neck.

Note: it looks like the .chr and the .mtl have to be matched properly or they don't render which results in all of your character's skin, except the head, becoming invisible.

Secondary Note: Some of the female torso clothing skins/materials will render extra skin layers onto the character so you may have to roll your own skin for the clothing in order to resolve that issue, as well -->
<Attachment AName="skin" Binding="characters/female/zombie/skin/shortsleeve/skin.chr" Material="characters/female/zombie/skin/shortsleeve/skin.mtl" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>

<!-- The skin for the skull, front of the neck, eyes, and teeth -->
<Attachment AName="head" Binding="characters/female/human/heads/maya_torres/head.chr" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>

<!-- The skin to be applied to the hair mesh -->
<Attachment AName="hair" Binding="characters/female/human/hair/hair06/hair06.chr" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>

<!-- Left eye and right eye in the default models appear to always use one eye in the skin, then grab that region of the skin to be applied to both; so if you want two different colored eyes you'll have to build your own region then modify the odd eye's position data to target it -->
<Attachment AName="eye_left" Binding="" BoneName="eye_left_bone" Flags="0" Position="-0.032982595,0.13186496,1.8033698" Rotation="0.99999988,-3.7252907e-009,8.9406981e-008,0" Type="CA_BONE"/>

<!-- Right eye - see previous entry for notes -->
<Attachment AName="eye_right" Binding="" BoneName="eye_right_bone" Flags="0" Position="0.032982595,0.13186496,1.8033698" Rotation="0.99999988,-3.7252907e-009,8.9406981e-008,0" Type="CA_BONE"/>

</AttachmentList>

<ShapeDeformation COL0="0" COL1="0" COL2="0" COL3="0" COL4="0" COL5="0" COL6="0" COL7="0"/>

</CharacterDefinition>
2
Char Modding - Meshes - CryBlend (Allows export to CryEngine) for Blender (Free 3D Studio)
Tested and working!

Blender is a free 3D program, and CryBlend is the free plugin to allow it to export for CryEngine interactions. CryEngine is the engine behind state of decay, and there is a FREE SDK (Software Development Kit) for it that will allow us to build our own mods! :)


Contents

How to get and setup all the software/plugins that you need

How to do a very basic runthrough of your own object to be added into the SDK, or dumped straight into State of Decay. Note that, for now, it seems we'd want to simply be replacing the existing items in the game until we can employ a method for implanting our own, otherwise.



Regarding the State of Decay/CryEngine file formats:

.chr = Character format, it contains soft body animated geometry, usually
for a character.

.mtl = CryEngine 3 material format, these files connect textures to objects
in the CryEngine 3.

.cfg = Hardbody components, geometry



How to get Blender

http://www.blender.org/download/get-blender/


How to use Blender

http://www.blender.org/education-help/



How to get CryBlend

Here's the code on GitHub for CryBlend -
https://github.com/travnick/CryBlend

Here's the main page on the CryDev forums -
http://www.crydev.net/viewtopic.php?f=315&t=103136


How to setup and use CryBlend - Part 1

Here's the basic version:

Download CryBlend, extract the .Zip contents to somewhere you can find them. For example, I extracted it to my Desktop because it comes in its own folder. You then go into the folder it extracts - "" - and put the io_export_cryblend folder into your addons folder for blender once it is installed. Your path, if following the default, should look something like this - C:\Program Files (x86)\Blender Foundation\Blender\2.68\scripts\addons\io_export_cryblend

After that, you can load up Blender and - as you'll note the manual misses - you'll want to first go to the top menu and go to File, then User Preferences, then File which is at the top of the User Preferences window, in the middle.

Here we have to target the place for it to find those files we just put in the addons folder because it doesn't direct it there by default. So, a few lines down in the main window you'll click the little folder icon on the right side of the text-input region for Scripts. Here well locate the following - [Where you installed Blender, see mine as an example above]\Blender\?.??*\scripts\addons\io_export_cryblend - then click the button in the lower left labeled "Save User Settings" then close and reopen blender, just for kicks ;)

*Replace this section with whatever version you have, as of this writing the latest version is 2.68

Now we can follow the manual again and go to File > User Preferences > then Addons, at the top > Then click import-export on the left and locate the one labeled "Import-Export: CryEngine3 Utilities and Exporter" and put a check in the box way on the right. Note that it is probably a light gray color, but you can check the box anyway and it will have black text instead, to show you that it enabled. Maybe close and reopen one more time just to assure it refreshes. If your UI goes weird like mine then you won't actually see the CryEngine menu at the top because of the miscellaneous data stuffing it offscreen to the right. I'll update this if I find a way to stop that from happening. :P

For now, you can right click on the menu up there in any part where there isn't an element to choose from. For example you can right click the part where it shows the blender logo, the version, and the data about how many faces, vertices, objects, et cetera. If you do that and then choose "Maximize Area" or press Ctrl + Up Arrow on Windows, then it'll take up your screen and behold that CryEngine menu will be on the right! To get it back, just right click in the same place you clicked before on the menu and then choose "Tile Area" or press Ctrl + Up Arrow. Using the key command is better because it doesn't takeover your workspace, just makes the top menu parts more visible. Note that you'll have to be clicked into the window where the geometry is, basically.

One other bit to setup in that CryEngine menu which I'm going to steal directly from the CryBlend manual -

"Additional set up is required for the Run Resource Compiler feature
which allows Cryblend to run the Resource Compiler at the same time
as the export from Blender, accelerating the production of objects. In
order to do this, select in the Cryblend menu select Find the Resource
Compiler and navigate to CryEngine3\BinXX\rc\rc.exe and select it."

Phew, okay; you're all set on the enablement front! (We won't ask what an enablement back is, ahem)


How to setup and use CryBlend - Part 1.5

Alright, let's fiddle!

We'll begin by using the method for finding the CryEngine menu as mentioned in the last paragraph. In the menu choose Add CryExportNode, then type in a name you want. Let's go with "Shroedingers Box" just to keep things simple (Unless you're not a super speller, then Shroedinger may pose a problem for you)

If you started with the default page then Blender delivers you a box, perhaps there's a cat inside, condition unknown - at least until you check ;)

So lets do it all the easy way and press the letter A which should select everything you have in the world there, just the camera, the lighting, this box and Mr. Shroedinger's cat inside it.

Let's then click down there just to the right of the UI portion that says "Object Mode" and click the button with the white sphere. That's how we change whether it is a wireframe, solid, textured, or even all-out rendered. We'll choose textured, so we can make sure we're doing things right.

Afterwards, you can press the tab button to go into edit mode, or click the button that says "Object Mode" and then click "Edit Mode" there.

Next, we'll either press the letter U on the keyboard for "Unwrap," or click on the word Mesh to the left of the box where we saw Object Mode change to Edit mode. Then choose UV Unwrap > then Smart UV Project (Or unwrap...but the other is smarter ;) ), then click OK if you chose the Smart way.

Next we'll bring up our view for fancy materials by going to the top menus (or possibly the bottom if your default setup went funky.) and find the word "Default" in a box, with a + and an X on the right. Click the word default and then choose UV Editing. This will bring us to an easier view to manage what we're doing.

At the bottom left - hopefully - you should have the words View, Select, Image, and UVs. Click the word Image > then Open Image > Then we'll track down our State of Decay folder, mine is - C:\Program Files (x86)\Steam\steamapps\common\State of Decay

Note: Once you fiond the folder in the main window, you can click to add a bookmark of that on the left there in the sidebar. I marked the main folder for CryEngine and State of Decay, and also the key object folders we'll hit next.

If you've already unpacked your object & textures folders, as you should have (Find out how by going here - http://forums.undeadlabs.com/showthread.php?33518-How-To-Change-keybindings-and-other-graphical-settings) then we'll go to the Game folder in the State of Decay folder, then textures, then whatever you want. For our purposes, we'll say Shroedinger likes a bit of rustic charm in his boxes, so he's chosen hardwood_floors01_spec.dds (C:\Program Files (x86)\Steam\steamapps\common\State of Decay\Game\textures\wood\hardwood_floors01_spec.dds)

Note: you can click the 4 little squares button a few buttons to the right of the New Directory button, there in the top of the file viewer in order to see things as tiled images instead. Much easier to find your textures that way.

Alright, now that we've chosen, we can press the letter A on the keyboard again and then rotate the camera if we need to in order to see our lit box with textures. Hold down your middle mouse button and rotate any direction to move the camera around the box - better to see it with.

Fancy, huh?

Stealing once more from the manual (updated for shroedinger instead of a primate...wait a second... ;) ):
"
The key thing about textures is to save them externally. When you've finished
creating your texture and are happy with it, select Save As Image. Save the
image as .tif format in the same folder as your .blend file. You can specify .tif
on the left hand side during the saving process. It is also CRUCIAL you do
this after making changes to the texture in Blender as Blender will not save
them itself.

The next step is to export your model. In the Cryblend menu go down to
Export To Game and select it. You will be given the option to save your .dae
file. Save it in the same folder as your .blend and your .tif files. Make sure
CGF, Do Not Merge Nodes and Run RC and Do Materials are ticked on the
left hand side.

When you're done press Export To Game in the top right corner. This will run
Cryblend and create your .dae file. It will then give the .dae to the Resource
Compiler and because we have Run RC and Do Materials ticked instead of
Run Resource Compiler, it will also make your .mtl file.
If the process worked, there should now be monkey.cgf and monkey.mtl files
in your folder. If it did not work, check the Blender console (accessed
through the Toggle System Console button in the Window menu on the info
bar). You can also check the logs of the Resource Compiler, located at
CryEngine3\BinXX\rc\rc_log.log

A file may also be created during the export called monkey.dae.rcdone. This
file is not important and you can delete it.

You must also convert your .tif texture file. Open up your folder in one
window and CryEngine3\BinXX\rc\ in another and drag and drop any texture
files one at a time onto the rc.exe, this will convert the files to .dds. You can
also convert your .dae files this way, though it will not produce any .mtl files.

You should now have a folder containing the following files:
shrondingers box.blend
shrondingers box.tif
shrondingers box.dae
shrondingers box.cgf
shrondingers box.dds
shrondingers box.mtl
additionally you may have:
shrondingers box.dae.rcdone
shrondingers box.blend1
shrondingers box.blend2

Now you have to add these objects to the CryEngine 3 [Phacop's note: see the bit about CryEngine below] so that they can be
used in it. Copy or move shrondingers box.cgf, shrondingers box.dds and shrondingers box.mtl into a
folder inside of the CryEngine3\Game\Objects\ directory, for instance
CryEngine3\Game\Objects\props\shroedinger\

Open up the CryEngine 3 and select Geom Entity on the Rollup Bar on the
right hand side, and navigate to the folder where you placed your monkey,
select it and drag it into the viewport to drop it into the world.
"

Note: if you run into any trouble with CryBlend not exporting, there are known reasons why it might happen. The key things are faces that are all on the same line (the plane of an object, not a person's face), or when there are extra vertexes sharing the same point on space. You can use the CryBlend menu to solve that with the two options there. Easiest way to clean up the vertexes, though, is to press A on the keyboard to grab all your stuff on screen and then, on the left in the default view in blender, click "Remove Doubles" it's midway down in the sidebar. Anyway - this is why we did it with the cube first to prove that it works, you may want to do it to, just to prove it's working on your machine.



-----

For a more in-depth look at what I just said, or for more data on the subject; the Cryblend User Manual can be found here -
http://www.crydev.net/viewtopic.php?f=315&t=103136&p=1114586#p1114586

Cryblend video tutorials can be found here -
http://www.youtube.com/channel/UCr1LTc3 ... ture=watch



How to get the FREE CryDev SDK

Get it here:

http://www.crydev.net/dm_eds/download_detail.php?id=4

Register for a FREE account for it here:
http://www.crydev.net/ucp.php?mode=register&sid=1c5b7f33617c199fc3609f2b238b4a9a

(Want to know more about characters, and not just world objects, go here - http://gtm.steamproxy.vip/groups/stateofdecaymodding/discussions/0/864980277909273594/)



Real example to show you how it goes

You can actually, open the SDK, then follow this guide from Warhead Killor on how to do it, basically.
http://gtm.steamproxy.vip/groups/stateofdecaymodding/discussions/0/864980277909273594/#c864980734476171117

Long story short, they said

"Pretty much in short. Copy the objects folder from State Of Decay into the Game folder into Cryengine. Load it up, and follow this: http://freesdk.crydev.net/display/SDKDOC2/Placing+and+Modifying+Objects

(I would recommend giving a very good general look of the whole sandbox manual, as it applies to mostly everything in CryEngine modding or otherwise)

Some will have their textures and materials already pre-applied, others may need the textures folder."

Do that, then when you've got an object from the game into the world - Exempli gratia C:\Program Files (x86)\Steam\steamapps\common\State of Decay\Game\objects\architecture\bases\buildings\base_small_church_01\base_small_church_01.cgf

You can then select the object then, go to File > then Export Selected Geometry to .OBJ

This will allow you to open it in Blender directly, and start playing with it. :)

Once you finish playing with it, you can send it on back to the object folder by following the methodology listed above in the CryBlend portion of the How-to. I save it into the object folder of CryEngine, make sure it looks right in the game world, then I - after assuring I made a back-up copy!!!!!!!!!!!!!!*infinite loop - copy the CGF and the MTL file into the State of Decay folder with the same name so it uses those resources instead. Just remember to leave some of the parts the way they are since the pathing is already based around that - otherwise wonky things may happen. <booming voice from clouds> You've been warned! </booming voice from clouds>

I suggested the Church, and have used it, because that would give you [and me] the starting-base church for an easy way to test and fiddle from the start of the game, if you [or I] wanted.
7
Difficulty Mod
6
Editing .win.bmd or .xml files?
22
Changes do not take effect
Showing 81-86 of 86 entries