Advertisement

Author Topic: Configs for re-skined units  (Read 3769 times)

0 Members and 1 Guest are viewing this topic.

Offline The_Blink

  • Members
  • *
Configs for re-skined units
« on: 19 Apr 2009, 14:50:12 »
hey guys im new to configs and this is the first one ive ever needed to try

ive tried editing the config for a units form the BIS configs but got no luck
can anyone show a basic single unit config without weapons and on the civ side?

if you need more info just ask

thanks

Offline Gnat

  • Addons Depot
  • Administrator
  • *****
  • I Bite!
    • Gnats
Re: Configs for re-skined units
« Reply #1 on: 19 Apr 2009, 15:12:51 »
definitely need more info.
First, what type of unit are we talking about?
man, car, plane .... ?
second, whats the exact name of the p3d

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #2 on: 19 Apr 2009, 21:04:15 »
sry lol
a man

the texture was taken form a racs airmen so ill use that and take the helmat off

Offline Gnat

  • Addons Depot
  • Administrator
  • *****
  • I Bite!
    • Gnats
Re: Configs for re-skined units
« Reply #3 on: 20 Apr 2009, 16:10:46 »
Hmmm, haven't mod'ed men myself, but at a guess (untested);

This is the default Civilian (under CfgVehicles) ;

Quote
   class Civilian  : CAManBase {
      scope = 2;
      access = 2;
      side = 3;
      displayName = "$STR_DN_CIVILIAN";
      nameSound = "civilian2";
      model = "\ca\characters\civil_1_tshirt";
      accuracy = 0.600000;
      camouflage = 1.200000;
      threat[] = {0.000000,0.000000,0.000000 };
      weapons[] = {"Throw","Put" };
      magazines[] = {};
      cost = 100000;
      fsmFormation = "ca\characters\scripts\formationC.fsm";
      fsmDanger = "ca\characters\scripts\formationCDanger.fsm";
      formationX = 2;
      formationZ = 5;

      class Wounds  {
         tex[] = {};
         mat[] = {"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat","ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound1.rvmat","ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound2.rvmat","ca\characters\data\civil_tshirt_body.rvmat","ca\characters\data\civil_tshirt_body_wound1.rvmat","ca\characters\data\civil_tshirt_body_wound2.rvmat" };
      };
   };

So your Civilian config should look like

Quote
class CfgPatches
{
   class TAG_MyCivilianAddon
        {
         units[] = {MyCivi};
    weapons[] = {};
    requiredAddons[] = {"CAData", "CACharacters", "CAWeapons", "CASounds", "CA_Anims_Char"};
        };

};
class CfgVehicles  {
class Civilian; // extend class
class MyCivi : Civilian
{
displayName = "My Man";
model = "\MyCivi\MyCivimodel.p3d";
class Wounds  {
         tex[] = {};
         mat[] = {xxxxxxxxxxxxxxxxxxxxxx};

};
};

If the RAC Airman has mat[]= defined, you may be able to copy those definitions, otherwise you'll have to make your own wound textures.

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #4 on: 20 Apr 2009, 19:38:40 »
displayName = "My Man";(i rename this to whatever i want call it?)

class Wounds  {
         tex[] = {};  (do i add the texture i made to this?)
         mat[] = {xxxxxxxxxxxxxxxxxxxxxx}(i add the wound texture here?)

am i right in my questions?

btw thank you bvery much

Offline Gnat

  • Addons Depot
  • Administrator
  • *****
  • I Bite!
    • Gnats
Re: Configs for re-skined units
« Reply #5 on: 21 Apr 2009, 15:31:54 »
no prob

1) Yes, anything
2) No, stays empty
3) Yes, in groups of 3. First def. is no wounds, second is some wounds, 3rd is full wounds.
  Like;

