Author Topic: An elementary custom Airfield  (Read 1356 times)

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10891
An elementary custom Airfield
« on: May 20, 2011, 12:52:22 PM »
Penguine ask in another thread if there were any textures or runways available in the public domain, and it got me thinking about all the past wizards like Pokie and Nuts. They were the masters that shared their knowledge in the early years, so in their spirit, here is a way to achieve the most basic custom airfield, and without any tools other then notepad and MSPait, though I recommend ac3d, and a program like GIMP once you master this simple method.

Prerequisites:
You must be familiar with the TE and have a working terrain to install and test the final airfield object. I will not answer TE questions in this thread.

Step 1 is make an object that looks like your custom airfield.
Step 2 is to allow aircraft launches
Step 3 is to make the runways work for landing successfully

In the Object Editor, find cityg1 and export it by clicking the Export to ac3d button.

C:\Hitech Creations\ah2editor\export
You will find three files the OE exported, in a folder named export,

CITY.bmp
CITY_a.bmp
cityg1.ac

C:\Hitech Creations\ah2editor\ahiiterr\tiles.
Create a folder in the tiles folder named airfield.

Move the three city files into this new airfield folder.

Rename each of these, respectively as:
airfield.bmp
airfield_a.bmp
myaf.ac

Open myaf.ac in Notepad.

Scroll down to the bottom of the listing and change the following line:

texture "CITY.bmp" becomes
texture "airfield.bmp"

Save the file
That’s it, you’re done with the scary part.

Open airfield_a.bmp in any paint program.

Draw a heavy black outline for your runway leaving the runway as white, and enough of the areas surrounding it as black to see the effect when you install it. Everything you draw as black will be transparent, everything white will allow the texture to show through. Don’t fill in the whole texture with black because you’d like to see the feathering along the borders of the tile caused by the grayscale image. You’ll implement the same feathering method along the edges of your runways when you build your version. You can increase the size of the bitmaps so long as they’re the same size, 512 or 1024, and so long as you don’t change the properties, grayscale and indexed color. You can come back to this point later but it's safer to use the existing bitmaps for this example.

Save the airfield_a.bmp.

You can open the airfield.bmp and paint it all one color for this test if you'd like.

Open the OE. Use the File menu and Convert ac3d, to build your airfield object. You will need to restart the OE to see your new airfield in the shapes list. Don’t worry that you don’t see it in the preview window. Add it into the OE’s main window. You will see what looks like the original cityg1 shape, but with the outline of your “airfield” in it. The properties should default to clutter, and that’s fine. If you change it to runway, the whole tile will give a Landed successfully message, but hopefully that’s not what you want.

This is the simplest way to create the visual impression of a custom airfield. Let’s continue. Add your tower, hanger, FHs, BHs, all the required objects for a working airfield.

In the OE, set the Tile Properties to
Is Square Tile Object and
Display Terrain Under Tile

Save this new airfield as myaf.

Build myaf and exit the OE.

C:\Hitech Creations\ah2editor\userlib
In the userlib folder, find the airfield.shp and airfield.htx (the textures) files and move them to the texsrc folder in your terrain.

C:\Hitech Creations\ah2editor\newshps
Then inside the newshps folder, find your myaf.shp file and move it to your texsrc folder.

Open the TE. You will need to open your terrain twice (use File, Open) to see myaf in the objects list.

Place myaf in the terrain to see that it’s visible with your runway markings etc. and apply the normal airfield properties.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10891
Re: An elementary custom Airfield
« Reply #1 on: May 20, 2011, 12:57:54 PM »
Step 2
Add an entry point, entpnt, at the end of your runway, and rotate it to point down the runway. When it’s rotated correctly, set the properties as ftr entry, a fighter spawn. The spawn point will be invisible now.

Save your terrain. Build it, but expect the TE to crash the first time you build it. The required files aren’t updated until you attempt that first build after installing each custom object

You can launch the game and try out your new field offline if you like.

Step 3
You now have an airfield that might look like what you wanted when we started, but you can’t achieve a landed successfully message because there are no runway objects to land on, only that ground texture you made, and it’s only clutter.

