OFPEC Forum

Addons & Mods Depot => ArmA - Configs & Scripting => Topic started by: Deadfast on 13 Apr 2009, 14:22:06

Title: Config for a re-skinned vehicle
Post by: Deadfast on 13 Apr 2009, 14:22:06
Hello all,
I'll say it right away - I'm a total newbie when it comes to making any configs :)


Now I'd need a little help - I've made a bunch of civilian vehicles reskins and I'd like to get them into the game. They should be stand alone and shouldn't replace any of the default vehicles.


Could anyone be that kind and give me some directions with, let's say, a reskin for the hatchback?



Thanks a lot,
Deadfast
Title: Re: Config for a re-skinned vehicle
Post by: kju on 13 Apr 2009, 15:36:45
config.cpp

Code: [Select]
class CfgPatches
{
class YourTag_MyVehicle
{
units[] = {"YourTag_MyVehicle"};
weapons[] = {};
requiredVersion = 1.14;
requiredAddons[] = {"CAWheeled"};
};
};
class CfgVehicles
{
class Car_hatchback;
class YourTag_MyVehicle: Car_hatchback
{
model = "\YourTag\MyVehicle\P3dName";
};
};

Addon structure:
P:\YourTag\MyVehicle\*

PboPrefix:
YourTag\MyVehicle

If you want to do it GOOD, separate config, from model, from sound etc into separate Pbos.

See:
Good design - separate an addon in multiple PBOs (http://dev-heaven.net/boards/17/topics/show/383)


Suggested naming:
PBO naming thoughts (http://dev-heaven.net/boards/17/topics/show/137)

So for example:

DFS_C_CIV_MyVehicle, DFS_P_CZ_MyVehicle and DFS_P_CZ_MyVehicle.

Use this setup for each model to make them all standalone and
easy to make replacement configs for em.  :good:
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 13 Apr 2009, 15:54:34
Much appreciated, gonna take a look on it right away :)



EDIT: Well, got it do display in the game, but it's missing any animations.
If my memory servers me correctly model.cfg has something to do with this, correct?
Title: Re: Config for a re-skinned vehicle
Post by: kju on 13 Apr 2009, 16:26:09
Yep, check

http://community.bistudio.com/wiki/Model_Config#cfgModels

I find the explanation rather complicated.
To me the config code seems more understandable.
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 13 Apr 2009, 17:05:53
This is getting rather annoying.

Not only it's still not animated, but now the windows are not even transparent when binarising the model...
Title: Re: Config for a re-skinned vehicle
Post by: kju on 13 Apr 2009, 18:03:45
Some patience and wait for the animation master Gnat.  :D

Make use of the new fast BIF search for billion transparent
texture threads.  :whistle:
Title: Re: Config for a re-skinned vehicle
Post by: modEmMaik on 13 Apr 2009, 18:58:38
This is getting rather annoying.

Not only it's still not animated, but now the windows are not even transparent when binarising the model...

Everybody runns into this effect  ;)

The name in the CfgModels must match you .p3d name...  :cool2:
e.g. The model is named my_hatchback.p3d

Code: [Select]
;
class CfgModels
{
    class Default
    {
        sectionsInherit="";
        sections[] = {};
        skeletonName = "";
    };
class my_hatchback: Default
{
sectionsInherit="Default";
sections[]=
{
"ammo",
...
"P svetlo"
};
skeletonName="my_hatchback_skeleton";
class Animations
{
class DrivingWheel
{
type="rotation";
source="drivingWheel";
selection="volant";
axis="volant osa";
memory="true";
animPeriod=0;
minValue=-1;
maxValue=1;
angle0=18;
angle1=-18;
};
...
};
};
};


The non-transparent effect belongs to missing .rvmat-files in your CA/xxx directory. When unbin, it uses the rvmat's from the BI-pbo's. I simply unpbo'ed most of BI's pbo's and saved them in the P:\CA directory.

e.g. P:\CA\wheeled, P:\CA\tracked and so on.
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 13 Apr 2009, 19:21:16
Thanks, you guys just made my day! :D


Problem solved :)


Actually one more question:
How would one go about adding seats to the vehicle?
For example the Coyota?
Title: Re: Config for a re-skinned vehicle
Post by: Gnat on 14 Apr 2009, 13:56:29
Not sure what you mean ... as in model seats into the vehicle ?
Use O2, and you can make a seat out of 2 boxes. 1 Box is the back of the seat, 1 for the seat itself.
A seat with head-rest. thats 3 boxes :D

