Jump to content
Sign in to follow this  
CapBlackShot

How to Make Original Map Fences Indestructible?

Recommended Posts

Hello,

After receiving some help about making some specific objects indestructible (http://forums.bistudio.com/showthread.php?184710-Game-Logic-Not-Working-Properly), I figured out that the following code doesn't applies to city fences (for lamps and some other objects, for example, it works):

if (isServer) then {{_x allowDamage false; _x enableSimulation false} forEach nearestObjects [this, ["Building"], 780];};

Code added as game logic on map editor.

In that radius (780 meters), I don't receive any damage if I hit a fence, for example. But I still can run over the fence, so it's falling to the ground yet. And, yes, their classnames are included on 'Building'.

Any ideas on this?

Thanks!

Share this post


Link to post
Share on other sites

After looking in the cfg viewer I found Land_Mil_WiredFenceD_F and similar. It's parents do not include "building". Try "Wall_F". Cheers.

if (isServer) then {{_x allowDamage false; _x enableSimulation false} forEach nearestObjects [this, ["Building","Wall_F"], 780];};

Share this post


Link to post
Share on other sites
After looking in the cfg viewer I found Land_Mil_WiredFenceD_F and similar. It's parents do not include "building". Try "Wall_F". Cheers.

if (isServer) then {{_x allowDamage false; _x enableSimulation false} forEach nearestObjects [this, ["Building","Wall_F"], 780];};

Thank so much for the tip, but unfortunately it didn't solve yet! :(

I did a 'parent hint' in the game for "Land_Net_Fence_8m_F". Take a look:

http://i.imgur.com/wGR7p11.jpg (443 kB)

Shoudn't it be working? :confused:

EDIT:

Actually, I did some more tests and I realized that it all is really weird. Some lamps can be "runned over" and some can't. Check this:

Edited by CapBlackShot

Share this post


Link to post
Share on other sites

That's how it is with original objects some can be protected and some can't.

The razor fences around the Airport Stratis can be protected but the same ones around one of the small hill bases can't.

It's probably the same for other objects.

Share this post


Link to post
Share on other sites
That's how it is with original objects some can be protected and some can't.

The razor fences around the Airport Stratis can be protected but the same ones around one of the small hill bases can't.

It's probably the same for other objects.

That's really weird. If I put the object from the editor and add the init parameter, it works fine. And, as you can see on the video, some lamps from the same classname work. Some don't.

Share this post


Link to post
Share on other sites
Any other ideas, guys?

Walls, trees and other such objects cannot be manipulated or simulated in this manner. There are exceptions, but those walls are not one of them.

_01 = [0,0,0] nearestObject 1120651;
_02 = [0,0,0] nearestObject 1120653;
{_x enableSimulation FALSE; _x allowDamage false;} count [_01,_02];

If that doesn't work, nothing will.

...

A clue for what can be manipulated is to use your cursor. Point it at a map object, if you get a return value, you can manipulate, simulate and store respective data to it.

There are some issues with that as well, since map objects are streamed locally and thus in MP once a players machine stops rendering it, any variables attached to it are killed locally. Variables attached to an object on one players machine may not exist on the other players machine. There are ways around this using databases and public variables, but that is quite messy and intensive.

In short ... No, no other ideas. :)

As for why it is this way ... That was a decision by BIS to sacrifice some fidelity to secure reasonable performance standards. If all of the millions of map objects on Altis were simulated to that extent, your frame rate would tank dramatically. So, many things are baked in and cannot be manipulated. Walls and trees are the two main examples.

Edited by MDCCLXXVI

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  

×