Jump to content
Sign in to follow this  
jtec

Power poles config

Recommended Posts

Ive made a model for a current Island project i am on and havent a clue about the cpp file (im only into modelling and not the technical bits)  Basically i want the power pole to fall over if it is hit by something like a tank, i also have the problem of it being classed as a house.  Here is a config that i am using at the moment.........

class CfgPatches

{

class powerpole

{

units[] = {Powerpole};

weapons[] = {};

requiredVersion = 1.0;

};

};

class CfgVehicles

{

class All{};

       class Static: All{};

       class Building: Static{};

       class NonStrategic: Building{};

       class House: NonStrategic{};  

       class Powerpole: House

       {

             vehicleClass="Objects";

             model="\pwrple\pwrple";

             armor=100;

             scope=2;

             displayName="Powerpole";

             accuracy=1000;

             destrType="DestructNo";

}

}

If anyone could give me any help on this it would be greatly appreciated.

Share this post


Link to post
Share on other sites
(...) Basically i want the power pole to fall over if it is hit by something like a tank, also i want the shadows to work and i also have the problem of it being classed as a house.

(...)

If it's supposed to be an addon used on the island (I mean you want to put it on the island through the WRPEditor/Visitor)

then you can forget about config file smile_o.gif (at least as long as you don't want stuff like animations, perhaps lights etc)

All the stuff you want to set is configured in the p3d file itself and set

by several properities in the geometry LOD (I don't exactly remember the name of the properities and their values but I suppose it will be something like:

(Property Name: Value)

Dammage: Tree

Class: some class (I can't remember class name which is suitable here - I'll check this out when I'll be at home ;)

Map: Hide

Dammage sets the kind of the dammage effect (for example value Engine is suitable for things that burn when they're destroyed, Building is suitable for buildings (what a suprise ;), tree for trees and stuff that falls after beign hit)

Class sets the class name

and Map is for setting correct icon for the object on the tactical map

Thanks to these property names you can also set how much armour or fuel your object carries, and other things...

And If you want shadows to work you have to create one of the LOD's with 400 faces (this value can be lower or slightly higher) and in all of the LOD's with higher face-count you have to set following property:

LODNoShadow: 1

Share this post


Link to post
Share on other sites

Thanks for your imformation and yes it will be built into the Island.

I didnt know how much work goes into just basic things but i do now ;) Thanks again.......Jeff smile_o.gif

Share this post


Link to post
Share on other sites

Been thinking about this and wondered how will other people be able to play the island and see all the objects without having the objects themselfs? Surely even if for example i have the power pole (which i made) on the island (which is also built by me) and i give someone the Island to try out will they still see the powerpole on the island or would they have to download the powerpole in pbo format?

Share this post


Link to post
Share on other sites
Been thinking about this and wondered how will other people be able to play the island and see all the objects without having the objects themselfs?  Surely even if for example i have the power pole (which i made) on the island (which is also built by me) and i give someone the Island to try out will they still see the powerpole on the island or would they have to download the powerpole in pbo format?

They'll need your power pole in some pbo - no doubt about it. Objects aren't builded into the wrp file.

Of course you can put all your custom-made objects into the same pbo file as your wrp file.

Share this post


Link to post
Share on other sites
Thanks for your imformation and yes it will be built into the Island.  

I didnt know how much work goes into just basic things but i do now ;) Thanks again.......Jeff  smile_o.gif

OK,

set this properities in the geometry LOD of your addon:

map: hide

class: streetlamp (or building if you think it will be better)

dammage: tree (or fence - I don't know if there is a difference)

you can also set armor by

armor: XXX (where XXX is some number) - but default value should be just fine)

take a look into tree models from demo for further reference smile_o.gif

And if you want your powerpole to be visible in the game editor you've to make config file as well - but first you should register your own tag so you'll be sure that your addon won't collide with other addons - do it here: http://www.ofpec.com/addons/index.php

Let's say you've registered jft tag - use it as three first letters in your pbo file's name and in all class names in the config file

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

{

class jftpwrple

{

units[] = {jftpowerpole};

weapons[] = {};

requiredVersion = 1.0;

};

};

class CfgVehicles

{

class All{};

class Static: All{};

class Building: Static{};

class NonStrategic: Building{};

class House: NonStrategic{};

class jftpowerpole: House

{

vehicleClass="jeftec objects";

nameSound="target";

model="\jftpwrple\jftpwrple.p3d";

armor=100;

scope=2;

displayName="Powerpole";

accuracy=1000;

destrType="DestructTree";

};

};

Share this post


Link to post
Share on other sites
Guest

Up the top of your config put:

Quote[/b] ]//type destrType

#define DESTRUCTNO 0

#define DESTRUCTBUILDING 1

#define DESTRUCTENGINE 2

#define DESTRUCTTREE 3

#define DESTRUCTTENT 4

#define DESTRUCTMAN 5

#define DESTRUCTDEFAULT 6

Then have in your config:

Quote[/b] ]destrType=3;

