Jump to content
Sign in to follow this  
Fox86

Need help with my road object

Recommended Posts

I have successfully build a road in Oxygen, I have also used the "roadway" lod, but when I add the road to the game and I try to drive on it, the skoda and all the other vehicles are driving very slow on it.

Can someone give me a code example how to script the cpp in a way that OFP recognizes the Object as a street where the vehicles are been able to reach their maximum speed???

I tried this so far but it does not seem to change the surface for faster speed:

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

class CfgPatches

{

class autobahn

{

units[] = {autobahn};

weapons[] = {};

requiredVersion = 1.96;

};

};

class CfgVehicles

{

class All {};

class Static: All {};

class Building: Static {};

class NonStrategic: Building {};

class TargetTraining: NonStrategic {};

class TargetGrenade: TargetTraining {};

class Crate: TargetGrenade

{

model="\autobahn\autobahn";

armor=20000;

scope=2;

rough=0.005000;

displayName="Autobahn";

}

}

Share this post


Link to post
Share on other sites

Hi,

The Editor Addon packs you can get have them inherit from class fence. This seems to work for me, I've used it a lot for runways.

But check out the p3d's used by BIS and others, using ODOL_Explorer. So you can check you have them set up correctly in O2.

If you want to check out my version, you can down load some assorted Runway objects in MODL format, here.

ATC_Runways.zip

While the AI do not slow down when driving over them, I don't think they recognise it as an actual Road?

Share this post


Link to post
Share on other sites

Hello Fox86,

I looked at your road model, which looks nice but there are one or two problems with it.

If you look at one of BIS's standard road models you will find that it consists of only 1 resolution LOD, 1 Roadway LOD and 1 memory LOD.

The resolution LOD consists of just one face with a road texture applied, whereas you have defined the road surface with several flat rectangular prisms with textures applied plus the barriers on either side of the road.

The Roadway LOD consists of a copy of the resolution LOD with the same texture applied, although I doubt it needs the texture.

Your Roadway LOD once again is composed of flat rectangular prisms.

The memory LOD is composed of 4 points, one each applied to each corner defining the roadway face.

There is no Geometry LOD for a road, at least the BIS roads don't have one.

I understand that if you don't have a Geometry LOD the barriers can be driven through, but, if you have a Geometry LOD for the barriers only you may still have trouble getting the AI to use the roads effectively.

The roads in OFP are marked for the engine by textures, this is how the engine knows that a particular surface is a road.

These textures are defined in the cfgSurfaces section of the game config.

There are 2 ways you can fix it so that the game sees your textures as defining a road.

1./ Make a cfgSurfaces section in your config defining your road textures as type road.

2./ Prefix your textures with one of the already defined roadway textures defined in the game config.

In the game config all textures beginning with silnice or asfaltka or cesta are defined as roadway textures.

For example:

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

class Roadway

{

access=2;

files="silnice*";

rough=0.005;

dust=0.01;

soundEnviron="road";

};

So, renaming your road texture as either:

silnice_street.paa

asfaltka_street.paa

cesta_street.paa

might fix the problem.

As it is a motorway I think silnice would be more suitable.

It would be better if you could incorporate the white continuous lines and the white dashed line into your roadway texture, rather than having them on separate elements.

I hope some of this has made some sense to you and has helped a bit.

Planck

Share this post


Link to post
Share on other sites

Renaming the texture to silnice_street has solved the problem, thank u soo much Planck.

Now I can continue my "Project Autobahn" yay.gifyay.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  

×