Difference between revisions of "User:Infinithil"

From Sim Settlements
Jump to: navigation, search
m
(+next project)
Line 11: Line 11:
 
Workshop area
 
Workshop area
 
----
 
----
[[Toolkit Extra - Animated Objects]]
+
[[Toolkit Extra - Branching Building Plans]]
 
----
 
----
  
''All of my guides will highlight things that are specific to your experience level: <span style="color:#006400">'''Green for beginners'''</span>, and <span style="color:#FF0000">'''Red for seasoned modders'''</span>. So if you’re new, you aren’t meant to understand the red messages, and if you’re a vet - you can probably skip the green.
+
This tutorial assumes you know basic navigation and keyboard shortcuts to navigate the Creation Kit. If not, please go back and check out the Creation Kit 101 primer.
  
This tutorial will go over several methods for animating objects for use with Sim Settlements. This is an advanced tutorial and assumes you’ve gone through all of the tutorials for creating a Sim Settlements building.''
+
All of my guides will highlight things that are specific to your experience level: Green for beginners, and Red for seasoned modders. So if you’re new, you aren’t meant to understand the red messages, and if you’re a vet - you can probably skip the green.
  
  
==Preamble==
+
Preamble
  
These tutorials are no substitute for 3d Studio Max experience. While you’ll be able to add some very good looking animations with these methods, they are never going to be exactly as you envision them because these methods have certain limitations.
+
This guide assumes you’ve completed all of the previous tutorials and feel very comfortable with creating building plans. It also assumes you have played with the Advanced Industrial plot introduced with the Industrial Revolution expansion, and understand how they work in the game.
  
Two of these methods are re-using existing animations and replacing the assets that are being animated, you have some amount of control over the details, but it’s not perfect. The third method can pull off some very convincing production lines, but is limited by what the game engine can handle.
+
There are three ways to make use of Branching Building Plans, one of the methods requires much less work than the others and will be described at the end, the last is very complex and lets you generate the entire branching plan from scratch, and the second option is somewhere in-between.
  
This preamble isn’t meant to scare you away from using it, but to temper your expectations, so you understand you’ll probably have to make some sacrifices. You’ll still have some of the coolest settlement set pieces around, they just might be slightly different than you dreamed up.
+
It’s important you understand how the entire system works before applying any of the methods. So even though this will include steps along the way (for organizational purposes), it’s recommended you read through the entire guide once and then come back through to build your plans once you’re certain which of the two methods makes more sense for you.
  
  
==Programs Needed==
+
Master Building Plans
  
*'''Nifskope 2.0.6 Alpha or higher '''
+
A Master Building Plan uses the same script as a normal building plan, but only uses a single property (for compatibility reasons it had to be derived from the same script or the framework’s inheritance system would no longer function correctly). The BuildingPlanPaths will be set to a Form List to hold all possible paths this plot can take once it makes use of this building plan. This represents the complex method described in the Preamble, and will only be needed if you will be creating an entirely new Tech Tree (explained ahead).
*'''Creation Kit'''
 
*'''Industrial Revolution Expansion''' (includes assets needed for the tutorial)
 
  
 +
The Industrial Revolution Master Plans have other fields filled out, but you can ignore those - it was for testing only.
  
==Creating Basic Machines==
+
To set up a Master Building Plan follow these steps:
  
This method involves taking pre-animated nifs, and replacing the model portion so that your model is animated in the same pattern as the animated object. This section will show you various things you can do with existing animated nifs to create whole new ones with the base animation of the original file at the core. While there are tutorial style examples, most of this section is just a tour of animated nifs to help demystify them a bit, so you can edit them more confidently.
+
1. In the Object Window, expand Miscellaneous, click on FormList, then in the right-hand side, right-click and choose New.
 +
2. Set your FormList ID field to something to represent this “tech tree” path list.
 +
3. In the Object Window, expand Items and click on MiscItem. Then filter for “master”.
 +
4. Duplicate the kgSIM_MasterBuildingPlan_Template.
 +
5. Open your new master plan and change the ID field of your duplicate to a name that represents this “tech tree” Master Plan.
 +
6. Select the SimSettlements:SimBuildingPlan script and click Properties.
 +
7. Add an entry to the LevelStops property for each level your building has, the value of each can be 0. For most building plans, you’ll have three entries - though certain exceptions exist (such as Agricultural which can support 4 levels at the time of this writing - assuming you were making a branching agricultural plan).
 +
 +
8. Expand the Advanced section (double click it), and point the BuildingPlanPaths property to your new formlist.
 +
9. Press OK, then OK again, when asked to Create a new form, click No, then click Yes to the prompt asking if you’d like to Rename the form.
 +
Building Paths
 +
 
 +
Consider a Building Path like the Commercial Building subtypes, but rather than being pre-defined like Commercial are, these allow you to create custom subtypes for different building plans to belong to.
 +
 
 +
In the Creation Kit, Building Paths are similar to the Building Plans you’ve been creating in that they are items you create to define certain features about them. These Path objects are what allow a building to have multiple variations at each level of a plot.
 +
 
 +
To start, I’ll give an idea of what each of the fields of a Building Plan Path object do, many of these fields are optional and provide you advanced options and possibilities. They will all make more sense at the end of the tutorial. Feel free to breeze past this next section and treat it as reference guide later on.
 +
 
 +
 
 +
ActiveUnlocks: [Optional] An array of GlobalVariables, all entries here will be incremented by 1 when the plot completes construction of this path and then decremented by 1 if the plot has it’s building plan changed or the plot is destroyed. These can be used to give the player access to something only while this plot exists.
 +
 
 +
BaseUpgradeMaterials: [Optional] An array of items and corresponding quantities. When configured, these are the objects the plot must stockpile in order to upgrade out of this path. The items and quantities should generally be similar to those generated via the CreateResources property.
 +
 
 +
BuildingPlans: This is a formlist of the building plans that represent this path. This allows multiple building plan variations to be used on the same path - these essentially act as “alternate art” variations without requiring all of the complex setup of a path.
 +
 
 +
CreateResources: [Optional] This is a LeveledItem that will be generated every day in the workbench AND the stockpile. If the building is eligible for upgrade (meaning the player has Upgrades Advanced set to Manual
 +
 +
and hasn’t triggered an upgrade on the plot) or the plot is at max level, the workbench share AND the stockpile share will be placed in the workbench. Effectively doubling the output under those circumstances.
 +
 
 +
ExtraUpgradeCosts: [Optional] Similar to the BaseUpgradeMaterials setting, this instead adds an extra cost the player/stockpile must pay BEFORE the plot can upgrade to this path.
 +
 
 +
PathKeyword: This keyword should be unique for this path, it’s used to ensure a plot can’t jump between different paths that are unrelated at each level.
 +
 
 +
PermanentUnlocks: [Optional] Similar to the ActiveUnlocks, these are a set of globals. When this path has completed construction, all of the globals set here are changed to 1. If the plot plan is changed or destroyed, these globals will not be reverted. These can be used to give the player access to something forever after this path has been constructed.
 +
 
 +
Requirement_Level: This is the level a plot must be at to use this path. Note that this is the level the plot is CURRENTLY at, not the level it will be after construction completes. So if this is the initial path a building plan would follow, the Requirment_Level would be 0.
 +
 
 +
Requirement_OwnerAVToCheck: [Optional] ActorValues that must be equal to the corresponding Requirement_OwnerAVValue field on the plot owner in order for this path to be eligible. This will allow arranging certain paths to only be available to certain NPCs. This is an array and Requirement_OwnerAVValue must have the exact same number of entries.
 +
 
 +
Requirement_OwnerAVValue: [Optional] Number the corresponding Requirement_OwnerAVToCheck ActorValue must be equal to on the plot owner for this path to be eligible. This will allow arranging certain paths to only be available to certain NPCs. This is an array and Requirement_OwnerAVToCheck must have the exact same number of entries.
 +
 
 +
Requirement_PreviousPathKeywords: This is an array of Keywords that should be set in ascending order for each of the other paths the plot should have gone through in order to be eligible for this path. They will be entries you used on other Building Plan Paths in the PathKeyword field.
 +
 
 +
Requirement_WorkshopAVToCheck: [Optional] ActorValues that must be greater than or equal to the corresponding Requirement_WorkshopAVValue field on the settlement in order for this path to be eligible. This will allow arranging certain paths to only be available if specific conditions are met in that settlement. This is an array and Requirement_WorkshopAVValue must have the exact same number of entries.
 +
 
 +
Requirement_WorkshopAVValue: [Optional] Number the corresponding Requirement_WorkshopAVToCheck ActorValue must be greater than or equal to on the settlement for this path to be eligible. This will allow arranging certain paths to only be available if specific conditions are met in that settlement. This is an array and Requirement_WorkshopAVToCheck must have the exact same number of entries.
 +
 
 +
UnlockMessage: [Optional] A special message to display to the player when this path finishes construction.
 +
 
 +
WorkshopAVsToSet: ActorValues to increment on the settlement, these values will be incremented when the path finishes construction and decremented if the plot plan changes or the plot is destroyed. When used in conjunction with the Requirement_WorkshopAV settings on other plans, you can easily set up requirements so that a path can require a certain number of other specific paths exist in the settlement before it becomes eligible. This is how the Tech Tree system is accomplished in Industrial Revolution. Technically this is optional,
 +
 +
but it’s highly recommended you set it up because if you change your mind later, your players’ existing plots using this path won’t be able to set the value without being completely rebuilt.
  
Included with Sim Settlements - Industrial Revolution, are a handful of nif files that are meant to be copied, dissected, and repurposed for creating machines using simple looped movements. You’ll want to extract '''SimSettlements_XPAC_IndustrialRevolution - Main.ba2''' to a separate directory (<span style="color:#006400">do NOT extract this to your Fallout 4/Data folder or updates to the expansion pack won’t affect your game</span>).
 
  
Navigate to the extracted files and find the folder Meshes\SS_IndRev\AnimatedObjects.
+
To create a new Building Path, follow these steps:
  