{"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound1.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound2.rvmat",
"NoWound",
"1st Level Wounds",
"2nd Level Wounds",
etc etc

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #6 on: 21 Apr 2009, 20:42:22 »
k i added that to the config

i can see the unit in the editor but when i click preview..the game crashes
im sure ive gone wrong but havnt a clue were

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #7 on: 21 Apr 2009, 21:13:19 »
Best to check this issue in the bulldozer. It may show you some more info's about what is going wrong.

The ARMA.rpt may also show some more info.

When your last change was the wounds, check for correct "," setting.

E.g.: Wrong version (missing [] and too much ",")
class Wounds{   tex={};
         mat={"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound1.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound2.rvmat",};
};

correct version:
class Wounds{   tex[]={};
         mat[]={"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound1.rvmat",
"ca\characters\data\civil_1_tshirt_shorts_klapky_ksiltka_hhl_wound2.rvmat"};
};
« Last Edit: 21 Apr 2009, 21:17:30 by modEmMaik »

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #8 on: 22 Apr 2009, 17:52:26 »
should i use \ca\characters etc since im making a new unit?

also if i used this layout once i get the unit working
would using the same config but with different p3d files and name of unit casue any clashing?

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #9 on: 24 Apr 2009, 12:22:10 »
Well, a different .p3d name implies that you must supply a correct model.cfg, matching the .p3d.
Because the system is unable to determine the correct CfgSkeletons / CfgModels. It matches the CfgModels class with the .p3d name in the model.cfg.

The CfgVehicles entries can be used in a inherritance. E.g.:
Code: [Select]
class SoldierWPilot;
class YourModifiedPilotClassName: SoldierWPilot {};

This should work without any sidekicks to the existing addons.

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #10 on: 24 Apr 2009, 23:29:53 »
ok i get an error message now
"cannot laod material file mowound"

i can see a racs airman with his arms out,and his leg missing

any hints?

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #11 on: 25 Apr 2009, 12:37:18 »
Nope,

would be fine, when you add more info about what you have done.

e.g.
- Upload your config.cpp and model.cfg to pastebin
- Upload your complete addon to zshare or other hosters

But first of all, try to get an unmodified version of the .p3d ingame, before changing anything on the model. Also check for simmilar addons (binkowski, relikki etc.), how they did it.

BR,
mike

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #12 on: 29 Apr 2009, 18:37:35 »
were can i apply my texture to the unit in the config? all i see is the model in RACs airmen uniforms

im really stuck but i can understand your help

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #13 on: 29 Apr 2009, 19:11:54 »
Texture/material definition is in the .p3d file (visual LOD's / Face Properties).

The config may define certain sections as hiddenSelections, which can be manipulated via setObjectTexture in game.

The config includes material definition for wounds, but I think you want to apply your own texture  ???.

This should be done in O2.  ;)

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #14 on: 30 Apr 2009, 21:59:35 »
I've been helping Blink. I've got the unit in game, but he just stands there frozen. I believe he's just an object, rather than a human unit.

Code: [Select]
class CfgPatches
{
class SL_Medic
{
units[] = {"SL_Medic"};
weapons[] = {};
requiredVersion = 1;
};
};

class CfgVehicleClasses
{
class sl_units
{
displayName = "SL - Civilians";
};
};


class CfgVehicles  {
class Civilian; // extend class
class SL_Medic : Civilian
{

vehicleClass = "sl_units";
displayName = "Paramedic";
model = "\sl_medic\SL_medic.p3d";

//class Wounds  {
//         tex[] = {};
//         mat[] = {"ca\characters\data\res_pilot_body.rvmat", "ca\characters\data\res_pilot_molle_webbings.rvmat", "ca\characters\data\us_officer_equip.rvmat","ca\characters\data\us_pilot_helmet.rvmat", "ca\characters\data\us_pilot_hhl.rvmat", "ca\wheeled\data\empty_nzw.rvmat"
//};


I commented out the wounds bit, as I wasn't sure it would be necesssary. Wouldn't it already be declared in civilian class?

What else do we need to expand on it and actually make a human playable unit?

Edit: I made some progress. The unit bleeds when shot but doesn't actually go down. However, the unit no longer goes solid. It's like the units geometry LOD dies, and falls to the floor but the rest of the model does nothing. What's wrong?
« Last Edit: 30 Apr 2009, 22:26:50 by JasonO »

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #15 on: 02 May 2009, 12:10:08 »
I am not an expert to characters, but it seems that those units get animated via .rtm's only (the model.cfg includes not animations, as far as I have analyzed this).

So you may check the animations, using a rtm-file (e.g. ca/wheeled/data/anim/xxx.rtm) an load this into O2 (Animations window) for all LODs (right click into the animations window pos up a menu).

plus: Have you checked the model.cfg for a correct bone structure and the assignment to the .p3d's name.

e.g.:
Code: [Select]
class CfgModels
{
class Default;
...
class ArmaMan : Default
{
sections[] =
{
    "osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury",
    "clan"
};
  skeletonName = "OFP2_ManSkeleton";
};

class SL_medic: ArmaMan {};

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #16 on: 03 May 2009, 01:31:52 »
I don't have a model.cfg. I assume this is important.

Some research tells me that the classname has to be the same name as the model (sl_medic) as you have there. So will play around and see if I achieve anything from it.

Thanks for the reply.

Edit: OK, here's error message I got. Not sure on the syntax used in config's i'm afraid, so not sure what's wrong.
Code: [Select]
class CfgModels
{
class All{};
class AllVehicles: All{};
class Land: AllVehicles{};
class Man: Land{};
class CAManBase: Man{};
class Civilian: CAManBase{}; // extend class
{
sections[] =
{
    "osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury", "clan"
};
  skeletonName = "OFP2_ManSkeleton";
};

class SL_medic: Civilian {};
};
« Last Edit: 03 May 2009, 18:01:59 by JasonO »

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #17 on: 03 May 2009, 22:19:53 »
Too many brackets  :)

Code: [Select]
class Civilian: CAManBase{}; // extend class
{
...
correct (I hope...)
Code: [Select]
class Civilian: CAManBase
{
...

But I think that this alternative should work, too:
Code: [Select]
class Civilian;
class SL_medic: Civilian {};

But the model.cfg should include class CfgSkeletons and class CfgModels. class CfgModels is config.cpp.

I just located an old model.cfg for a soldier, but I am not 100% sure if this works: Pastebin model.cfg BISoldier
The bones should be the same, just add
Code: [Select]
class SL_medic: ArmaMan{};
to link it to your SL_medic.p3d instead of the BISoldier
« Last Edit: 03 May 2009, 22:27:50 by modEmMaik »

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #18 on: 04 May 2009, 01:16:11 »
Kinda done it.. something's clearly not right though, haha :P

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #19 on: 05 May 2009, 00:12:25 »
Hmmm... suprising  :o

I have just checked the new sjb_sas package, and he uses nearly the same skeleton. Buy my config seems to include at least one error. The skeletonName="Head" is definitely missing. May be you get a better model.cfg from Jackal326, because he released the latest units.

Alternatively: Have you tried a BI-standard unit with this config?

:edit: I have just created a little repl-config for the BI-BLUFOR standard unit: unit repl config unbin

The model.cfg was definitely buggy :(
I am not sure, if the flag / flag_carrier definitions are needed, but the unit works ingame. The .pbo is unbinarized. I hope this helps you.

br,
mike
« Last Edit: 05 May 2009, 00:37:26 by modEmMaik »

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #20 on: 06 May 2009, 02:51:14 »
Hmm, I tried replacing your model and putting mine in then just changing the necessary.. and it goes back to how it was with him half in the ground and standing still.

I've zipped what I have now. Maybe you can see anything i've missed out? I hate having to send the whole thing over to have someone else 'do' it, but i'm really stumped to a solution on why this isnt working.

Thanks for your replies modEmMaik - It really is greatly appreciated :)

Jason

Offline modEmMaik

  • Members
  • *
Re: Configs for re-skined units
« Reply #21 on: 06 May 2009, 10:40:16 »
Everything is correct, I just changed the inherritance like this:

Code: [Select]
class CfgPatches {

class SL_medic {
Units[] = {"SL_medic"};
Weapons[] = {};
requiredVersion = 1.000000;
requiredAddons[] = {"CACharacters"};
};
};


class CfgVehicles
{
class SoldierWMedic;
class SL_medic : SoldierWMedic
{
displayName="Sahrani Medic";
model="\sl_medic\sl_medic";
class Wounds
{
tex[]={};
mat[]={
"ca\characters\data\res_pilot_body.rvmat",
"ca\characters\data\res_pilot_body_wound1.rvmat",
"ca\characters\data\res_pilot_body_wound2.rvmat",
"ca\characters\data\us_pilot_hhl.rvmat",
"ca\characters\data\us_pilot_hhl_wound1.rvmat",
"ca\characters\data\us_pilot_hhl_wound2.rvmat"
};
};
};
};

Result Pic

You find the "Sahrani Medic" in Blufor / Men / "Sahrani Medic".

Only issue left seems to be the shadows.

Offline The_Blink

  • Members
  • *
Re: Configs for re-skined units
« Reply #22 on: 06 May 2009, 14:01:20 »
wow tats great XD thanks alot for your help maik

and jason too ,although uve heard it before on arma-rpg lmao

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #23 on: 07 May 2009, 01:05:31 »
Fantastic!

I edited the textures a bit. We removed the helmet from the unit, but he still had the RVMAT files so he had a funny shadow on his head :P

Here's the final config for a working unit for anyone who wants to use it.

Code: [Select]
class CfgPatches {

class SLR_medic {
Units[] = {"SLR_medic"};
Weapons[] = {};
requiredVersion = 1.000000;
requiredAddons[] = {"CACharacters"};
};
};


class CfgVehicles
{
class SoldierGMedic;
class SLR_medic : SoldierGMedic
{
displayName="SLR Paramedic";
model="\SLR_medic\SLR_medic";
weapons[] = {};
magazines[] = {};

class Wounds
{
tex[]={};
mat[]={
"ca\characters\data\soldier_captive_body.rvmat",
"ca\characters\data\soldier_captive_body_wound1.rvmat",
"ca\characters\data\soldier_captive_body_wound2.rvmat",
"ca\characters\data\soldier_captive_hhl.rvmat",
"ca\characters\data\soldier_captive_hhl_wound1.rvmat",
"ca\characters\data\soldier_captive_hhl_wound2.rvmat"
};
};
};

};

Also included is model.cfg

Code: [Select]
class CfgSkeletons
{
class Default
{
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class Head
{
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] =
{
"neck","",
"neck1","neck",
    "head","neck1",
"lBrow","head",
"mBrow","head",
"rBrow","head",
"lMouth","head",
"mMouth","head",
"rMouth","head",
"eyelids","head",
"LLip","head"
};
};
class OFP2_ManSkeleton
{
isDiscrete = 0;
skeletonInherit = "Head";
skeletonBones[] =
{
"weapon","",
"launcher","",
"Camera","",
"Spine","",
"Spine1","",
"Spine2","",
"Spine3","",
"Pelvis","",
//Left upper side
"LeftShoulder","",
"LeftArm","",
"LeftArmRoll","",
"LeftForeArm","",
"LeftForeArmRoll","",
"LeftHand","",
"LeftHandRing","",
"LeftHandRing1","",
"LeftHandRing2","",
"LeftHandRing3","",
"LeftHandPinky1","",
"LeftHandPinky2","",
"LeftHandPinky3","",
"LeftHandMiddle1","",
"LeftHandMiddle2","",
"LeftHandMiddle3","",
"LeftHandIndex1","",
"LeftHandIndex2","",
"LeftHandIndex3","",
"LeftHandThumb1","",
"LeftHandThumb2","",
"LeftHandThumb3","",

//Right upper side
"RightShoulder","",
"RightArm","",
"RightArmRoll","",
"RightForeArm","",
"RightForeArmRoll","",
"RightHand","",
"RightHandRing","",
"RightHandRing1","",
"RightHandRing2","",
"RightHandRing3","",
"RightHandPinky1","",
"RightHandPinky2","",
"RightHandPinky3","",
"RightHandMiddle1","",
"RightHandMiddle2","",
"RightHandMiddle3","",
"RightHandIndex1","",
"RightHandIndex2","",
"RightHandIndex3","",
"RightHandThumb1","",
"RightHandThumb2","",
"RightHandThumb3","",
//Left lower side
"LeftUpLeg","",
"LeftUpLegRoll","",
"LeftLeg","",
"LeftLegRoll","",
"LeftFoot","",
"LeftToeBase","",
//Right lower side
"RightUpLeg","",
"RightUpLegRoll","",
"RightLeg","",
"RightLegRoll","",
"RightFoot","",
"RightToeBase",""
};
};
class Flag: Default
{
};
class FlagCarrier: Default
{
skeletonInherit="Default";
skeletonBones[]=
{
"stozar",
"",
"vlajka",
""
};
};
};
class CfgModels
{
class Default
{
sections[] = {};
sectionsInherit="";
skeletonName = "";
};
class flag_vojak: Default
{
        sectionsInherit="";
sections[]=
{
"latka"
};
};
class Head: Default
{
        sectionsInherit="Default";
sections[]=
{
"osobnost",
"brejle"
};
skeletonName="Head";
};
class ArmaMan: Head
{
        sectionsInherit="Head";
sections[]=
{
"osobnost",
"Head_Injury",
"Body_Injury",
"l_leg_injury",
"l_arm_injury",
"r_arm_injury",
"r_leg_injury",
"clan"
};
skeletonName="OFP2_ManSkeleton";
};
class SLR_medic: ArmaMan
{
};
};

Hopefully this helps someone else who may have the same problem as me :)

Thank you very much modEmMaik for your contribution in helping me with the config. It really has helped, and I've learnt quite a few things regarding configs from it. Once again, thank you.
« Last Edit: 07 May 2009, 20:08:10 by JasonO »

Offline Wolfrug

  • Addons Depot
  • Administrator
  • *****
  • Official OFPEC Old Timer
Re: Configs for re-skined units
« Reply #24 on: 07 May 2009, 10:17:07 »
Nice work!

...only, of course, you haven't tagged your creation  :no: Get yourself over to OFPEC Tags and register a tag, and change the classname to TAG_medic instead (or TAG_sl_medic). Really. It'll save you and everyone else a lot of work, and since you're digging around the configs anyway... :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Configs for re-skined units
« Reply #25 on: 07 May 2009, 20:07:29 »
http://www.ofpec.com/tags/index.php?action=details&tag_id=1743

Okay, I've registered SLR. Updated confg above, will do same for ingame ones too.