Jump to content
Sign in to follow this  
zaphodbeeblebrox

Add custom vehicle to editor

Recommended Posts

I have done some retextures of the Ghost Hawk as a precursor to porting some vehicles that are missing into Arma 3.

For my first experiment, I used an existing addon as a template for how to do config.cpp, etc. I installed the addon, Arma 3 can see it in Options > Expansions, and it's checked and enabled.

However, in the editor, if I go to BLUFOR or Empty either one (which it should show in BLUFOR) the Vehicle is not in the list. Is it possible to add a created vehicle to this list? How do you do it?

Share this post


Link to post
Share on other sites

Verify that scope is set to public in your vehicle class.

class cfgVehicles {
 ...
 class YourGhostHawk: ExistingGhostHawk {
   scope = 2; // 0=private, 1=protected, 2=public
   ...
 }
 ...
}

Share this post


Link to post
Share on other sites
Verify that scope is set to public in your vehicle class.

class cfgVehicles {
 ...
 class YourGhostHawk: ExistingGhostHawk {
   scope = 2; // 0=private, 1=protected, 2=public
   ...
 }
 ...
}

Thanks. I just took a look in my code, though, and scope = 2 is in there.

#define _ARMA_

enum {
destructengine = 2,
destructdefault = 6,
destructwreck = 7,
destructtree = 3,
destructtent = 4,
stabilizedinaxisx = 1,
stabilizedinaxesxyz = 4,
stabilizedinaxisy = 2,
stabilizedinaxesboth = 3,
destructno = 0,
stabilizedinaxesnone = 0,
destructman = 5,
destructbuilding = 1
};

class CfgPatches
{
class ZB_MedEvac
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1;
	requiredAddons[] = {};
};
};

class CfgVehicles {
class B_Heli_Transport_01_F;

class ZB_B_Heli_MedEvac_01_F : B_Heli_Transport_01_F {
	author = "Zaphod Beeblebrox";
	_generalMacro = "B_Heli_Transport_01_base_F";
	vehicleClass = "Support";
	faction = "BLU_F";
	crew = "B_Helipilot_F";
	typicalCargo[] = {};
	side = 1;
	scope = 2;
	attendant = 1;

	picture = "\A3\air_f_beta\Heli_Transport_01\Data\UI\Heli_Transport_01_base_CA.paa";
	icon = "\A3\air_f_beta\Heli_Transport_01\Data\UI\Map_Heli_Transport_01_base_CA.paa";
	threat[] = {0.0,0.0,0.0};

	class TransportItems
	{
		class _xx_FirstAidKit
		{
			name = "FirstAidKit";
			count = 20;
		};

		class _xx_Medikit
		{
			name = "Medikit";
			count = 2;
		};
	};

	hiddenSelectionsTextures[] = {"zb_medevac\addons\data\heli_medevac_01_ext_co.paa","zb_medevac\addons\data\heli_medevac_01_ext02_co.paa"};
};
};

Above is the code. It's just a STS24 MedEvac reskin. As you can see, scope = 2 is in there. Addon is loaded and recognized.

I tried adding "ZB_MedEvac" to addOns[] and addOnsAuto[] in mission.sqm, which returned an error that I could not play/edit this mission because it depended on something that was deleted.

Any further ideas?

Share this post


Link to post
Share on other sites

Any further ideas?

It ends up in the Support category in the editor (not Air).

Maybe change the vehicleClass to "Air" and add a displayName.

displayName = "My Ghost Hawk";
vehicleClass = "Air";

Or remove vehiclClass completely, so it will inherit from parent class (B_Heli_Transport_01_F).

Share this post


Link to post
Share on other sites

I can also go into the Editor and do a Game Logic or a Debug Console with the code:

_null = "ZB_B_Heli_MedEvac_01_F" createVehicle (position player);

And it does nothing.

---------- Post added at 22:08 ---------- Previous post was at 22:07 ----------

I checked both the support under BLURFOR/NATO and then I changed it to vehicleClass = "Air", re-PBO'd it, put it back in the addon folder, and still nothing in the list.

---------- Post added at 22:11 ---------- Previous post was at 22:08 ----------

It ends up in the Support category in the editor (not Air).