Inside this folder are some nif files and a folder called SoundSynced. The nif files use very basic animations and will loop indefinitely when used. The nif files inside of the SoundSynced folder have two slightly different characteristics:
+
1. In the Object Window, expand Miscellaneous, click on FormList, then in the right-hand side, right-click and choose New.
#They won’t start playing until you activate them - this is because they are configured as Door objects.
+
2. Change the ID field of your FormList to something to represent this path’s building plans.
#They have the capability of playing sound files automatically during the animation.
+
3. In the Object Window, expand Miscellaneous, click on Keyword, then in the right-hand side, right-click and choose New.
 +
4. Change the ID field of your Keyword to something to represent this path.
 +
5. [Optional but Highly Recommended] In the Object Window, expand Miscellaneous, click on ActorValue, then in the right-hand side, right-click and choose New.
 +
6. [Optional but Highly Recommended] Change the ID field of your ActorValue to something to represent this path.
 +
7. In the Object Window, expand Items and click on MiscItem. Then filter for “BuildingPlanPath”.
 +
8. Duplicate the kgSIM_BuildingPlanPath_Template.
 +
9. Open your new building plan and change the ID to something to represent this path.
 +
10. Select the SimSettlements:SimPlanPath script and click Properties.
 +
11. Point the BuildingPlans property to your new Formlist.
 +
12. Point the PathKeyword property to your new Keyword.
 +
13. [Optional but Highly Recommended] Add your new ActorValue as well as the actorvalues of any previous paths this plot would have had to set in order to get to this path to the WorkshopAVsToSet property. This will allow the plot to count towards any requirements of this path type so that the player doesn’t lose access to an unlocked tech tree if their building upgrades.
 +
14. If this is path is meant to be used as an upgrade and not a starting path, add the PathKeywords for the previous level paths, in order, to the Requirement_PreviousPathKeywords property.
 +
15. Set the Requirement_Level to the level number the plot should be at in order to use this path (if this is a starting path - this should be 0).
 +
16. Press OK to close the properties, then OK again to close the Building Plan object.
 +
17. If this Path is part of your Master Plan, continue to step 18 OR If this is meant to add new options to the Sim Settlements tech trees, go to the Register Your Branching Plans with Sim Settlements subsection titled - Forking Existing Tech Trees. Do NOT manually add your path to a Sim Settlements default form list, you must use the Addon Quest to do so (see the Register Your Branching Plans with Sim Settlements section).
 +
18. Open the FormList that your Master Plan is using as its BuildingPlanPath property and add the Building Path object you just created to it.
 +
19. Press OK to close the FormList.
  
<span style="color:#000080">Why a door? Doors ended up being the simplest type to create that would support sychronized sounds and didn’t require building special controller files (hkx files) or subgraph records. HKX and Subgraph records are not covered in this tutorial, those are extremely advanced topics you won’t need unless you’re getting into 3d Studio Max animation.</span>
 
  
We’re going to start with one of the simple nifs to demonstrate some of the things you can pull off. I’ll then show you how to make use of the extra features added via the SoundSynced models. You are by no means limited to using these models, if you find other animated objects in the game that loop automatically, you’ll be able to repeat these techniques with those.
+
Building Path Plans
  
#Make a copy of AnimRotateSlow.nif and open your copy in Nifskope. First thing to note, is the animation control bar above the preview window in the top right:<br/> [[File:Toolkit Extra Animated Objects image01.jpg]]<br/>This will let you play the animation in Nifskope to preview it as you tweak it, the first button plays/pauses the animation, the second button toggles whether to continuously loop it.
+
A Building Path Plan, is a building plan just like you’ve always built, except that it only has one level. Everything else about it is identical to the standard building plans you created in the other tutorials.
#Expand '''0 NiNode''', then expand '''2 NiNode''', where you’ll find 3 things: the animation controller (NiTranformController), the collision (bhkNPCollisionObject), and the model (BSTrishape).
 
##NiTransformController: This is what controls the animation, it doesn’t actually care what it’s animating - all it does is tells its target to change its rotation value by a certain amount every 3.366667 seconds.
 
###How do I know that? Click on '''3 NiTransformController''' then look at the Block Details section.<br/> [[File:Toolkit Extra Animated Objects image02.jpg]]<br/>This section tells you that the animation lasts 3.3666667 seconds and that it’s going to apply it to the '''2 ThresherTeeth01R Node''' (only the 2 is important, this is the ID of the Node and we’re working on 2 NiNode - these are the same node, they are just displayed differently in each section).<br/>You might be tempted to change the Stop Time here to slow or speed up the animation, while that is part of it - you also need to change the animation keys. For some objects like this (which only have 5 keys), that’s absolutely possible, but for many other items you find, there may be dozens of keys, and manually editing them each becomes impractical (this is one of those limitations I warned you about).<br/>Instead, the easier way to change the speed, is by editing the Frequency. If you change the frequency to a new whole number, you can effectively multiply the speed by that amount. '''Try it and use the animation controls to see the difference.'''<br/><span style="color:#000080">What you can’t do with this technique, is slow it down - let’s say you set the Frequency to 0.5, you’re telling the animation to only run ½ times, which will look very strange when looped as it will snap back into the starting position since a full animation isn’t allowed to run.</span>
 
##<span style="color:#FF0000">'''Don’t let this next part intimidate you, it’s extremely advanced - if you start to glaze over, just skip it - I assure you the next section is easier!'''<br/><br/> Expand NiTransformController, then expand NiTransformInterpolator, then click on NiTransformData and look to the Block Details section of Nifskope.
 
###This is where the individual animation keys exist. You can fine-tune control the animation by changing these values. All an animation is, is a series of frames representing where the object should be (Translations), which direction it should face (XYZ Rotations), and how large it is (Scales) - all of these are numbers that can be tweaked.
 
###Expand XYZ Rotations: there are three more XYZ Rotation entries, the first is the X rotation keyframes, the second is the Y rotation keyframes, and the third is the Z rotation keyframes.
 
###Expand the first XYZ rotation sub-entry, then expand Keys, here you’ll find all of the keyframes for the X rotation also labeled Keys.
 
###Expand the first key. There are 4 entries:
 
####Time - the time during the animation this starts.
 
####Value - how far to rotate on the X-axis in radians (you can find a degree to radian calculator on google if you aren’t comfortable with radians).
 
####Forward - the rate at which the animation is eased into.
 
####Backward - the rate at which the animation is eased out of.
 
###You can change any of the values in those key sections to completely change the existing animations, but if you were to expand the Translations section, you’d find no keys. Technically you could manually create them here, but it will quickly become overwhelming work and is another limitation of this method.</span>
 
#Since the Transform Controller is pointing at the 2 NiNode, any children of that node will have the rotation applied. Which means, you can take any other nif file you like (including one you created from an SCOL), copy it’s node, and paste it into this model as a child of that node, and it will be rotated as well.<br/>Since you’ve already extracted the Industrial Revolution models, let’s use one of those to try this.
 
##Navigate to the Meshes\SS_IndRev\Props directory and open '''MinedOre.nif''' in a new NifSkope window (<span style="color:#000080">it might be helpful to configure Windows to use Nifskope as the default program for opening .nif files, as you’ll be opening and closing lots of them while doing these projects</span>)
 
##Expand '''0 NiNode'', then select '''2 NiNode''', now hit Ctrl+C on your keyboard to copy this node branch to your clipboard.
 
##Go back to the other file you have opened, click on '''2 NiNode''' and hit Ctrl+V on your keyboard, this will paste the MinedOre node into this file. If you press play with the animation controls, you’ll instantly see this works and start rotating.
 
##Next we need to clean this file up to avoid it crashing the CK/game. We need to do the following things - fix the texture, remove the other model we’re replacing, point to the correct collision, and remove the extra node record.
 
###Fix the texture
 
####Go back to MinedOre.nif, expand 2 NiNode, expand '''5 BSTrishape''', click on '''6 BSLightingShaderProperty'''.
 
####In the Block Details section, click on the Txt icon next to the name field, this will bring up a text input box with the material file path, copy this path to your clipboard. Press Cancel to close this input box.
 
####Back in your animated nif, expand '''11 NiNode''', expand '''14 BSTrishape''', click on '''15 BSLightingShaderProperty'''.
 
####In the Block Details section, click on the Txt icon next to the name field, and paste the material path into the input box and press OK, your object should now have the correct texture.
 
###Remove the model we’re replacing
 
####Select '''8 BSTrishape''' and press Ctrl + Delete on your keyboard. <span style="color:#000080">When you delete a node, Nifskope will reorganize the IDs so that there are no gaps in the numbers.</span>F
 
####''That’s it - this was the easy part''.
 
###Point to the correct collision
 
####Under 8 NiNode, click on '''9 bhkNPCollisionObject'''.
 
####In the Block Details section, double-click '''8 (ThresherTeeth01R)''' and replace 8 with the number 2 and press Enter. We’re basically telling this collision that it should be the collision for the rotating node we’re working with.
 
####Click on 2 NiNode in the Block List, then in the Block Details section double-click '''6 [bhkNPCollisionObject]''' and replace the 6 with 9 and press Enter (9 being the ID of our new collision object).
 
####The id 6 collision will be moved to the bottom of the Block List, select it and press Ctrl+Delete on your keyboard to remove it.
 
####Click on what should now be 6 NiNode.
 
####We don’t want two nodes using the same collision object or we’ll have a broken nif, so we need to disassociate the collision from this node. In the Block Details section double-click '''7 [bhkNPCollisionObject]''' and erase the number 7 and press Enter.
 