...... or, copy (Control-C) the seats in a BIS model, open your model .... paste.
Move it around until its in the right position.
The path to the textures should be presevered.

Beware but, by community rules, using BIS 3D material means your raw model is now public domain, its requestable to be handed over.
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 14 Apr 2009, 14:10:26
Add a new passenger position(s).
Title: Re: Config for a re-skinned vehicle
Post by: Gnat on 14 Apr 2009, 14:26:40
Oh lol
In O2
- CREATE -> PROXY
- In drop-down list select "cargo", or type in "cargo"

In CONFIG.CPP add
Quote
transportSoldier=3;
cargoAction[] = {"UH60_Cargo02"};

The "CargoAction" can be an array, the N'th element of the array defining the stance of the N'th cargo proxy.

EDIT
If you want to know what all the available "actions are, scan all the sample BIS configs for the word "CargoAction" to see whats available.
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 14 Apr 2009, 15:09:08
Thanks a lot and sorry for not being descriptive enough at first ;)


EDIT:
Works great, but how do I define the enter (where the Get in action appears) and exit points?
I can see some related points in the Memory LOD ("pos cargo", "pos cargo dir"), however I have no idea how to call the new ones?
Title: Re: Config for a re-skinned vehicle
Post by: DeanosBeano on 14 Apr 2009, 19:02:30
 getinpoints are vertices added in memmory lod and defined in cpp with

  memoryPointsGetInCargo= "pos_cargo";  and memoryPointsGetInCargoDir = "pos_cargo_dir";

 If you have inherited from Car_hatchback it will only have one defined from default  for cargo i think so you will have to add   the original and another if you are to modify.  names in memory lod will need to be exact same as in cpp or arma.rpt will say no defined getin pos etc etc

 here are most of the available pos for cpp.

 
Code: [Select]
memoryPointsGetInDriver = "pos_driver";
memoryPointsGetInDriverDir = "pos_driver_dir";
memoryPointsGetInCommander = "pos_commander";
memoryPointsGetInCommanderDir = "pos_commander_dir";
// memoryPointsGetInGunner = "pos_gunner"; //ToDo: might be obsolete
// memoryPointsGetInGunnerDir = "pos_gunner_dir"; //ToDo: might be obsolete
memoryPointsGetInCargo = "pos_cargo";
memoryPointsGetInCargoDir = "pos_cargo_dir";
memoryPointsGetInCoDriver = "pos_codriver";
memoryPointsGetInCoDriverDir = "pos_codriver_dir";
Title: Re: Config for a re-skinned vehicle
Post by: Deadfast on 14 Apr 2009, 19:43:01
What if I have more cargo seats though?

EDIT: Hang on, it seems there can be more verts per pos cargo and pos cargo dir selection.
Title: Re: Config for a re-skinned vehicle
Post by: Gnat on 15 Apr 2009, 13:28:12
- If you stick to the names used by BIS ("pos cargo" and "pos cargo dir", no under-score, just a space), you don't have to re-define them in your config.
- Yes, you can have more than 1 point called this. You can have many.
- But any of these "entry points" can be used by any AI/human to get into any seat. There is no relationship between the points and any cargo proxy (or driver, gunner or commander).

Title: Re: Config for a re-skinned vehicle
Post by: DeanosBeano on 15 Apr 2009, 18:33:35
Quote
There is no relationship between the points and any cargo proxy (or driver, gunner or commander).
well that isnt strictly true of course, because you can attach memory point to a proxy and this prevents you boarding at the back of the vehicle ,when you clicked at the side door. and ensures you get out at the right point too.

 example is from my side guns and searchlight on an aircraft .
turret 1
 
Code: [Select]
proxyIndex = 1;
gunnerName = "Left Door Gun";
memoryPointsGetInGunner = "pos_gunner";
memoryPointsGetInGunnerDir = "pos_gunner_dir";
turret 2
Code: [Select]
proxyIndex = 2;
gunnerName = "Right Door Gun";

                                memoryPointsGetInGunner = "pos_gunner_2";
memoryPointsGetInGunnerDir = "pos_gunner2_dir";

turret3
Code: [Select]
proxyIndex = 3;
gunnerName = "search light";
                                memoryPointsGetInGunner = "pos_gunner_3";
memoryPointsGetInGunnerDir = "pos_gunner3_dir";

 this way you will start your animation facing the propper way and also start the animation Getinlow in the right place