Jump to content
Sign in to follow this  
bushlurker

Custom Keypoint / Location Types and how to make 'em...

Recommended Posts

Since I mentioned custom keypoints in another thread earlier, here's a quick guide on how to define & implement them on your terrain...

Before we start messing with custom keypoint types, let's take a quick refresher course on the current available ones by reading Commander1985's excellent summary

OK.

Now we've reminded ourselves of the main types of keypoint... broadly speaking, some are "Names", some are "Symbols" (or a combination of both) and some are completely invisible, but serve some "Strategic" purpose - like "CityCenter" for example...

Let's make a simple custom symbol one which can be named or not as we like...

The first thing we'll need is a symbol to use... this one steaming_pile_ca_zps9daff690.png from Google Chat will do nicely... :D

Now we need to add a suitable keypoint type name to "kptypes.dat" - here's mine...

BorderCrossing
VegetationBroadleaf
VegetationFir
VegetationPalm
VegetationVineyard
NameMarine
NameCityCapital
NameCity
NameVillage
NameLocal
RockArea
ViewPoint
FlatArea
FlatAreaCity
StrongpointArea
FlatAreaCitySmall
CityCenter
Hill
Name
Mount
Airport
Strategic
[color="#FF0000"]SteamingPile[/color]

As you can see, I've named my map symbol suitably in my kptypes.dat file and dropped it back in my Visitor install folder, ready to use...

Into V3, load a demo terrain and we're ready to place those new Steaming Pile indicators... ;)

Vis_Pile_zpsbb1e5504.jpg

Here you can see I've placed a normal keypoint, and in its Properties Window I've defined a classname and chosen the Keypoint Type "SteamingPile" from the list.

If you really want to name your Steaming Piles individually and, lets face it, who doesn't... then you could type a "Display Name" at this stage too...

** At this point it's worth remembering how these keypoint definitions work in Visitor...

As you define these keypoints, they're stored in the .pew file - it's only when you're at the viewing-in-buldozer while saving the .wrp stage, that they're written to the "yourterrain.hpp" file, ready to be #included in your main config.

So the next stage is to open buldozer, view the terrain and save a .wrp file... At that stage you can have a peek in your "myterrain.hpp" file and you'll see the new keypoint definition... mine looks like this...

class SteamingPile_01
{
name="";
position[]={3043.26,2006.69};
type="SteamingPile";
radiusA=100;
radiusB=100;
};

If you'd defined a name for your Pile then it would appear in the name=""; section...

Now we need to tell the engine precisely what a SteamingPile is...

The default Location Types are defined in a config section called, unsurprisingly, "cfgLocationTypes", so the next thing we need to do is add our definition to that...

We'll sneak a little "patch" section into our main terrain config... Here's the opening section of the demo terrain I used...

#define _ARMA_
class CfgPatches
{
class AfghanValley
{
 units[] = {"AfghanValley"};
 weapons[] = {};
 requiredVersion = 1.0;
 requiredAddons[] = {"Takistan"};
 version = "30/07/2011";
 fileName = "AfghanValley.pbo";
 author = "Bushlurker";
 mail = "terrain@bushlurker.com";
};
};
[color="#FF0000"]class CfgLocationTypes
{
class SteamingPile
{
 name = "";
 drawStyle = "icon";
 texture = "Bush\AfghanValley\data\icons\steaming_pile_ca.paa";
 color[] = {};  //<--- uses icon colours or define RGB values in usual 0 > 1 format
 size = 32;
 shadow = 0;
 font = "Zeppelin33";   //<--- or try Zeppelin33italic
 textSize = 0.2;
};
};[/color]
class CfgWorlds
{
class CAWorld;
class Takistan: CAWorld
...etc, etc, etc ......
{

Right here at the beginning of the main terrain config is fine - or, if you were planning on doing a lot of these, you could define them all externally in a "mykeypoints.hpp" and just #include it at this location to keep your main terrain config less cluttered...

Finally, as you can see from the definition above, I'll need to drop my icon file into a folder called "icons" in the "Data" folder of my terrain... that way the icon will be included at the binarizing stage and be available in-game to be used on the map...

Dump_zpsb8b58371.jpg

Try to keep icon sizes small and square, preferably ^2 and as you can see from the "_ca" suffix, alpha channels work nicely...

Have fun!!

B

Edited by Bushlurker
  • Like 1

Share this post


Link to post
Share on other sites

Um that's gross. But very handy info and saving me time and probably frustration.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×