###Remove the extra node record
 
####The Node we originally pasted from MinedOre.nif isn’t necessary- and a basic rule of thumb to avoid broken nifs, is to only keep as many Nodes as you absolutely need. When doing swaps like we’re doing, the easiest way to ensure this, is to confirm our nif has the same number and types of nodes as the original version had (you can always open the original up and compare).<br/>Before we can remove this extra node, we need to get the BSTrishape out of it. The BSTrishape represents our actual model, the node itself is basically an organizational tool (like a folder) and all objects that are a part of the node are considered it’s children.<br/>To get the BSTrishape out of this Node:
 
#####Click on '''6 NiNode''', then in the Block Details section, expand Children.
 
#####Double-click '''9 (ThresherTeeth01R:0)''', delete the 9, and press Enter. The BSTrishape should now be at the bottom of the Nodes list.
 
######Now that the BSTrishape is free from that node, we can safely delete that extra node without destroying the model. Select '''6 NiNode''' and press Ctrl+Delete.
 
#####If you were to push Play again, you’d see that nothing is rotating. We need to put the BSTrishape back into the rotating NiNode, to do this, we do the opposite of what we just did before and add the BSTrishape as a child of the rotating node.
 
######Click '''2 NiNode'''.
 
######In the Block Details section, expand Children.
 
######Double-click the first None entry and type 8 (which is the ID of the BSTrishape) and press Enter.
 
######If you push Play again, your rock should now be rotating.
 
###Save your file.<br/>Your nodes should now look like the image below (you may have to collapse some of the nodes you have expanded to get it to match the screenshot exactly)<br/>[[File:Toolkit Extra Animated Objects image03.jpg]]
 
##You can now use this model as a static object and it will automatically rotate in place. Best practice will be to include Anim or something similar in the name to avoid accidentally using it in an SCOL.
 
  
 +
You can have as many Building Path Plans as you like for each Building Path. Going back to the Commercial analogy, imagine the Building Path is the subtype, and the Building Path Plan is the custom plan for that subtype that holds the building art and spawned objects the player will see.
 +
 +
If you’re looking to contribute your plan to an existing Sim Settlements Building Path, check out the Registering Your Branching Plans With Sim Settlements subsection Option 1 - Alternate Plans OR if this is for your own path, open the FormList in your Building Path’s BuildingPlans property and add this plan to it.
  
Next let’s open one of the SoundSynced models to go over the differences in the nif structure. We’re going to choose a fairly complex one so that you can see where all of the different pieces are and transfer this knowledge over when editing even the most complex animated nifs.
+
Note: It’s completely OK to have a single Building Path Plan in this formlist.
  
We’re not actually going to replace anything here, I’m just going to explain the differences.
+
Do NOT manually add your plans to a Sim Settlements default form list, you must use the Addon Quest to do so (see the Register Your Branching Plans with Sim Settlements section).
  
# Open Meshes\SS_IndRev\AnimatedObjects\SoundSynced\Pendulum90.nif
 
# Expand 0 NiNode.
 
## The first difference of note, is the 2 NiControllerManager. This is used to control more complex animated objects and essentially contains and manages all of the individual controllers (such as the NiTransformController we worked with in the other model).
 
## Click on '''2 NiControllerManager''', then look at the Block Details section.
 
### NextController is used to point at the first individual controller this manager handles.
 
### Just like our other model, the Target tells us what object is being animated. In the case of a NiControllerManager, it will almost always point at the 0 NiNode (which is essentially the entire nif).
 
### Num Controller Sequences is similar to the Num Children section of a node, this tells you how many different animation sequences are handled. A sequence is essentially a complete animation, the NiControllerManager allows a nif file to have multiple animations, instead of just the single set of keyframes like you saw in our first example.
 
### Expanding Controller Sequences will reveal the individual sequences.
 
### Object Pallete is a special node that basically tells the NiControllerManager which nodes will be involved in the animation.
 
## Expand '''2 NiControllerManager''', here you’ll notice all of the different pieces we found in the Block Details section.
 
## Notice that in this particular nif, the animation toolbar at the top is different.<br/>[[File:Toolkit Extra Animated Objects image04.jpg]]<br/> The first two icons are the same, but there is a third icon, as well as a new drop down menu.<br/> The new icon tells Nifskope to loop through all of the different sequences, and the drop down menu allows you to select the sequence to play.<br/> Take a look at the NiControllerSequences, the names next to them in the Block List section match the entries in this dropdown list.
 
## For these particular models, since we’re using the Door type, they only have two sequences “Open” and “Close”, other models you work with may have many more sequences than this.
 
### When using these models, you’ll only be using the “Open” sequence. These models are designed to loop the Open sequence forever, so once you trigger the animation, it will never stop - which means the other sequences on this become irrelevant. This is not the norm, it’s essentially a trick we used to create constant animated objects that could be synchronized with a sound file.
 
### Expand '''4 NiControllerSequence'''.
 
#### The NiTransformInterpolator works exactly like what was described in the red scary section of the first half of this section.
 
#### To synchronize sound files, you’re going to make use of the NiTextKeyExtraData section.
 
##### Click on '''7 NiTextKeyExtraData'''.
 
##### In the Block Details section, expand Text Keys, then expand each of the sub entry Text Keys.
 
##### These are essentially keyframes that tell the game engine something at a particular moment during the animation.
 
##### The first entry “start” tells the game engine the animation started.
 
##### The second entry “Sound: UIWorkshopModeItemPickUpMetal3Large” is the format used to cause a sound file to play. “UIWorkshopModeItemPickUpMetal3Large” is the ID of the SoundDescriptor entry in the Creation Kit. So you can make it play absolutely any sound you like. Note that you can create additional entries and play more sounds at additional time stamps if you like by increasing the Num Text Keys field and adding more entries the same way you’ve added more Children to other nodes.
 
##### The last entry “end” tells the game engine the animation completed.
 
## Click on '''3 NiMultiTargetTransformController''', then look to the Block Details section.
 
### Just like the NiControllerManager, the Target field points to the top level node, this won’t always be the case, but usually is. The target object in these complex animated nodes usually isn’t being animated, but instead holds all of the objects that are being animated.
 
### Expand Extra Targets - these are the nodes that will actually be animated (you can ignore the blank entries, they were most likely placeholders that ended up not being used on export from 3ds Max). Notice the one entry in this particular model is node 13. This is the node you’ll edit if you want to swap out the model.
 
## Expand '''13 NiNode'''.
 
### This node has multiple tri-shapes. This is absolutely allowed. You can add more, delete one of the existing, or just replace one of the trishapes.
 
### If you decide to add additional BSTrishape or node objects under 13 NiNode, it’s very important that you also update the NiDefaultAVObjectPallete object or you’ll end up with a game crashing nif.
 
#### Click on '''12 NiDefaultAVObjectPallete'''.
 
#### You can then increase the Num Objs field and fill in your new nodes/trishapes, just like you would add Children to another node.
 
#### Expand the Objs and then all of the sub-entry Objs. Notice how not only is the 13 AnimRope node here, but also both of it’s BSTrishape objects (16 AnimWeight and 19 AnimRope:0).It’s very important that if you add a new node, you include it AND it’s children trishapes in the object pallete.
 
  
  
The most difficult part of editing animated nifs, is keeping track of all of the different objects - especially since they are often displayed in different ways. The nif format was meant to be generated and read by computers, not edited by hand like this. That means that it’s a very logical format, but can also be cumbersome to edit.
 
  
The key to getting past this, is leaning on those ID numbers. Once you start getting used to looking for those ID numbers, you’ll see that often the same ID is repeated over and over - and they aren’t actually different objects, just references all pointing to the exact same object.
+
Tech Trees (Bringing it All Together)
  
Start small with your tweaks, test often in the Creation Kit to check for corruption, and make frequent backups before you make additional changes after you’ve confirmed a previous change worked in the Creation Kit.
+
Consider the below diagram which represents one of the “Tech Trees” from Industrial Revolution.
  
Fortunately, you don’t have to be afraid of breaking nifs and losing work because Nifskope is very forgiving. You’ll just save yourself a lot of frustration if you can roll back to when the file was working as a lot of this ends up being trial and error.
 
  
<span style="color:#000080">A great way to test models in the Creation Kit is to open the Creation Kit and don’t load any esp or esm files at all. Then go to World Objects -> Statics, and bring up a New static form and select your model from here. If there’s a problem with the model, it will crash even without you loading your esp files.</span>
+
This is a visual representation of 7 building paths that are all connected using a Master Plan and Building Path objects to create a Tech Tree. Note that your tech trees may have more branches at any level, this particular tech tree just happens to have two branches to choose from at each upgrade level.
 +
 +
As of Sim Settlements 2.1.3, there is now a visual Tech Tree interface!
  
==Creating Animated Textures==
+
To support the visual Tech Tree interface, you’ll want to fill out the following fields on your Building Path Plans:
  
This method simulates movement by animating the texture of an object, it’s very useful when the moving just the surface of an object is enough - such as conveyor belts or water. This process is very simple, and similar to the first part of the previous section.
+
1. TechTreeName: This should be a short name for your building plan that will actually show up on the Tech Tree, you’ll want to experiment in game to confirm if the full name of your building will fit.
 +
2. UnlockedBy: [Optional] If the Building Path this plan is part of requires something outside of the tree this will appear on, you should put a very short explanation of that here. For example, the Chemical Plant on the Water Tech Tree in Industrial Revolution requires the Medical Grade Plastics building from the Oil Tech Tree, so the UnlockedBy field says “Medical Plastics”. If your requirement is only the building path before this one, you should leave the UnlockedBy field blank, because the visual tech tree will make it very obvious.
 +