Maybe change the vehicleClass to "Air" and add a displayName.

displayName = "My Ghost Hawk";
vehicleClass = "Air";

Or remove vehiclClass completely, so it will inherit from parent class (B_Heli_Transport_01_F).

Oh, you're right, though, I have no displayName. Let me try that.

---------- Post added at 22:18 ---------- Previous post was at 22:11 ----------

Still no dice. Set displayName, commented out vehicleClass...still nothing in the editor.

---------- Post added at 22:19 ---------- Previous post was at 22:18 ----------

This is so frustrating, and I have a feeling it's something stupid.

---------- Post added at 22:24 ---------- Previous post was at 22:19 ----------

Let me recap the whole process.

I create a folder, @zb_medevac, with a directory named zb_medevac inside of it.

I put in it, addons directory. Inside of addons is a data directory.

The two .paa files for my textures are in the data directory.

There is a config.cpp file in the addons directory. (not binary yet)

I used PBO Manager to turn zb_medevac into zb_medevac.pbo.

So now I have @zb_medevac in D:/SteamLibrary/SteamApps/common/Arma 3, with zb_medevac.pbo inside of it.

In zb_medevac.pbo, addons is the directory directly under it, and the tree looks correct.

What could be wrong?

Share this post


Link to post
Share on other sites

I create a folder, @zb_medevac, with a directory named zb_medevac inside of it.

I put in it, addons directory. Inside of addons is a data directory.

The two .paa files for my textures are in the data directory.

There is a config.cpp file in the addons directory. (not binary yet)

I used PBO Manager to turn zb_medevac into zb_medevac.pbo.

So now I have @zb_medevac in D:/SteamLibrary/SteamApps/common/Arma 3, with zb_medevac.pbo inside of it.

In zb_medevac.pbo, addons is the directory directly under it, and the tree looks correct.

This is how the source directory structure should look:

zb_medvac/config.cpp
zb_medvac/data/heli_medevac_01_ext_co.paa
zb_medvac/data/heli_medevac_01_ext02_co.paa

PBO zb_medvac directory and put the zb_medvac.pbo in C:\Users\{your username here}\Documents\Arma 3\@zb_medvac\addons directory.

If you look inside the zb_medvac.pbo, it should look like this:

config.cpp (or config.bin)
$PBOPREFIX$
data/heli_medevac_01_ext_co.paa
data/heli_medevac_01_ext02_co.paa

The $PBOPREFIX$ should contain the single line:

zb_medvac

Launch Arma 3 with -mod=@zb_medvac argument.

Also, you need to remove "addons" from the texture path in your config.cpp.

hiddenSelectionsTextures[] = {"zb_medevac\data\heli_medevac_01_ext_co.paa","zb_medevac\data\heli_medevac_01_ext02_co.paa"};

Share this post


Link to post
Share on other sites

class CfgPatches
{
   class ZB_MedEvac
   {
       units[] = {};
       weapons[] = {};
       requiredVersion = 1;
       requiredAddons[] = {};
   };
}; 

I thought you have to list your new classes in there if you add stuff to the game, or is that for another purpose?

Edit:

Sample says this

/*	Addon description	*/
class CfgPatches {
// Avoid confusing users by keeping class name match the PBO name and path.
class Test_Tank_01 {
	// List addons defining config classes you want to use, define new vehicles available in editor and weapon classes
	requiredAddons[] = {"A3_Armor_F_Beta"};
	units[] = {"O_Test_Tank_01"};
	weapons[] = {};
};
};

So i assume it's a must, at least the units[]=etc

Share this post


Link to post
Share on other sites
class CfgPatches
{
   class ZB_MedEvac
   {
       units[] = {};
       weapons[] = {};
       requiredVersion = 1;
       requiredAddons[] = {};
   };
}; 

I thought you have to list your new classes in there if you add stuff to the game, or is that for another purpose?

It's not strictly required (but a good practice). The units/vehicles will be displayed in the editor even those fields are empty.

Share this post


Link to post
Share on other sites

I have solved this, by the way. I will be doing a little more tinkering, then posting the steps I took to resolve here when I'm freed up (at work) in case others come across this thread.

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  

×