Multi-Part Buildables: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 19: Line 19:
## Now, create your second stage. You do not need to duplicate the brushwork that forms your first stage, just create the parts that extend it.
## Now, create your second stage. You do not need to duplicate the brushwork that forms your first stage, just create the parts that extend it.
## Select it, and tie it to another [[emp_eng_map_brush]], as you did with your first stage.
## Select it, and tie it to another [[emp_eng_map_brush]], as you did with your first stage.
## Repeat the process for your third and final stage.
## Repeat the process for your third and final stage. Now you should have three separate entities, each of which form one stage of your completed object.
## Now you should have three separate entities, each of which form one stage of your completed object.
## Give each stage a meaningful name. Mine are called ''"tower_bottom"'', ''"tower_middle"'' and ''"tower_top"''.
# Compile and test
## --set disabled/enabled attributes--
## Now here is the principal on which my tower operates:
### When the bottom is built, I enable the middle.
### When the middle is built, I enable the top.
### When the top is built, I don't do anything!
### When the top is destroyed, I don't do anything.
### When the middle is destroyed, I destroy the top.
### When the bottom is destroyed, I destroy the middle.
## Now that we've established these rules, we quite simply translate them into a format that Hammer's I/O system can understand. For the moment, my tower is owned exclusively by the Northern Faction. We will deal with team changes later on.
### For '''tower_bottom''', add the output '''OnBuiltNF''' to target '''tower_middle''' with '''enableNF'''.
### For '''tower_bottom''', add the output '''OnKill''' to target '''tower_middle''' with '''disable'''.
### For '''tower_middle''', add the output '''OnBuiltNF''' to target '''tower_top''' with '''enableNF'''.
### For '''tower_middle''', add the output '''OnKill''' to target '''tower_top''' with '''disable'''.
# And that's it! Your structure is now complete. You can compile your level at this stage, and you should be able to see it in action. What follows is an explanation of how to deal with your structure changing teams in co-ordination with the ownership of a  flag.

Revision as of 04:16, 23 January 2007

Home > Multi-Part Buildables

This is a work in progress tutorial, actively under development by Broccoli.

This is a guide to creating multi-part buildable objects. These are the kinds of objects that are built in stages, for example an upgradeable bunker, or a tower that gets taller as more sections are built. This guide only covers brush-based buildables, though the principle would remain the same for model-based ones.

Before you begin, I would recommend reading the basic tutorial, covering single-part buildables.

  1. You should be familiar with the concept of entities, and how they can have attributes, inputs and outputs. What you may not know is that all the entities available to you in the Hammer editor are defined in a text file, with the extension ".fgd". It is necessary for us to first make some changes to this file, in order to grant us access to some features that are not present in the default Empires install.
    1. First of all, we have to find the ".fgd" file. Now this will usually be in "Steam/SteamApps/SourceMods/Empires/mapsrc/fgd", and will be named "empires.fgd"
    2. Before making any changes, backup the file by creating a copy and naming it "empires.fgd.backup". Should anything go wrong, you can always revert to this file.
    3. Open the original file in notepad, and find the following line: "@SolidClass base(Targetname) = emp_eng_map_brush :". This is where the definition for the emp_eng_map_brush (the entity that we will be modifying) begins.
    4. Beneath this line, locate the output section, which should be a group of lines, each beginning with the word "output". There should exist one entry for the object being constructed by the Northern Faction team, and another for the Brenodi Empire.
    5. After these two lines, add the following: "output OnKill(void) : "Output for destruction of the object.". This will provide us with an output in hammer which fires when the object is destroyed. This output forms the cornerstone of the whole multi-part method.
    6. Save the file.
  2. Now that you have your "empires.fgd" set up correctly, you can launch into hammer and start putting your object together.
    1. In this tutorial, I will be creating an object that is to be built in three stages. Firstly, create the brushwork that will form the base for your first stage. In my case, this would be the lowest section of my tower.
    2. Select all parts of your first stage, and press Ctrl-T to tie them to an emp_eng_map_brush.
    3. Now, create your second stage. You do not need to duplicate the brushwork that forms your first stage, just create the parts that extend it.
    4. Select it, and tie it to another emp_eng_map_brush, as you did with your first stage.
    5. Repeat the process for your third and final stage. Now you should have three separate entities, each of which form one stage of your completed object.
    6. Give each stage a meaningful name. Mine are called "tower_bottom", "tower_middle" and "tower_top".
    7. --set disabled/enabled attributes--
    8. Now here is the principal on which my tower operates:
      1. When the bottom is built, I enable the middle.
      2. When the middle is built, I enable the top.
      3. When the top is built, I don't do anything!
      4. When the top is destroyed, I don't do anything.
      5. When the middle is destroyed, I destroy the top.
      6. When the bottom is destroyed, I destroy the middle.
    9. Now that we've established these rules, we quite simply translate them into a format that Hammer's I/O system can understand. For the moment, my tower is owned exclusively by the Northern Faction. We will deal with team changes later on.
      1. For tower_bottom, add the output OnBuiltNF to target tower_middle with enableNF.
      2. For tower_bottom, add the output OnKill to target tower_middle with disable.
      3. For tower_middle, add the output OnBuiltNF to target tower_top with enableNF.
      4. For tower_middle, add the output OnKill to target tower_top with disable.
  3. And that's it! Your structure is now complete. You can compile your level at this stage, and you should be able to see it in action. What follows is an explanation of how to deal with your structure changing teams in co-ordination with the ownership of a flag.