3. iIconID: This is a small icon to visually represent your building plan. You should enter the number that corresponds to the image you’d like to represent your plan. The below images shows the available icons and their corresponding icon ids just below. If you would like to have custom icons added to Sim Settlements, please find or create a single-color vector graphic in a similar art style to these and send it to kinggath for implementation.
  
Go to the directory where you extracted the Industrial Revolution assets and make copies of Meshes\SS_IndRev\Props\ConveyorStr01A_anim.nif,
 
 
   
 
   
Meshes\SS_IndRev\IndustrialSizeA\Water\FiltrationPlant01\Water.nif, and Meshes\SS_IndRev\Props\MinedOre.nif.
+
To explain the building path system in more detail, we’ll go over how the building path objects would be set up to create the Wood Tech Tree pictured in the first diagram of this section, while you can easily check this in the Creation Kit, this will also provide notes with the some properties to help clarify why each is set the way it is, look for these notes in italics.
 +
 
 +
 
 +
 
 +
Wood:
 +
 
 +
BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L0_Base
 +
Industrial Revolution used the naming scheme ending in “Base” to represent the starting point of all buildings in the Tech Tree.
  
Each of these has a different type of controller on it. The first is for the LightShader type, which represent most textures in the game, and the second is for the EffectShader type which represent special effects that usually don’t have a direct texture. You’ll essentially be able to able to use these two models for all of your looping animated texture needs.
+
PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base
  
Let’s go over them to see how they work and how you can change them.
+
Requirement_Level = 0
 +
We only want a fresh plot to be able to use this path, a plot without a completed structure on it is considered level 0.
 +
Requirement_PreviousPathKeywords = <<Default: []>>
 +
Since this is a starting path, it doesn’t have any previous paths required.
  
# Open your copy of the Conveyor nif.
+
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood
# Expand '''0 NiNode''', expand '''8 BSTrishape''', click on '''9 BSLightingShaderProperty'''.
+
Industrial Revolution uses this so that other paths can check for certain paths present in a settlement. When this plot finishes building this path, this setting will tell other plots that there is at least 1 wood-producing plot present in the settlement.
# In the Block Details section, you’ll see that this shader has a Controller. These controllers work nearly identically to the transform controllers you worked with in the previous section. <span style="color:#000080">If you were to open the Water nif, you’d find the same thing under the BSEffectShaderProperty, except it would be called a BSEffectShaderPropertyFloatController. The two controllers are functionally identical, but the game engine demands the controller type match the shader type.</span>
 
# Expand '''9 BSLightingShaderProperty''' and click on '''10 BSLightingShaderProperyFloatController'''.
 
#*Look to the Block Details section, the only difference you really need to be concerned with between these controllers and the transform controllers is the Type of Controlled Variable field.<br/> If you double click it and then look all the way to the right, you should see a drop-down arrow for this field (you might have to use the scroll bar at the bottom to find this).<br/>[[File:Toolkit Extra Animated Objects image05.jpg]]<br/> This determines which part of the shader will be animated. For movement, you’ll use the U Offset or V Offset which determines whether the texture moves left to right or up and down. You can also use any of the other options to animate those things, you’ll have to experiment to see what they each do.
 
# In a new nifskope window, open your copy of '''MinedOre.nif'''
 
# Back in the conveyor belt window: click on '''9 BSLightingShaderProperty''' and press Ctrl+C on your keyboard. (You want the entire shader property, not just the controller)
 
# Return to the MinedOre window and click on the model in the preview window, which will expand down to and the BSTrishape in the Block List section, click on that BSTrishape node entry to ensure it is active. Now press Ctrl+V to paste the shader property you copied from the conveyor nif. It should be at the bottom of the Block List.
 
# Click on the MinedOre BSTrishape again and look to the Block Details section, expand BS Properties.
 
# Double-click '''6 (materials\Landscape\Rocks\RockBoulders.BGSM)''' and type in 8, which is the ID given to the shader property we copied over, and press enter. The two shaders should have swapped positions.
 
#* In this particular example, the copied shader should have automatically picked up the correct material file/texture. If doing this in the future, it does not, be sure to fix the material following the same steps you did in the previous section tutorial.
 
# We no longer need the extra shader property, so select the '''6 BSLightingShaderProperty''' and press Ctrl+Delete to remove it.
 
# If you were to hit Play now in the animation controls, you’d see the texture on the mined ore begin animating. It will look very strange because this particular texture doesn’t match up to the animation, but it was just used as a simple example. <span style="color:#000080">In general you’ll want to use textures that cover the full usable space, unlike this boulder texture which has lots of gaps in it, causing the black and grey sections which aren’t colored in the texture file. The way animating the U and V offset works, is that the texture is literally moved in one direction while the UV Mapping stays in place - if you’re not familiar with what UV Mapping is, check on youtube to find some simple explanations.</span>
 
# One common thing you’ll want to do with these, that can be a bit tricky, is to reverse the direction of the animation.
 
## Expand down through the BSLightingShaderProperty until you reach the NiFloatData node, then go to the Block Details section and expand all of those entries. Here there are two keys.
 
## In the first key, change the value from 0 to 1. <span style="color:#000080">Think of these like decimal percentages, so 1 = 100%. We’re telling it to start with the texture at the end of the animation.</span>
 
## Also in the first key, change the Backward entry from 1 to -1. Since we’re reversing the direction, we also need to reverse the easing.
 
## In the second key, change the value from 1 to 0. So now in the first key we’re starting at the end of the animation and working back to the beginning - aka reverse!
 
## Finally, change the Forward entry of the second key from 1 to -1 (as before, we need to reverse the easing as well).
 
## <span style="color:#000080">Why does this particular animation go from 6.66667 to 11.9666667? This controller was plucked from a model that had multiple animations. If you’d like you can change the key times to 0 and 5.3 (11.96666667 - 6.6666667 = 5.3), and then select the BSLightingShaderPropertyFloatController and change it’s Start and Stop times to 0 and 5.3, respectively. It doesn’t actually matter, but it will make it easier for you in the future if you want to tweak the animation length.</span>
 
  
For these kinds of simple looping animations, it’s very easy to manually edit the keyframes since there are only two of them, which means you can continuously copy and reuse the FloatControllers available in these two files for all of your animated texture needs. You could even add additional keyframes if you like, to make more complex animations.
 
  
==Creating Production Loops==
+
Paper:
 +
BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L1_PaperPath PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath Requirement_Level = 1
 +
This path should only be available if the plot attempting to use it is at level 1 at the time it tries to upgrade.
 +
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base
 +
We only want plots that were the Wood path at level 1 to be able to upgrade to this, so we use the PathKeyword from the Wood Building Path as configured above.
  
This method uses a script to move an object, or a continuous parade of objects along a path you create. This is especially useful for simulating assembly line productions without the need for the Contraptions DLC.
+
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath
 +
In order to prevent building upgrades from having breaking tech tree requirements, we include the previous path’s AV as well. That way this plot will count as both a Wood and Paper type, which prevents the player from having to constantly re-build earlier level versions of things in order to maintain tech requirements.
  
With patch 2.04 a new script called AnimatedObjectSpawner was added, this can be added to an object which is meant to be used as a StageItemSpawn to generate an object or objects that will follow a path you set up.
 
  
To start, let’s layout a path we want to follow.
+
Magazines:
 
   
 
   
# Open your add-on and bring up one of your building models that’s aligned at 0,0,0 in a cell, just like if you were about to lay out furniture and lights for configuring the StageItemSpawns.
+
BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_PaperPath_Military
# Start by laying out the object type you want to spawn in the position you’d like them to first appear, this is often best going to be inside of something to hide the spawning from view, but it doesn’t have to be if you don’t mind the object materializing in front of the player.
+
The final level paths for Industrial Revolution were originally conceived as being a military focused use of the product (helping the player) or a civilian focused use (helping the settlement). You do not have to follow this paradigm, it was just how the Industrial Revolution used the system.
#* This represents the coordinates you’ll use when placing your AnimatedObjectSpawner.
+
 
# Duplicate that object and move it a short ways, (<span style="color:#000080">if you have experience with animation, you’re essentially going to lay out the major keyframes for this object</span>).
+
PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_PaperPath_Military
# Continue duplicating this along a path of your choosing. In general, you only need an extra copy where the direction or rotation changes, otherwise the script will handle all of the in between motion to get from point to point. Once you have a path laid out, we’ll create your spawner.
+
 
# In the Object Window, expand World Objects and click on Activators.
+
Requirement_Level = 2
# Right-click in the right hand side and select New.
+
This path should only be available if the plot attempting to use it is at level 2 at the time it tries to upgrade.
# Give the spawner a unique ID and set it’s model file. (<span style="color:#000080">I tend to use kgSIM_HelperTiny_Marker as it’s invisible. You can use any model you like, but remember that the objects to animate will spawn at the origin point of the model.</span>)
+
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath
# Press OK to save the form and then re-open it.
+
This time we want the plot to have followed a very specific upgrade path. It needs to have started as a kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base type, and then upgraded to a kgSIM_BuildingPlanPath_industrial_Wood_L1 Paper type in that specific order before it can be eligible to use this path.
# Click Add under the scripts section and add '''SimSettlements:AnimatedObjectSpawner'''.<br/>[[File:Toolkit Extra Animated Objects image06.jpg]]
+
 
# Double-click '''AutoBuildParent''' and select the only option from the dropdown menu.
+
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath AND kgSIM_PlotsPresent_PaperPath_Military
# I’ll now explain what the optional fields do, you can decide what to set them to.
+
 
## '''bWaitUntilTransitionCompletes''': If checked, this won’t spawn another object until the original finishes its journey. This is especially useful if you want to simulate a single object continuously making a loop.
+
 
## '''fInitialMovementDelay''': This will pause the items after spawning for this many seconds before they are moved on the path.
+
News:
## '''fPauseBetweenObjects''': This will place a pause for this many seconds before creating the next object. This has a hard minimum of 0.25 seconds. Be very careful with this setting, having it too low without limits in the next two fields could quickly overwhelm the engine.
+
 
