Saturday, April 7, 2012
How To: Use the Duplicate Feature
(Updated June 23, 2012 for use with layout editor version 126.96.36.199)
This tutorial is for use with version 188.8.131.52 of the layout editor. If you don't have this version, I highly suggest you download it now. Because this tutorial was written before 184.108.40.206, some of the details on the screenshots may be different than the windows you see. However, the important parts of the windows are the same (the parts boxed in red), so I have not updated the screenshots. If that ever changes, I will update the screenshots to match the most current editor.
Another lovely feature of the layout editor is the duplicate feature. With this feature, I can exactly duplicate an item setup, then shift it to a new location, rather than having to rebuild it.
If you haven't read my How To: Use The Diff Button, I would pause and read that now (unless you already know how to use the Diff button. Note that this is the Diff button, not New From Diff. They do similar things, but in a dissimilar way, and we need the features of the Diff button to do this. Even if you do know how to use the Diff button, I would read over the introductory section, where I go over what settings you should have checked).
Imagine, if you will, that I am building a cathedral. I've built a single stained glass window, and I think it's perfect. However, I'm going to need at least 11 more stained glass windows in the exact same configuration, lined up along the wall. Building each one by hand will take a long time. Luckily, Jesdyr has given us the ability to duplicate sections of a layout! So since I don't feel like building 11 more stained glass windows by hand, I'll let the duplicate feature do it for me.
The important thing to remember is that I need to have the correct number of items in the moving crate. If I don't, the game will steal from other items of the same type elsewhere in the house when I load the layout in game. You'll see what I mean later.
So I'm building a cathedral. I have the perfect stained glass window. I want to duplicate it to create more of them. The first thing I'm going to do is to click my WITH macro.
Once I've done that, I can begin packing all of the items I wish to duplicate into the moving crate. Because I want to put my next window directly beside the first, and I'd like them to share the southernmost wall, I'm not going to pack the northernmost wall into the moving crate. I'm going to right click each item I wish to duplicate, and select Pack in Moving Crate.
Once I've packed away everything I want to duplicate, I click my WITHOUT macro. It makes sense, right? The house is now without the items you wish to duplicate, whereas before it was with the items.
Now go to the layout editor. Go to File, and Open the with layout.
You should now be on the Main tab. Click the Diff button.
If you've followed the Diff button tutorial or used the Diff button before, the Diff button window should be filled out already. If it's not, navigate to your without layout file, and click Run.
The layout editor should automatically flip you to the Groups tab. You want to select everything you wish to duplicate. It could be a single item, it could be several, or it could be the entire group. In this case, we want to select the entire group. Select everything on the Groups tab the same way you selected everything on the Diff tab. Click the white box to the left of ItemID.
Right click and select Duplicate.
Once you've done that, the layout editor should duplicate everything you had selected. You'll notice that in the Notes column, half the items have "Added by Create" in their note.
If you look more closely, the very last item has a UID that doesn't look like the others. All other UIDs are large positive numbers. The final Narrow Divider of Adamantine has a four digit negative UID. Negative UIDs are UIDs that are created by the layout editor. If the layout editor creates a UID, it means that there were not enough items in the moving crate. If I had any other Narrow Dividers of Adamantine in the guild hall, when I loaded this layout as it is now, the line with the negative UID would cause the game to steal one of the other Narrow Divider of Adamantine from elsewhere in the hall.
Because I don't want that to happen, I'm going to remove that line from the layout. Part of my window will be missing, but that's fine. This is just a demonstration anyway! (I've already had confused questions asked in guild chat as to why there's part of the cathedral in the guild hall...) First, I select the line with the fake (negative) UID by clicking the blank rectangle to the left of the ItemID column. Then I right click and select Remove From Group.
Now the layout is fine, with all of the UIDs positive. So I'll hit Save Group.
If you've followed the Diff button tutorial, you shouldn't need to fill anything out, just click Save. If you haven't followed the tutorial, you'll need to click Select File and navigate to the working layout file. If you don't have a layout file called working, then you need to go back in game, type /save_layout working, and hit enter. Then navigate to your working layout file in the layout editor's Save Group.
When we go back in game and click the LOAD WORKING macro, we find that not much happened. At least, that's how it appears at first glance. If we look carefully at the window that has reappeared, a little over half of it is much lighter in color than the rest. That's because there are two windows stacked on top of each other. That isn't very useful to us.
We need to go back into the layout editor. We'll shift the duplicated items until they're beside the original items, forming the next portion of the wall. First, we'll need to select only the duplicated items. Then we'll change the number in the Move Amount box from 1 to 8. Next we'll click the South button once, to move all duplicated items 8 units to the South. Lastly, we'll click Save Group. Because we've saved the group once already, a window does not pop up. In fact, the only way we know it's worked is that the Save Group button winds up having a light blue border, and if we go back in game and load the working layout again, it will have changed.
Now that that's done, we can go back in game and click the LOAD WORKING macro again. Oops! It looks like 8 units was about 4 units too many. (If I'd done math, I could have figured out exactly how many units I needed to move the items. However, for the purpose of this tutorial, having it incorrect just means more examples of how to do things in the editor!)
Back to the layout editor to move the duplicated items 4 units to the North. First, we select all of the duplicated items. Then we change the number in the Move Amount box from 8 to 4. Next, we click the North button once. And finally, we click the Save Group button.
Back in game once more, we click the LOAD WORKING macro again. Yay, everything's where it should be (except for the missing divider that we removed earlier, and whose spot is circled in red.)
Now you know how to use the duplicate function, without it stealing items from random spots in your home! Congratulations!