Sims 4: Guides: Difference between revisions

From All The Fallen | Mods
Jump to navigation Jump to search
Jens85 (talk | contribs)
m due this page is to long, added collapsible divs
Jens85 (talk | contribs)
No edit summary
Line 2: Line 2:
=Modding Guides(Sims 4)=
=Modding Guides(Sims 4)=
Here you find the guides for making your own mods to The Sims 4, basically animations and specially WickedWhims.
Here you find the guides for making your own mods to The Sims 4, basically animations and specially WickedWhims.
==Decompile ''.ts4script'' files==
These are simply a ''.zip'' format file containing a python script mod, renamed to ''.ts4script''. So, to open it, just rename the file to ".zip" and extract.
You will find compiled ".pyo" files, in order to be modified you may need to decompile those. Finally you'd be able to edit them, than compile and archive again.
===Requirements===
#[https://www.python.org/download/releases/3.3.3/ Python v3.3.3]
#A text editor (Like [http://notepad-plus-plus.org/ Notepad++])
#[https://github.com/figment/unpyc3/raw/master/unpyc3.py This] python script (unpyc3.py).
===Steps===
{| style="background-color:#f8f9fa; border: 1px solid #eaecf0;"
|
#Install Phyton.
#Create a working folder, and put a copy of the desired ''.pyo'' files in it.
#Open the script link, copy the whole text, paste it into your text editor and save it to filename "unpyc3.py"
#Put "unpyc3.py" in your folder.
#Create a ''.bat'' file in the same folder with the following content:<br />
<pre>
@echo off
for /r %%i in (*) do unpyc3.py "%%i" > %%i.py
pause
</pre>
:  6.(Optional) Create a second ''.bat'' in the same folder with the following:
<pre>
for /r . %%i in (*.pyo) do del "%%i"
for /r . %%i in (*.pyo.py) do ren "%%i" "%%~ni"
for /r . %%i in (*.pyo) do ren "%%i" "%%~ni.py"
pause
</pre>
:  7. Run the first .bat file. You'll see some errors, but that's okay.
:  8. Then run the second .bat file.
|}<ref>TheSims: [https://forums.thesims.com/en_us/discussion/899307/how-to-make-and-edit-pyo-files How to make and edit pyo files]</ref><ref>ModTheSims: [http://www.modthesims.info/showthread.php?t=533337 How to change the simulation clock speed by changing maxis scripts]</ref>
Now you got all your ''.py'' files into your folder, the second ''.bat'' deletes the ''.pyo'' files.
==Converting existing adult WW animations==
==Converting existing adult WW animations==
''By Alec15'' <ref>ATF: [https://allthefallen.moe/index.php?/topic/5724-sims-4%C2%A0whickedwhims/#entry185533 Alec15]</ref>
''By Alec15'' <ref>ATF: [https://allthefallen.moe/index.php?/topic/5724-sims-4%C2%A0whickedwhims/#entry185533 Alec15]</ref>

Revision as of 00:28, 29 June 2017

Modding Guides(Sims 4)

Here you find the guides for making your own mods to The Sims 4, basically animations and specially WickedWhims.

Decompile .ts4script files

These are simply a .zip format file containing a python script mod, renamed to .ts4script. So, to open it, just rename the file to ".zip" and extract.

You will find compiled ".pyo" files, in order to be modified you may need to decompile those. Finally you'd be able to edit them, than compile and archive again.

Requirements

  1. Python v3.3.3
  2. A text editor (Like Notepad++)
  3. This python script (unpyc3.py).

Steps

  1. Install Phyton.
  2. Create a working folder, and put a copy of the desired .pyo files in it.
  3. Open the script link, copy the whole text, paste it into your text editor and save it to filename "unpyc3.py"
  4. Put "unpyc3.py" in your folder.
  5. Create a .bat file in the same folder with the following content:
@echo off
for /r %%i in (*) do unpyc3.py "%%i" > %%i.py
pause
6.(Optional) Create a second .bat in the same folder with the following:
for /r . %%i in (*.pyo) do del "%%i"
for /r . %%i in (*.pyo.py) do ren "%%i" "%%~ni"
for /r . %%i in (*.pyo) do ren "%%i" "%%~ni.py"
pause
7. Run the first .bat file. You'll see some errors, but that's okay.
8. Then run the second .bat file.

[1][2]

Now you got all your .py files into your folder, the second .bat deletes the .pyo files.

Converting existing adult WW animations

By Alec15 [3]

This is a tutorial for converting existing WW animations into child animations.

If you want to create animations from scratch, follow TURBODRIVERs tutorial on the original WW page. You can use the rigs provided here.

Below are two methods for converting animations. The first uses normal rigs, and the second uses IK rigs. The IK rig method is faster and gives good results, but can be a bit tricky. If you don't know what IK rigs are, I suggest using the first method.

This tutorial is meant as a starting point for conversions. It wont give you a finished conversion, you will have to fiddle with the adjustments until you like them

Requirements

Method 1

Exporting Animations

  1. Make a working folder in your Documents\Sims 4 Studio\Mods folder.
  2. Find the WW animation you want to convert and put a copy of it in your working folder.
  3. Make another copy of the animation in the working folder. I'll refer to this copy as the working copy.
  4. Open your working copy in S4S.
    1. Click the Warehouse tab.
    2. Click the first Clip or Clip Header in the list on the left.
    3. On the right find the field called Name or SourceFileName.
    4. One of these will hopefully indicate, if it is a male or female animation. Make a note of that.
    5. Click the Studio tab.
    6. Chose Adult Male or Adult Female depending on your note.
    7. Click Export and save the file.
    8. Go back to the Warehouse and delete both the Clip and Clip Header (with the same Name field) and Save.
    9. Go back to the Main Menu in S4S and open the same file again.
    10. Repeat this process for every Clip and Clip Header pair in the working copy.

You should now have a .blend file for each actor in each animation. Make working copies of each, so that you can always revert to the original, if you make a mistake later on.

Importing rigs into Blender

Each complete WW animation has a .blend file for each actor. If the original mod creator has been orderly with the naming you should easily, be able to recognise which files make up a complete animation.

  1. Open one of your working copies .blend file for the animation you want to work on.
  2. Append (File->Append) the Scene for the next actor for that animation.
  3. Save!
  4. Repeat for every additional actor in the complete animation.

You should now have a Scene in Blender for each actor.

Example

I'm using TURBODRIVERs builtin animations from WW here

The complete cowgirl animation consists of:

  • TURBODRIVER_cowgirl_1_male.blend
  • TURBODRIVER_cowgirl_1_female.blend
  1. Open TURBODRIVER_cowgirl_1_male.blend
  2. Append TURBODRIVER_cowgirl_1_female.blend\Scene\Scene
  • If you mistakenly exported a rig with the wrong gender, don't worry you can fix this now.

You need to import the rigs for all the actors you want in your final animation.

  • Append the Scene for each rig.
    • If you are going to use an adult male, append the Edited Male Rig.
    • If you are going to use an adult female, append the Edited Female Rig.
    • If you are going to use an child male, append the Edited Child Male Rig.
    • If you are going to use an child female, append the Edited Child Female Rig.

Exchanging Rigs and Animations in Blender

  1. Find the Scene in the Outliner of one of the actors (not animations) you have appended.
  2. Expand the rig.
  3. Make sure, that all elements (rig and meshes) are visible and selectable.
  4. Switch to Object Mode and Select All in 3D View.
  5. Copy (ctrl-C).
  6. Select the top Scene in the Outliner.
  7. Switch to Object Mode and paste (ctrl-v).
  8. Repeat for each actor you need in your final animation.

You should now have all the actors you need for your final animation in the top Scene.

  1. Click the original animated actor rig in the top Scene of the Outliner.
  2. Change the Context Editor (it's the dropdown to the left of the Key menu) in the Dope Sheet to Action Editor.
  3. Note the Action (to the left of the Context Editor).
  4. Click the actor rig of the imported actor, whom you want to have this animation in the Outliner.
  5. Click Browse in the Action (up/down arrows) and select the animation.
  6. Right click the original actor in the Outliner and select Delete Hierarchy.
    • Note! you might just want to hide the actor or move it to another layer, if the animation is on an object, like a bed, so that you can adjust the hight of your actors correctly.
  7. Go to the next Scene in the Outliner to repeat for every actor in the final animation.
  8. Delete all Scenes in the Outliner except the top one.
  9. Save!

You should now have your actors in one scene with the original animations applied.

Manipulating Animations

  1. Check the animation in the Dope Sheet to see, when the final frame is and make sure, that your End frame in the Timeline is the same.
  2. Start moving your actors around.
    • I recommend staring from the top most bone (ROOT) and working your way down.
    • Except for the ROOT bone, I recommend only trying to change the rotation and not the position.
  3. Work as much as you can on the bones, that have only the initial keyframe.
    • For bones with only the initial keyframe:
      1. Make sure, you are on frame 1 and adjust the bone in the 3D View and key it.
    • For bones with animations:
      1. Create another window under the Dope Sheet and change it to Graph Editor.
      2. Select the bone or pair (R/L) of bones you are working on.
      3. Expand the Channels for the bones int the Graph Editor.
      4. Deselect the X, Y and Z Location and deselect all but one Rotation.
      5. Select all points of the curve.
      6. Move the Curve up/down (g, y) to see how this rotates your bone press ESC.
      7. Find the high/low points of the curve and see if it needs to go up or down at each point.
        • If it needs to go in the same direction at each point, Move the Curve.
        • If it needs to go in opposite direction Scale (s, y) the Curve and then Move it.
  4. Repeat from the top bone and work your way down until your are happy with your animation.
  5. Save!

Turning you animation into a WW animation

  • Follow TURBODRIVERs tutorial on how to put together a WW animation.
  • If you have used Method 2, don't worry about the additional bones and constraints. S4S will recognise your rig and animation correctly.
  1. Once you get to the WW XML file open the original WW animation in S4S and copy the values from there (unless you have changed something from how the original animation worked), except your name, animation name and text string references.
  2. Once you have put together your own WW animation package you need to open the original WW animation again in S4S.
    1. Go to the Warehouse tab and select the first Clip.
    2. On the right find the field named Events and click on Edit items...
    3. A new window will open and you will see one or more Sound items in the list.
    4. For each item note the SoundName and Timecode on the left. Also not which Clip (actor) it belongs to.
    5. Repeat for all Clips.
  3. Open your WW animation in S4S and find the corresponding Clips in the Warehouse, that you have just noted.
    1. For each Clip find the Events field and Edit Items...
    2. Replace the values SoundName and Timecode of the existing Sound, with the ones you have noted.
    3. Add more sounds if needed by selecting SoundEvent in the dropdown on the right and click Add.
    4. Repeat for each Clip.
    5. Click Save.
      You now have your own WW animation.
  4. Put it in your Mods folder and test it.

Method 2

Exporting Animations

Same as Method 1

Importing rigs into Blender

  1. Follow the step "Importing rigs into Blender" from Method 1, but use the following rigs instead of the ones listed in the requirement:

Exchanging Rigs and Animations in Blender

Same as Method 1

Manipulating Animations

Once you have done all the rough changes using the procedure above, you can adjust the details of the rig using IK.

  • You might want to turn off the eye controllers, if the eyes look all weird.
    You can do this by digging down in the rig in the outliner to the b__L/R_Eye__, b__L/R_LoLid__ and b__L/R_UpLid__ and disable (eye button in the Bone Constraints) the Copy Rotation.
  • The IK rigs have IK chains in the spine, neck, head, jaw, arms and legs. From the clavicle to the hand and thigh to foot.
  1. Adjust the general animation:
    1. Go the frame 1.
    2. Place the bone where you want it to be in that frame.
    3. Select all the bones in that chain.
    4. Insert Keyframe for VisualLocRot (i). (See example bellow)"
  2. While all bones in the chain ar still selected go to the Graph Editor:
    1. Disable (eye icon) all but the top most graph.
    2. Select all keyframes except the first.
    3. Zoom in, so that you can see the full length (plus a bit more) of the animation and very close to the height of the first couple of ##frames.
    4. Place the (Graph Editor) curser at the first frame, making sure, that it has the exact same height (y direction).
    5. Move the remaining frames (g, y), so that the ending height of the graph is the same as the beginning, using the curser as guide.
    6. Repeat for all graphs.
    7. For the location graphs, there should only be the first keyframe and you can skip this procedure for those
  3. Play the animation (alt-a), it should look much better now.

Example (using the left hand):

  1. Place the left hand where you want it to be.
  2. Select Left Hand, Left Forearm, Left UpperArm and Left Clavicle.
  3. Insert Visual LocRot
  • There might still be some points at the extremes of a movement, that don't look right.
  1. Adjust extreme points:
    1. Find the frame with the extreme, that needs to be adjusted.
    2. Place the bone where you want it to be in that frame.
    3. Select all the bones in the chain
    4. Insert KeyFrame for VisualRotation (i)
  2. While all bones in the chain are still selected go to the Graph Editor:
    1. Disable (eye icon) all but the top most rotation graph.
    2. Select all keyframes except the first and the one you ar adjusting.
    3. If there are only those two keyframes in the graph. Select the one you are on and delete it. Move on to the next rotation graph.
    4. Zoom in, so that you can see the full length (plus a bit more) of the animation and very close to the height of the first couple of frames.
    5. Place the (Graph Editor) curser at the first frame, making sure, that it has the exact same height (y direction).
    6. Scale the remaining frames (s, y), so that the current frame fits nicely into the graph.
    7. Move the remaining frames, so that the ending height of the graph is the same as the beginning, using the curser as guide.
    8. You may need to repeat scale/move a couple of time to get it right.
  3. Repeat for all rotation graphs.
    If the keyframe you are adjusting is the last one in a graph. Do not scale the graph!
  4. Select your current keyframe and move it back in line, so that it lines up with the first one.
  5. Play your animation, the extreme points should now have been reduced.
  • You can repeat this for other extreme points in the animation, just remember, which frames you have already adjusted.
  • Always deselect these when scaling or moving the graphs and always make sure, that the graph ends up aligning to all the keyframes you have adjusted.
  • If you need to do this for several extreme points, you might need to adjust parts of the graph individually.

Example (you have keyed two extremes and the first frame):

  1. Select the graph except the points you have keyed.
  2. Adjust (scale and move) the graph so that it fits between the two extremes
  3. Select the graph between the first frame and the first extreme.
  4. Adjust this, so it fits between the two frames.
  5. Select the graph after the last extreme.
  6. Adjust this, so it fits between the extreme and places the last frame on the same level as the very first.

Example (you have keyed several similar extremes and the first frame):

  1. Place the cursor on the first frame or at 0,0.
  2. The similar extremes will mostly fall on the same side of the horizontal line.
  3. Select the graph on this side of the horizontal, except for the frame you have keyed.
  4. Adjust this side of the graph until it fits all you keyed frames.
  • Save!

Turning you animation into a WW animation

Same as Method 1

References