## '''iEndPositionObjectCount''': The number of spawned objects allowed to exist that have been through the animation. Once this number is reached, after the next object reaches the end of the animation, the oldest object will be removed. This allows a continuous stream of items to be dumped into a pile (assuming you are using havok enabled items), without getting out of control. This is hard capped at 100 items to avoid overloading the engine. If you don’t need any objects to stick around, for example if the path ends inside somewhere hidden, set this to 0, and each object will be removed after it completes the path.  
+
BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_PaperPath_Civilian PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_PaperPath_Civilian Requirement_Level = 2
## '''iTotalObjects''': Once this many objects have been spawned, the spawner will shut down until the cell is unloaded and loaded again. At which point it will start creating objects again until it reaches that number.
+
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath
# '''ObjectToAnimate''' can be pretty much anything, it can even be a FormList to allow a random entry from that list to be spawned each time. Here are some things to consider when deciding what to animate:
+
Notice that this has the exact same requirements as the Magazines path, because the PaperPath can branch off into either this, or the Magazines path.
## If you use actual lootable objects, the player will be able to pick them all up, creating an unlimited resource - which is probably not good.
 
## Objects are released to gravity (via the Havok engine) at the end of the path, which means MoveableStatics make the best form type. You can take most existing items, such as food, chems, and weapons, and use their model file in a MoveableStatic record and it’s havok data will still work in the new form.
 
## If you use a static object, the item will stay frozen at the end of the path and will not be controlled by Havok.
 
# '''Phases''' are what control your keyframes. They work very similar to StageItemSpawn entries in that you’ll enter the coordinates and rotations of the items you laid to represent the path.
 
## Skip your first item, because that’s where the actual spawner will go, so double-click the second item to bring up its properties.
 
## Add a new phase and copy paste all of the position and rotation data from the item properties window.
 
## Next choose a speed, this is in units per second. For reference, a plot is 512 units wide.
 
## The '''fHavokPause''' is an optional setting. Entering a number of seconds here will temporarily release the item to gravity when it reaches the coordinates you entered. This is useful if you’d like to add a drop in the middle of the animation. This setting can result in some funky things happening that you’ll have to do trial and error to correct. Once an item is dropped to gravity, it’s origin may be in a different spot than you originally planned for, so that the next phase coordinates may end up being too low or too high. Once you test the cycle in game, you’ll get a feel for which direction the item will land each time and be able to roughly compensate by altering the fOffsetZ of the next phase. It’s imperfect, but you should be able to find something that works most of the time.
 
## The '''bDoNotRotate''' option will prevent the object from rotating back to 0/0/0 after a Havok pause. I tend to use this on every phase after introducing a havok pause. Alternatively, you can do the same adjustments described in step 13d, to alter the phase rotations based on what you see happen during tests in-game.
 
# Once your Phases are configured, press OK to save your spawner.
 
# Open your building plan, and add a new StageItemSpawn record, using the coordinates and rotation of the starting position object you placed.
 
# Test it in game by building or refreshing that plot!
 
  
This script method is great for both creating translation movement in the game world and spawning continuous objects to simulate a production line. Versus the other two methods which create looping movement of the object itself. It definitely takes some trial and error to pull off, but the effect is very cool and avoids reliance on things like the Contraptions DLC objects.
+
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath AND kgSIM_PlotsPresent_PaperPath_Civilian
  
  
==You’re done!==
+
Coal:
  
You’re now equipped with the knowledge to start tearing apart and assembling animated nifs and laying out scripted production lines (or other creative uses of that script).
+
BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L1_CoalPath PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath Requirement_Level = 1
 +
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base
 +
This has the same requirement as the PaperPath because it could also come from the Wood path.
 +
 
 +
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath
 
   
 
   
As with all the tutorials, if you need help with any of this, just ask on the SimSettlements.com forums or the Discord server!
+
Flares:
 +
 
 +
BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_CoalPath_Military PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_CoalPath_Military Requirement_Level = 2
 +
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath
 +
 
 +
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath AND kgSIM_PlotsPresent_CoalPath_Military
 +
 
 +
 
 +
Coal Power:
 +
 
 +
BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_CoalPath_Civilian PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_CoalPath_Civilian Requirement_Level = 2
 +
Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath
 +
 
 +
WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath AND kgSIM_PlotsPresent_CoalPath_Civilian
 +
 
 +
 
 +
 
 +
Testing Your Branching Plans
 +
 
 +
For testing the building plans visually, you can continue to use the existing method for basic plans by using the console command
 +
 
 +
cf testbuildingplan XXXXXXX 0
 +
 
 +
Replacing the X’s with the form ID of your Building Path Plan.
 +
 
 +
To test that your entire branching plan is configured correctly, you have two options.
 +
 
 +
1. If you’ve already registered with Sim Settlements (described in the next section), this method is very easy to understand, but takes much longer to test the higher level paths as you have to go through the previous paths first. When using this method, you’ll want to create a save before each test, that way if it
 +
 +
fails, you can make changes and then load that save again without having to go through the earlier phases again.
 +
a. Start by changing the holotape option Upgrade Advanced to Manual.
 +
b. Now run this console command on your plot: setpv bIsUpgradeReady true
 +
This will flag your plot as being eligible for an upgrade so you can access the plot menu options, choose Upgrade Building and select the path you’re looking to test.
 +
 
 +
2. This method simulates to the code that your building went through all of the appropriate paths. It’s more complicated to understand, will take more setup up front as you’ll need to look up and write down all of the keyword form IDs, but is quicker for each individual test - so it’s worth learning.
 +
 
 +
Use the same command as above, except after the 0, add a space and then the form IDs for the path keywords of each of the paths involved. For example, to test the Flare building in our example above, you would use the command:
 +
cf testbuildingplan XXXXXXX 0 YYYYYYYY ZZZZZZZZ WWWWWWW Replacing the X’s with the plan form ID you want to test, the Y’s, Z’s with the
 +
Requirement_PreviousPathKeyword form IDs and the W’s with the Flare path’s PathKeyword ID. If you’re
 +
testing an earlier level, you would ignore an argument for each level earlier. For example, to just test the Wood path, you could skip the Z’s and W’s.
 +
 
 +
 
 +
 
 +
Registering Your Branching Plans With Sim Settlements
 +
 
 +
Throughout this tutorial, I’ve mentioned multiple methods of working with Branching plans. Now that you’ve seen the various pieces of the whole process, the methods should make a little more sense. Though calling them methods is kind of a misnomer, in reality these are very different things, but they allow you to contribute to the branching building path system.
 +
 
 +
The actual registering with Sim Settlements part is very easy, but the option you choose determines the steps from the previous sections you’ll need to do to create your idea.
 +
 
 +
Option 1 - Alternate Plans
 +
 
 +
If you have a single building plan idea, that would work well with an existing Building Path in Sim Settlements, you can contribute it without having to create new Building Path or Master Plan objects (for example, say you’d like to build your own building that provides Wood, it would make sense to add it to the Sim Settlements Wood Path). When the player has a plot that’s eligible for the path you’re contributing a plan to, your plan will be included as one of the options.
 +
 
 +
IMPORTANT: Do NOT set up the ResourcesGenerated field on your plan if contributing to Level 1 or Level 2 Sim Settlements paths on Advanced Industrial plots unless you ensure that your LeveledItem entry will be creating the resources configured in the path you’re contributing to’s BaseUpgradeMaterials entry (see the Using the Stockpile System For Upgrades). This will create a situation where it’s nearly impossible for those to upgrade as they require generating specific resources, which your plan will override.
 +
 +
1. After building your single level Building Path Plan, open your Addon Quest.
 +
2. Select the SimSettlements:AddonScript script and click Properties.
 +
3. Expand the MyTechTreeAdditions Add a new entry to the MyBuildingPathAddons property.
 +
4. A secondary properties window will come up with two fields, each of these fields is a drop-down menu that will detect the correct types automatically so you don’t have to dig through all of the various object types described in this tutorial.
 +
a. Set the MyBuildingPlan property to your building plan form.
 +
b. Set the TargetBuildingPath property to the Sim Settlements building path you want your plan to a part of.
 +
 
 +
5. Press OK on these two screens to exit the property windows, then Press OK on your Addon quest.
 +
 
 +
 
 +
 
 +
Option 2 - Forking Existing Tech Trees
 +
 
 +
If you have an idea for a new path that would work well with an existing Sim Settlements Tech Tree, you can add it without having to create an entire Master Plan worth of building paths and plans. You’ll only need to create that path and the levels to follow it.
 +
 
 +
For example, if you were adding an alternate path for the PaperPath to follow instead of Magazines or News, you would only need to create a single Building Path and Building Path Plan.
 +
 
 +
Or if you wanted to create an alternate path for Wood to follow instead of Paper and Coal at level 2, you would create your new Building Path and Building Path Plan(s), followed by one or more pairs of Paths and Path Plans for your new path to follow at level 3.
 +
 
 +
When creating your new alternate path, be sure to set up the appropriate Required_PreviousPathKeywords to match other paths at that same level.
 +
 
 +
1. After creating your Building Path and Building Path Plan objects, and adding the plan(s) to the corresponding formlists of your custom paths, open your Addon Quest.
 +
2. Select the SimSettlements:AddonScript script and click Properties.
 +
3. Expand the MyTechTreeAdditions Add a new entry to the MyBuildingPathForks property.
 +
4. A secondary properties window will come up with two fields.
 +
a. Set the TargetMasterPlan property to the appropriate Master Building Plan you want your path to be a part of. Since the Master Building Plans use the same core script, look for the ones that start with kgSIM_MasterPlan.
 +
