Jump to content
Sign in to follow this  
maturin

How to refer to/modify pre-placed buildings on a map (Chernarus)

Recommended Posts

To make a long story short, I want to prevent the player from demolishing the hospital in Berezino. It is an unrealistically fragile building amongst very durable apartment buildings that lack wreck models, and I don't want bits of it falling off for gameplay reasons.

Is there any way to accomplish this?

Share this post


Link to post
Share on other sites

Possibly place a couple of protections zones over it?

Search for protectionzone_ep1 and a few threads will show you what to do..

Share this post


Link to post
Share on other sites

Sure! Take a look at these commands:

allowDamage

enableSimulation

When you disable the simulation of the object, no damage values will be broadcasted over the network and allowDamage will stop the building from taking any damage at all. You can get the object with the command nearestObject.

Here's an example:

_objHospital = (getPosATL player) nearestObject [i]<id>[/i];
_objHospital allowDamage false;
_objHospital enableSimulation false;

You can get the object id in the editor by clicking the "IDs"-button on the right and zooming in to a building. In this case, the ID of the hospital in Berenzino is 261904.

Share this post


Link to post
Share on other sites

You could also do this:

Place a "Game Logic" on the hospital.

Class: Locations

Unit: Location

And put this in the init:

hospital = (position this nearestobject 261904); hospital addEventHandler ["HandleDamage", {false}];

Share this post


Link to post
Share on other sites

Works like a charm. This community will really spoil you sometimes!

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  

×