Makes it easier when doing large configs. Since you want to add it into an island however, you will have to Binarize it, which means you can take advantage of Named Properties inside O2 (as already pointed out).

Now because what you are doing is exactly the same as something I've just finished doing (thx SYCO), I'll show what I did. Config first (cut out of much larger config):

Quote[/b] ] class CfgModels

{

class Default {};

class ds_2Poles: Default {};

class ds_BrokePole: Default {};

class ds_CornerPole: Default {};

class ds_LeanPole: Default {};

class ds_LeanPole2: Default {};

};

class CfgPatches

{

class ds_tpoles

{

units[] = {ds_2Poles, ds_BrokePole, ds_CornerPole, ds_LeanPole, ds_LeanPole2};

weapons[] = {};

requiredVersion = 1.90;

};

};

//Thanks to SYCO for some of this config

class CfgVehicles

{

class All {};

class Static: All {};

class Building: Static {};

class NonStrategic: Building {};

class TargetTraining: NonStrategic {};

class TargetGrenade: TargetTraining {};

class ds_tpoles: TargetGrenade

{

scope=2;

cost=1;

side=3;

access=3;

mapsize=7;

destrType=3;

armour=50;

nameSound="";

};

class ds_2Poles: ds_tpoles

{

model="\ds_obj\Tpole\Poles.p3d";

displayName="Pole Paired";

vehicleClass="OPGWC Objects";

icon="\OPGWC_markers\Tpole.paa";

};

class BrokePole: ds_tpoles

{

model="\ds_obj\Tpole\Brokepole.p3d";

displayName="Pole Broken";

vehicleClass="OPGWC Objects";

icon="\OPGWC_markers\Tpole.paa";

};

class CornerPole: ds_tpoles

{

model="\ds_obj\Tpole\CPole.p3d";

displayName="Pole Corner";

vehicleClass="OPGWC Objects";

icon="\OPGWC_markers\Tpole.paa";

};

class LeanPole: ds_tpoles

{

model="\ds_obj\Tpole\Lpole.p3d";

displayName="Pole Leaning";

vehicleClass="OPGWC Objects";

icon="\OPGWC_markers\Tpole.paa";

};

class LeanPole2: ds_tpoles

{

model="\ds_obj\Tpole\Leanpole2.p3d";

displayName="Pole Leaning 2";

vehicleClass="OPGWC Objects";

icon="\OPGWC_markers\Tpole.paa";

};

};

As for named properties I have:

LODNoShadow

1

(The shadow is produced by a different LOD in these models)

CanOcclude

0

(Will not obstruct AI....most or all Tree-style objects have this)

Dammage

Tree

(Will fall over like a tree...looking from "Front" it will rotate 90 degrees clockwise)

Map

Tree

(Will have the same "icon" when placed through the wrp file as a Tree. Alternative to this is a value called "Hide", which I'm still thinking about using).

That should just about do it  wink_o.gif  smile_o.gif

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  

×