b. Set the MyBuildingPath property to your Path object.
 +
5. If your forked path was a level 2, you’ll need to repeat steps 3 and 4 for each of your level 3 paths that it leads to. All paths that a plot should go through must be part of the Master Plan or they won’t function.
 +
 +
Option 3 - Custom Tech Trees
 +
 
 +
If you’re creating an entire Master Plan of your own, you register it the same way you would a normal building plan and add it to the Formlist you have configured for that plot type.
 +
 
 +
 
 +
 
 +
 
 +
Using the Stockpile System For Upgrades
 +
 
 +
If you’re looking to make use of the Stockpile system the way the Level 1 and Level 2 Advanced Industrial buildings in Industrial Revolution do, you need to set up the BaseUpgradeMaterials and CreateResources properties, and you need to do so in a way that two will work together.
 +
 
 +
The CreateResources property holds a LeveledItem, the same way a Building Plan’s ResourcesGenerated property does. It works identically, but is also overwritten by it. So if a Building Path Plan has the ResourcesGenerated property set up, and it’s Path has the CreateResources property set up, the Plan level will take precedence. This is important to understand when configuring the BaseUpgradeMaterials.
 +
 
 +
BaseUpgradeMaterials is an array that consists of pairs of items and quantities. These represent the stuff the plot must have in its stockpile before it can upgrade from the current plan to something else. When this path completes construction, it will add a single item of each type set in this property to the stockpile, this is to ensure the player knows what type of materials the building needs to stockpile for upgrades, in case they’d like to make donations and speed up the process.
 +
 
 +
The quantity of each entry will be multiplied by twice the number of days it takes that plot to upgrade. So if the BaseUpgradeMaterials had an entry of 10 Wood and 20 Steel, and the plot’s upgrade time for that level was 5 days, the Stockpile would need to have 100 Wood and 200 Steel before it would be eligible to upgrade. (10 Wood * 5 Days * 2 = 100, 20 Steel * 5 Days * 2 = 200). The numbers were designed so that if the player “gives back” everything that the plot produced in their workshop to the stockpile, the plot will take approximately the same amount of time as a normal plot to upgrade - but if instead they keep the materials, the plot will take twice as long as a normal plot to upgrade.
 +
 
 +
If the CreateResources or ResourcesGenerated entries don’t create the materials expected by BaseUpgradeMaterials, the plot will effectively be incapable of an automatic upgrade and will require player contribution. This will break the player’s expectation of how Sim Settlements works and is not advised, in general, you should make sure that any of your building paths and plans can generate the resources set in the paths’s BaseUpgradeMaterials.
 +
 
 +
Determining BaseUpgradeMaterials
 +
 
 +
For Industrial Revolution, I stuck with the most abundant resource generated and chose the highest possible quantity the CreateResources LeveledItem could create. For example, the Lumber Yard can generate a varying amount between 10 and 20 wood per day, so for the BaseUpgradeMaterials I set to 20 Wood. This ensures that the plot will always take at least twice as long as the upgrade period to generate the necessary material.
 +
 +
If I had set it to 10 Wood instead, and the plot “rolled” high on the daily wood multiple times, the plot could upgrade much faster than expected and dilute one of the penalties to differentiate basic and advanced plots.
 +
 
 +
Testing That The Stockpile Works
 +
 
 +
The easiest way to test that your stockpile related settings are working, is to do the following:
 +
 
 +
1. Change Upgrades Advanced to Manual in your holotape.
 +
2. Change Citizen Needs Requirement to OFF in your holotape.
 +
3. Under Notification Settings, disable the Crash Watch notification (we’re about to do something that will trigger it a lot).
 +
4. Run the console command: set timescale to 200
 +
This will change the days to run 10 times faster so you’ll know in a few minutes if your resources are generating in the stockpile of the plot.
 +
 
 +
Once you’ve confirmed the appropriate resources are being added to the stockpile, use the console to add yourself enough of that resource to pay the Upgrade cost based on the formula described above and BaseUpgradeMaterials you set.
 +
 
 +
