Jump to content
Sign in to follow this  
wass24

Script inside of config.cpp

Recommended Posts

How do you put a script in to the config file for an object? I have a sidewalk that turns sideways if something explodes on top of it and I want to give it a script that tells it to setdamage to 0 if damage is greater then 0. Can EventHandlers do this? I have never used them.

Share this post


Link to post
Share on other sites

If it's turning sideways, you most likely have it subclassed incorrectly (it's probably something like "fence" or something along those lines). Might want to try a search; I know I've seen at least a couple of topics on these forums that cover this issue.

Share this post


Link to post
Share on other sites

Honestly, I really don't know what to class my different object addons as. I usually just copy 99% of the config from another addon I did.

Is there a list of classes anywhere that would help me?

What class would someone use for a roadway?

Share this post


Link to post
Share on other sites

What you're searching for is not a script, but the config property

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

It's the same on the churches, the object simply isn't deformed when destructed.

Share this post


Link to post
Share on other sites

Here is my config file for my sidewalk. I know the classes are probably wrong for a sidewalk, but what should they be.

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

{

class sidewalk

{

units[] = {sidewalk};

weapons[] = {};

requiredVersion = 1.0;

};

};

class CfgVehicles

{

class All {};

class Static: All {};

class Building: Static {};

class NonStrategic: Building {};

class TargetTraining: NonStrategic {};

class TargetGrenade: TargetTraining {};

class sidewalk: TargetGrenade

{

model="\sidewalk\sidewalk";

destrType=DestructNo;

armor=20000;

scope=2;

displayName="sidewalk";

}

Share this post


Link to post
Share on other sites

I have gotten my sidewalk to not take damage, but now it stops vehicle traffic. I want to be able to drive on it. I pasted my config below.

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

{

class Roadway {};

class Asfalt: Roadway {};

class Sidewalk : Asfalt

{

access = ReadOnly;

files="\sidewalk\sidewalk";

destrType=0;

rough=0.005;

dust=0.1;

soundEnviron = road;

armor=20000;

scope=2;

displayName="sidewalk";

}

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  

×