You have two options. The quickest and most common method is to place the OE’s runways, rwy#, lot# and rs### objects over the textures’ runways, with each set as the runway property. When your texture runway is completely covered, reset the index of each runway object to 0. This will hide the runway objects under your texture and allow a landed successfully message when you tower out on the runway you’ve drawn on your texture.

The preferred method is to create a runway object in ac3d that mirrors the textures’ paved surfaces, and then set the polyID to 20001. PolyIDs are covered in the OE/ac3d readme on your hard drive. The runway shape can be a separate object hidden under your ground texture, but it’s preferable to build it directly into the ground object using ac3d. These methods are beyond the scope of this post.

_____________________________ ______
A word about custom objects, that will only make sense after you’ve been working with them for awhile.

Use only the smallest texture size necessary to achieve your needed effect. Nothing adds to terrain size as quickly as custom textures.

Keep the number of object surfaces as low as possible. They impact frame rates.

Strike a balance between surface counts and megabyte required for texture space. Be willing to compromise on your detailed artwork. It might come down to building a nice terrain that all the players can use, or one with high levels of detail that players can not run on older equipment, or possibly one that dialup players can’t download at home because of their bandwidth.

Easy in-game again.
Since Tour 19 - 2001

Offline USRanger

  • AvA Staff Member
  • Plutonium Member
  • *******
  • Posts: 10325
      • BoP Home
Re: An elementary custom Airfield
« Reply #2 on: May 22, 2011, 05:47:33 PM »
Good stuff Easy. :aok
Axis vs Allies Staff Member
☩ JG11 Sonderstaffel ☩
Flying 'Black[Death] 10' ☩JG11☩

Only the Proud, Only the Strong Ne Desit Virtus

Offline jimson

  • AvA Staff Member
  • Platinum Member
  • ******
  • Posts: 7202
      • The Axis vs Allies Arena
Re: An elementary custom Airfield
« Reply #3 on: October 21, 2012, 12:47:52 AM »
Penguine ask in another thread if there were any textures or runways available in the public domain, and it got me thinking about all the past wizards like Pokie and Nuts. They were the masters that shared their knowledge in the early years, so in their spirit, here is a way to achieve the most basic custom airfield, and without any tools other then notepad and MSPait, though I recommend ac3d, and a program like GIMP once you master this simple method.

Prerequisites:
You must be familiar with the TE and have a working terrain to install and test the final airfield object. I will not answer TE questions in this thread.

Step 1 is make an object that looks like your custom airfield.
Step 2 is to allow aircraft launches
Step 3 is to make the runways work for landing successfully

In the Object Editor, find cityg1 and export it by clicking the Export to ac3d button.

C:\Hitech Creations\ah2editor\export
You will find three files the OE exported, in a folder named export,

CITY.bmp
CITY_a.bmp
cityg1.ac

C:\Hitech Creations\ah2editor\ahiiterr\tiles.
Create a folder in the tiles folder named airfield.

Move the three city files into this new airfield folder.

Rename each of these, respectively as:
airfield.bmp
airfield_a.bmp
myaf.ac

Open myaf.ac in Notepad.

Scroll down to the bottom of the listing and change the following line:

texture "CITY.bmp" becomes
texture "airfield.bmp"

Save the file
That’s it, you’re done with the scary part.

Open airfield_a.bmp in any paint program.

Draw a heavy black outline for your runway leaving the runway as white, and enough of the areas surrounding it as black to see the effect when you install it. Everything you draw as black will be transparent, everything white will allow the texture to show through. Don’t fill in the whole texture with black because you’d like to see the feathering along the borders of the tile caused by the grayscale image. You’ll implement the same feathering method along the edges of your runways when you build your version. You can increase the size of the bitmaps so long as they’re the same size, 512 or 1024, and so long as you don’t change the properties, grayscale and indexed color. You can come back to this point later but it's safer to use the existing bitmaps for this example.

Save the airfield_a.bmp.

You can open the airfield.bmp and paint it all one color for this test if you'd like.

Open the OE. Use the File menu and Convert ac3d, to build your airfield object. You will need to restart the OE to see your new airfield in the shapes list. Don’t worry that you don’t see it in the preview window. Add it into the OE’s main window.