Multi-Part Buildables: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
===This is a work in progress tutorial, actively under development by Broccoli.===
===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 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 [[Engineer-Buildable Objects|basic tutorial]], covering single-part buildables.
Before you begin, I would recommend reading the [[Engineer-Buildable Objects|basic tutorial]], covering single-part buildables.


# Create the fgd entry
# 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.
## Find line
## 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"''
## Edit line
## 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.
# Set up the entities
## 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.
## 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.
## 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.
## Save the file.
# Now that you have your ''"empires.fgd"'' set up correctly, you can launch into hammer and start putting your object together.
## 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.
## Select all parts of your first stage, and press Ctrl-T to tie them to an [[emp_eng_map_brush]].
## 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.
## 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.
# Compile and test
# Compile and test

Revision as of 03:53, 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.
    6. Now you should have three separate entities, each of which form one stage of your completed object.
  3. Compile and test