Place that resource in the Stockpile and then wait until the appropriate number of days have passed (the time requirements can be found here: https://simsettlements.com/web/wiki/index.php?title=Breakdown). Remember that your timescale is set incredibly high, so you can wait in real-time, or sleep.
 +
 
 +
Confirm that the Upgrade Building option appears on the ASAM Sensor menu. At this point, the Stockpile should have a large chunk taken out as the process of making a building eligible to upgrade consumes the appropriate amount of resources from the stockpile.
 +
 
 +
When you’re done testing, be sure to restore your timescale (the default value is 20).
 +
 
 +
 
 +
You’re Done!
 +
 
 +
You should now have the knowledge to integrate with, or create your own, Branching Building plans. These special plans are incredibly powerful (and equally complex), and they can be expanded indefinitely. So you can continue to add more paths and plans in any combination.
 +
 
 +
Many of the optional features, should provide the tools you need to set up complex requirements and linked technology trees. Be sure to check out the Industrial Revolution paths for examples, as many of them are configured to make use of these various features.
  
 
[[Category:Toolkit]]
 
[[Category:Toolkit]]

Revision as of 14:42, 20 January 2018

Greetings, you people!

My name is Infinithil, I am from Germany and work as a civil servant.

In my free time, I work on my first addon pack for SimSettlements and help around the SimSettlements Wiki.

Have a nice day!

Last finished: Toolkit Extra - Advanced Possibilities


Workshop area


Toolkit Extra - Branching Building Plans


This tutorial assumes you know basic navigation and keyboard shortcuts to navigate the Creation Kit. If not, please go back and check out the Creation Kit 101 primer.

All of my guides will highlight things that are specific to your experience level: Green for beginners, and Red for seasoned modders. So if you’re new, you aren’t meant to understand the red messages, and if you’re a vet - you can probably skip the green.


Preamble

This guide assumes you’ve completed all of the previous tutorials and feel very comfortable with creating building plans. It also assumes you have played with the Advanced Industrial plot introduced with the Industrial Revolution expansion, and understand how they work in the game.

There are three ways to make use of Branching Building Plans, one of the methods requires much less work than the others and will be described at the end, the last is very complex and lets you generate the entire branching plan from scratch, and the second option is somewhere in-between.

It’s important you understand how the entire system works before applying any of the methods. So even though this will include steps along the way (for organizational purposes), it’s recommended you read through the entire guide once and then come back through to build your plans once you’re certain which of the two methods makes more sense for you.


Master Building Plans

A Master Building Plan uses the same script as a normal building plan, but only uses a single property (for compatibility reasons it had to be derived from the same script or the framework’s inheritance system would no longer function correctly). The BuildingPlanPaths will be set to a Form List to hold all possible paths this plot can take once it makes use of this building plan. This represents the complex method described in the Preamble, and will only be needed if you will be creating an entirely new Tech Tree (explained ahead).

The Industrial Revolution Master Plans have other fields filled out, but you can ignore those - it was for testing only.

To set up a Master Building Plan follow these steps:

1. In the Object Window, expand Miscellaneous, click on FormList, then in the right-hand side, right-click and choose New. 2. Set your FormList ID field to something to represent this “tech tree” path list. 3. In the Object Window, expand Items and click on MiscItem. Then filter for “master”. 4. Duplicate the kgSIM_MasterBuildingPlan_Template. 5. Open your new master plan and change the ID field of your duplicate to a name that represents this “tech tree” Master Plan. 6. Select the SimSettlements:SimBuildingPlan script and click Properties. 7. Add an entry to the LevelStops property for each level your building has, the value of each can be 0. For most building plans, you’ll have three entries - though certain exceptions exist (such as Agricultural which can support 4 levels at the time of this writing - assuming you were making a branching agricultural plan).

8. Expand the Advanced section (double click it), and point the BuildingPlanPaths property to your new formlist. 9. Press OK, then OK again, when asked to Create a new form, click No, then click Yes to the prompt asking if you’d like to Rename the form. Building Paths

Consider a Building Path like the Commercial Building subtypes, but rather than being pre-defined like Commercial are, these allow you to create custom subtypes for different building plans to belong to.

In the Creation Kit, Building Paths are similar to the Building Plans you’ve been creating in that they are items you create to define certain features about them. These Path objects are what allow a building to have multiple variations at each level of a plot.

To start, I’ll give an idea of what each of the fields of a Building Plan Path object do, many of these fields are optional and provide you advanced options and possibilities. They will all make more sense at the end of the tutorial. Feel free to breeze past this next section and treat it as reference guide later on.


ActiveUnlocks: [Optional] An array of GlobalVariables, all entries here will be incremented by 1 when the plot completes construction of this path and then decremented by 1 if the plot has it’s building plan changed or the plot is destroyed. These can be used to give the player access to something only while this plot exists.

BaseUpgradeMaterials: [Optional] An array of items and corresponding quantities. When configured, these are the objects the plot must stockpile in order to upgrade out of this path. The items and quantities should generally be similar to those generated via the CreateResources property.

BuildingPlans: This is a formlist of the building plans that represent this path. This allows multiple building plan variations to be used on the same path - these essentially act as “alternate art” variations without requiring all of the complex setup of a path.

CreateResources: [Optional] This is a LeveledItem that will be generated every day in the workbench AND the stockpile. If the building is eligible for upgrade (meaning the player has Upgrades Advanced set to Manual

and hasn’t triggered an upgrade on the plot) or the plot is at max level, the workbench share AND the stockpile share will be placed in the workbench. Effectively doubling the output under those circumstances.

ExtraUpgradeCosts: [Optional] Similar to the BaseUpgradeMaterials setting, this instead adds an extra cost the player/stockpile must pay BEFORE the plot can upgrade to this path.

PathKeyword: This keyword should be unique for this path, it’s used to ensure a plot can’t jump between different paths that are unrelated at each level.

PermanentUnlocks: [Optional] Similar to the ActiveUnlocks, these are a set of globals. When this path has completed construction, all of the globals set here are changed to 1. If the plot plan is changed or destroyed, these globals will not be reverted. These can be used to give the player access to something forever after this path has been constructed.

Requirement_Level: This is the level a plot must be at to use this path. Note that this is the level the plot is CURRENTLY at, not the level it will be after construction completes. So if this is the initial path a building plan would follow, the Requirment_Level would be 0.

Requirement_OwnerAVToCheck: [Optional] ActorValues that must be equal to the corresponding Requirement_OwnerAVValue field on the plot owner in order for this path to be eligible. This will allow arranging certain paths to only be available to certain NPCs. This is an array and Requirement_OwnerAVValue must have the exact same number of entries.

Requirement_OwnerAVValue: [Optional] Number the corresponding Requirement_OwnerAVToCheck ActorValue must be equal to on the plot owner for this path to be eligible. This will allow arranging certain paths to only be available to certain NPCs. This is an array and Requirement_OwnerAVToCheck must have the exact same number of entries.

Requirement_PreviousPathKeywords: This is an array of Keywords that should be set in ascending order for each of the other paths the plot should have gone through in order to be eligible for this path. They will be entries you used on other Building Plan Paths in the PathKeyword field.

Requirement_WorkshopAVToCheck: [Optional] ActorValues that must be greater than or equal to the corresponding Requirement_WorkshopAVValue field on the settlement in order for this path to be eligible. This will allow arranging certain paths to only be available if specific conditions are met in that settlement. This is an array and Requirement_WorkshopAVValue must have the exact same number of entries.

Requirement_WorkshopAVValue: [Optional] Number the corresponding Requirement_WorkshopAVToCheck ActorValue must be greater than or equal to on the settlement for this path to be eligible. This will allow arranging certain paths to only be available if specific conditions are met in that settlement. This is an array and Requirement_WorkshopAVToCheck must have the exact same number of entries.

UnlockMessage: [Optional] A special message to display to the player when this path finishes construction.

WorkshopAVsToSet: ActorValues to increment on the settlement, these values will be incremented when the path finishes construction and decremented if the plot plan changes or the plot is destroyed. When used in conjunction with the Requirement_WorkshopAV settings on other plans, you can easily set up requirements so that a path can require a certain number of other specific paths exist in the settlement before it becomes eligible. This is how the Tech Tree system is accomplished in Industrial Revolution. Technically this is optional,

but it’s highly recommended you set it up because if you change your mind later, your players’ existing plots using this path won’t be able to set the value without being completely rebuilt.


To create a new Building Path, follow these steps:

1. In the Object Window, expand Miscellaneous, click on FormList, then in the right-hand side, right-click and choose New. 2. Change the ID field of your FormList to something to represent this path’s building plans. 3. In the Object Window, expand Miscellaneous, click on Keyword, then in the right-hand side, right-click and choose New. 4. Change the ID field of your Keyword to something to represent this path. 5. [Optional but Highly Recommended] In the Object Window, expand Miscellaneous, click on ActorValue, then in the right-hand side, right-click and choose New. 6. [Optional but Highly Recommended] Change the ID field of your ActorValue to something to represent this path. 7. In the Object Window, expand Items and click on MiscItem. Then filter for “BuildingPlanPath”. 8. Duplicate the kgSIM_BuildingPlanPath_Template. 9. Open your new building plan and change the ID to something to represent this path. 10. Select the SimSettlements:SimPlanPath script and click Properties. 11. Point the BuildingPlans property to your new Formlist. 12. Point the PathKeyword property to your new Keyword. 13. [Optional but Highly Recommended] Add your new ActorValue as well as the actorvalues of any previous paths this plot would have had to set in order to get to this path to the WorkshopAVsToSet property. This will allow the plot to count towards any requirements of this path type so that the player doesn’t lose access to an unlocked tech tree if their building upgrades. 14. If this is path is meant to be used as an upgrade and not a starting path, add the PathKeywords for the previous level paths, in order, to the Requirement_PreviousPathKeywords property. 15. Set the Requirement_Level to the level number the plot should be at in order to use this path (if this is a starting path - this should be 0). 16. Press OK to close the properties, then OK again to close the Building Plan object. 17. If this Path is part of your Master Plan, continue to step 18 OR If this is meant to add new options to the Sim Settlements tech trees, go to the Register Your Branching Plans with Sim Settlements subsection titled - Forking Existing Tech Trees. Do NOT manually add your path to a Sim Settlements default form list, you must use the Addon Quest to do so (see the Register Your Branching Plans with Sim Settlements section). 18. Open the FormList that your Master Plan is using as its BuildingPlanPath property and add the Building Path object you just created to it. 19. Press OK to close the FormList.


Building Path Plans

A Building Path Plan, is a building plan just like you’ve always built, except that it only has one level. Everything else about it is identical to the standard building plans you created in the other tutorials.

You can have as many Building Path Plans as you like for each Building Path. Going back to the Commercial analogy, imagine the Building Path is the subtype, and the Building Path Plan is the custom plan for that subtype that holds the building art and spawned objects the player will see.

If you’re looking to contribute your plan to an existing Sim Settlements Building Path, check out the Registering Your Branching Plans With Sim Settlements subsection Option 1 - Alternate Plans OR if this is for your own path, open the FormList in your Building Path’s BuildingPlans property and add this plan to it.

Note: It’s completely OK to have a single Building Path Plan in this formlist.

Do NOT manually add your plans to a Sim Settlements default form list, you must use the Addon Quest to do so (see the Register Your Branching Plans with Sim Settlements section).



Tech Trees (Bringing it All Together)

Consider the below diagram which represents one of the “Tech Trees” from Industrial Revolution.


This is a visual representation of 7 building paths that are all connected using a Master Plan and Building Path objects to create a Tech Tree. Note that your tech trees may have more branches at any level, this particular tech tree just happens to have two branches to choose from at each upgrade level.

As of Sim Settlements 2.1.3, there is now a visual Tech Tree interface!

To support the visual Tech Tree interface, you’ll want to fill out the following fields on your Building Path Plans:

1. TechTreeName: This should be a short name for your building plan that will actually show up on the Tech Tree, you’ll want to experiment in game to confirm if the full name of your building will fit. 2. UnlockedBy: [Optional] If the Building Path this plan is part of requires something outside of the tree this will appear on, you should put a very short explanation of that here. For example, the Chemical Plant on the Water Tech Tree in Industrial Revolution requires the Medical Grade Plastics building from the Oil Tech Tree, so the UnlockedBy field says “Medical Plastics”. If your requirement is only the building path before this one, you should leave the UnlockedBy field blank, because the visual tech tree will make it very obvious. 3. iIconID: This is a small icon to visually represent your building plan. You should enter the number that corresponds to the image you’d like to represent your plan. The below images shows the available icons and their corresponding icon ids just below. If you would like to have custom icons added to Sim Settlements, please find or create a single-color vector graphic in a similar art style to these and send it to kinggath for implementation.


To explain the building path system in more detail, we’ll go over how the building path objects would be set up to create the Wood Tech Tree pictured in the first diagram of this section, while you can easily check this in the Creation Kit, this will also provide notes with the some properties to help clarify why each is set the way it is, look for these notes in italics.


Wood:

BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L0_Base Industrial Revolution used the naming scheme ending in “Base” to represent the starting point of all buildings in the Tech Tree.

PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base

Requirement_Level = 0 We only want a fresh plot to be able to use this path, a plot without a completed structure on it is considered level 0. Requirement_PreviousPathKeywords = <<Default: []>> Since this is a starting path, it doesn’t have any previous paths required.

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood Industrial Revolution uses this so that other paths can check for certain paths present in a settlement. When this plot finishes building this path, this setting will tell other plots that there is at least 1 wood-producing plot present in the settlement.


Paper: BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L1_PaperPath PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath Requirement_Level = 1 This path should only be available if the plot attempting to use it is at level 1 at the time it tries to upgrade. Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base We only want plots that were the Wood path at level 1 to be able to upgrade to this, so we use the PathKeyword from the Wood Building Path as configured above.

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath In order to prevent building upgrades from having breaking tech tree requirements, we include the previous path’s AV as well. That way this plot will count as both a Wood and Paper type, which prevents the player from having to constantly re-build earlier level versions of things in order to maintain tech requirements.


Magazines:

BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_PaperPath_Military The final level paths for Industrial Revolution were originally conceived as being a military focused use of the product (helping the player) or a civilian focused use (helping the settlement). You do not have to follow this paradigm, it was just how the Industrial Revolution used the system.

PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_PaperPath_Military

Requirement_Level = 2 This path should only be available if the plot attempting to use it is at level 2 at the time it tries to upgrade. Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath This time we want the plot to have followed a very specific upgrade path. It needs to have started as a kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base type, and then upgraded to a kgSIM_BuildingPlanPath_industrial_Wood_L1 Paper type in that specific order before it can be eligible to use this path.

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath AND kgSIM_PlotsPresent_PaperPath_Military


News:

BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_PaperPath_Civilian PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_PaperPath_Civilian Requirement_Level = 2 Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_PaperPath Notice that this has the exact same requirements as the Magazines path, because the PaperPath can branch off into either this, or the Magazines path.

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_PaperPath AND kgSIM_PlotsPresent_PaperPath_Civilian


Coal:

BuildingPlans = kgSIM_IndA_Path_BuildingPlans_Wood_L1_CoalPath PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath Requirement_Level = 1 Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base This has the same requirement as the PaperPath because it could also come from the Wood path.

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath

Flares:

BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_CoalPath_Military PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_CoalPath_Military Requirement_Level = 2 Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath AND kgSIM_PlotsPresent_CoalPath_Military


Coal Power:

BuildingPlans = kgSIM_BuildingPlanPath_Wood_L2_CoalPath_Civilian PathKeyword = kgSIM_BuildingPlanPath_Industrial_Wood_L2_CoalPath_Civilian Requirement_Level = 2 Requirement_PreviousPathKeywords = kgSIM_BuildingPlanPath_Industrial_Wood_L0_Base, kgSIM_BuildingPlanPath_Industrial_Wood_L1_CoalPath

WorkshopAVsToSet = kgSIM_PlotsPresent_Wood AND kgSIM_PlotsPresent_CoalPath AND kgSIM_PlotsPresent_CoalPath_Civilian


Testing Your Branching Plans

For testing the building plans visually, you can continue to use the existing method for basic plans by using the console command

cf testbuildingplan XXXXXXX 0

Replacing the X’s with the form ID of your Building Path Plan.

To test that your entire branching plan is configured correctly, you have two options.

1. If you’ve already registered with Sim Settlements (described in the next section), this method is very easy to understand, but takes much longer to test the higher level paths as you have to go through the previous paths first. When using this method, you’ll want to create a save before each test, that way if it

fails, you can make changes and then load that save again without having to go through the earlier phases again. a. Start by changing the holotape option Upgrade Advanced to Manual. b. Now run this console command on your plot: setpv bIsUpgradeReady true This will flag your plot as being eligible for an upgrade so you can access the plot menu options, choose Upgrade Building and select the path you’re looking to test.

2. This method simulates to the code that your building went through all of the appropriate paths. It’s more complicated to understand, will take more setup up front as you’ll need to look up and write down all of the keyword form IDs, but is quicker for each individual test - so it’s worth learning.

Use the same command as above, except after the 0, add a space and then the form IDs for the path keywords of each of the paths involved. For example, to test the Flare building in our example above, you would use the command: cf testbuildingplan XXXXXXX 0 YYYYYYYY ZZZZZZZZ WWWWWWW Replacing the X’s with the plan form ID you want to test, the Y’s, Z’s with the Requirement_PreviousPathKeyword form IDs and the W’s with the Flare path’s PathKeyword ID. If you’re testing an earlier level, you would ignore an argument for each level earlier. For example, to just test the Wood path, you could skip the Z’s and W’s.


Registering Your Branching Plans With Sim Settlements

Throughout this tutorial, I’ve mentioned multiple methods of working with Branching plans. Now that you’ve seen the various pieces of the whole process, the methods should make a little more sense. Though calling them methods is kind of a misnomer, in reality these are very different things, but they allow you to contribute to the branching building path system.

The actual registering with Sim Settlements part is very easy, but the option you choose determines the steps from the previous sections you’ll need to do to create your idea.

Option 1 - Alternate Plans

If you have a single building plan idea, that would work well with an existing Building Path in Sim Settlements, you can contribute it without having to create new Building Path or Master Plan objects (for example, say you’d like to build your own building that provides Wood, it would make sense to add it to the Sim Settlements Wood Path). When the player has a plot that’s eligible for the path you’re contributing a plan to, your plan will be included as one of the options.

IMPORTANT: Do NOT set up the ResourcesGenerated field on your plan if contributing to Level 1 or Level 2 Sim Settlements paths on Advanced Industrial plots unless you ensure that your LeveledItem entry will be creating the resources configured in the path you’re contributing to’s BaseUpgradeMaterials entry (see the Using the Stockpile System For Upgrades). This will create a situation where it’s nearly impossible for those to upgrade as they require generating specific resources, which your plan will override.

1. After building your single level Building Path Plan, open your Addon Quest. 2. Select the SimSettlements:AddonScript script and click Properties. 3. Expand the MyTechTreeAdditions Add a new entry to the MyBuildingPathAddons property. 4. A secondary properties window will come up with two fields, each of these fields is a drop-down menu that will detect the correct types automatically so you don’t have to dig through all of the various object types described in this tutorial. a. Set the MyBuildingPlan property to your building plan form. b. Set the TargetBuildingPath property to the Sim Settlements building path you want your plan to a part of.

5. Press OK on these two screens to exit the property windows, then Press OK on your Addon quest.


Option 2 - Forking Existing Tech Trees

If you have an idea for a new path that would work well with an existing Sim Settlements Tech Tree, you can add it without having to create an entire Master Plan worth of building paths and plans. You’ll only need to create that path and the levels to follow it.

For example, if you were adding an alternate path for the PaperPath to follow instead of Magazines or News, you would only need to create a single Building Path and Building Path Plan.

Or if you wanted to create an alternate path for Wood to follow instead of Paper and Coal at level 2, you would create your new Building Path and Building Path Plan(s), followed by one or more pairs of Paths and Path Plans for your new path to follow at level 3.

When creating your new alternate path, be sure to set up the appropriate Required_PreviousPathKeywords to match other paths at that same level.

1. After creating your Building Path and Building Path Plan objects, and adding the plan(s) to the corresponding formlists of your custom paths, open your Addon Quest. 2. Select the SimSettlements:AddonScript script and click Properties. 3. Expand the MyTechTreeAdditions Add a new entry to the MyBuildingPathForks property. 4. A secondary properties window will come up with two fields. a. Set the TargetMasterPlan property to the appropriate Master Building Plan you want your path to be a part of. Since the Master Building Plans use the same core script, look for the ones that start with kgSIM_MasterPlan. b. Set the MyBuildingPath property to your Path object. 5. If your forked path was a level 2, you’ll need to repeat steps 3 and 4 for each of your level 3 paths that it leads to. All paths that a plot should go through must be part of the Master Plan or they won’t function.

Option 3 - Custom Tech Trees

If you’re creating an entire Master Plan of your own, you register it the same way you would a normal building plan and add it to the Formlist you have configured for that plot type.



Using the Stockpile System For Upgrades

If you’re looking to make use of the Stockpile system the way the Level 1 and Level 2 Advanced Industrial buildings in Industrial Revolution do, you need to set up the BaseUpgradeMaterials and CreateResources properties, and you need to do so in a way that two will work together.

The CreateResources property holds a LeveledItem, the same way a Building Plan’s ResourcesGenerated property does. It works identically, but is also overwritten by it. So if a Building Path Plan has the ResourcesGenerated property set up, and it’s Path has the CreateResources property set up, the Plan level will take precedence. This is important to understand when configuring the BaseUpgradeMaterials.

BaseUpgradeMaterials is an array that consists of pairs of items and quantities. These represent the stuff the plot must have in its stockpile before it can upgrade from the current plan to something else. When this path completes construction, it will add a single item of each type set in this property to the stockpile, this is to ensure the player knows what type of materials the building needs to stockpile for upgrades, in case they’d like to make donations and speed up the process.

The quantity of each entry will be multiplied by twice the number of days it takes that plot to upgrade. So if the BaseUpgradeMaterials had an entry of 10 Wood and 20 Steel, and the plot’s upgrade time for that level was 5 days, the Stockpile would need to have 100 Wood and 200 Steel before it would be eligible to upgrade. (10 Wood * 5 Days * 2 = 100, 20 Steel * 5 Days * 2 = 200). The numbers were designed so that if the player “gives back” everything that the plot produced in their workshop to the stockpile, the plot will take approximately the same amount of time as a normal plot to upgrade - but if instead they keep the materials, the plot will take twice as long as a normal plot to upgrade.

If the CreateResources or ResourcesGenerated entries don’t create the materials expected by BaseUpgradeMaterials, the plot will effectively be incapable of an automatic upgrade and will require player contribution. This will break the player’s expectation of how Sim Settlements works and is not advised, in general, you should make sure that any of your building paths and plans can generate the resources set in the paths’s BaseUpgradeMaterials.

Determining BaseUpgradeMaterials

For Industrial Revolution, I stuck with the most abundant resource generated and chose the highest possible quantity the CreateResources LeveledItem could create. For example, the Lumber Yard can generate a varying amount between 10 and 20 wood per day, so for the BaseUpgradeMaterials I set to 20 Wood. This ensures that the plot will always take at least twice as long as the upgrade period to generate the necessary material.

If I had set it to 10 Wood instead, and the plot “rolled” high on the daily wood multiple times, the plot could upgrade much faster than expected and dilute one of the penalties to differentiate basic and advanced plots.

Testing That The Stockpile Works

The easiest way to test that your stockpile related settings are working, is to do the following:

1. Change Upgrades Advanced to Manual in your holotape. 2. Change Citizen Needs Requirement to OFF in your holotape. 3. Under Notification Settings, disable the Crash Watch notification (we’re about to do something that will trigger it a lot). 4. Run the console command: set timescale to 200 This will change the days to run 10 times faster so you’ll know in a few minutes if your resources are generating in the stockpile of the plot.

Once you’ve confirmed the appropriate resources are being added to the stockpile, use the console to add yourself enough of that resource to pay the Upgrade cost based on the formula described above and BaseUpgradeMaterials you set.

Place that resource in the Stockpile and then wait until the appropriate number of days have passed (the time requirements can be found here: https://simsettlements.com/web/wiki/index.php?title=Breakdown). Remember that your timescale is set incredibly high, so you can wait in real-time, or sleep.

Confirm that the Upgrade Building option appears on the ASAM Sensor menu. At this point, the Stockpile should have a large chunk taken out as the process of making a building eligible to upgrade consumes the appropriate amount of resources from the stockpile.

When you’re done testing, be sure to restore your timescale (the default value is 20).


You’re Done!

You should now have the knowledge to integrate with, or create your own, Branching Building plans. These special plans are incredibly powerful (and equally complex), and they can be expanded indefinitely. So you can continue to add more paths and plans in any combination.

Many of the optional features, should provide the tools you need to set up complex requirements and linked technology trees. Be sure to check out the Industrial Revolution paths for examples, as many of them are configured to make use of these various features.