But for those who are a little more advanced users, I leave you a ##### ### on how to make a military unit create buildings in a practical and easy way.
First we open the advanced genie editor 3, having previously created a mod folder for this and we will open a vanilla “empires2_x2_p1.dat” for this test
Now what we will do is simply copy any unit that is military. And we add it as a new unit.
Then we go down to the Attributes section and check the box shown in the image, that is, the one that is the “SW: Stealth unit” option and where it says “Trait Piece” put the building ID. As you can see, I also cloned the building unit that is going to be built. Normally, the existing unit is edited, but in order not to modify the base code, I clone a unit. But you can do it as you wish.
With this we already indicate to the program that this unit can build that certain building.
Now we just need to give it the ability to build and repair it. To do this we go all the way down to the “Taks” section.
There we add a new “taks” “101 Build”, in “Unit” we put the unit that is going to be built, in “Work value 1*” we put 1, in “work Range” we put 0.1, in “Proceeding Graphic*” we select the graphics that will reproduce the animation of the unit while it builds, in this case for testing we will use that of “1893 Serjeant (Work)”, in “working Graphic*” we will select either this or the animations of a villager, but the ideal is create your own animation for this unit, in “Resource Deposit Sound” we will select “421 – Files: 127” and in the box on the right we will put this number “3780015708” (I don’t know what this number is but it is necessary to put it, in “Auto Search” we put 1 and in “Buing Pick” we check, in “Target Diplomacy*” we put 4 and in “Seach Wait Time” we put 3
It has to look like this in the image
Now we are going to tell you how to repair that same building and create another new “Task” and let it be “106 Repair”.
and we leave everything the same as in the previous one, only changing the value “Work Value 1” to 12.5 u
Here I also leave an image of how it should be
If you want to avoid all this work, simply copy and paste the “taks” from Serjeant or the Repair and Build Builder
Finally, we can create an effect and in turn a technology to activate this unit and we can create it or I can use the scenario editor to activate this unit and work this building.
As a final tip to save a little time, I can suggest that if you are going to use a cloned building OR that is not in the technological tree of any civilization, simply in the “Attributes” section check “Available” and that construction will be active. without the need to activate it with effects and technologies
Don’t forget to save your work
Now let’s test if it works