Jump to content
Sign in to follow this  
bobrock011

Register runway damage?

Recommended Posts

I need to figure out how to make trigger register damage to the Utes runway, upon successful bombing run. Is there any way to do this?

I tried "Runway = [0,0,0] nearestObject 12346;" but it seems like it does not recognize any ID number on the runway as object, I tried several close to my gamelogic. Any suggestions? Thanks.

Share this post


Link to post
Share on other sites

If you use the editor map I can see the runway object ID's start at 6174 on the western end. (theres 5 objects per "section" )

But ..... as the runway sections can't be damaged, I'm not sure you can actually do anything.

Not sure what you were hinting at for technique, but maybe placing a gamelogic at each object and then checking them for damaging ?

Share this post


Link to post
Share on other sites

as an option you can always spawn craters on the surface of the runway or the dirt object for a crashed vehicle.... it will look liek dammage and make the runway un-useable.

Share this post


Link to post
Share on other sites
i think he wants the player to bomb to runway not for it to be already damaged

spawn 'em when the damage is registered?

Share this post


Link to post
Share on other sites

hey guys, thank you all for the help, with it I managed to make it work. Charles Darwin, I used your idea with hidden unit as a invisible target and that did it. Wld427, the spawning crater thing is awesome, it made my bombing run leave real mark on that runway :)

Share this post


Link to post
Share on other sites

Just for completeness, another approach could have been by using fired EventHandler on the plane, tracking the bomb and on impact measure the distance to the runway object ID's (which usually is it's center).

Share this post


Link to post
Share on other sites

Just place the eventhandler in the aircrafts init and place a trigger over the runway named Trig

this addEventHandler ["Fired", {_this execVM "trackbomb.sqf";}];

It detects a bomb being launched, then tracks it and spawns a crater at point of impact , it then checks to see if the crater spawned inside the trigger.

Save as Trackbomb.sqf

// place the event handler in the aircafts init
//this addEventHandler ["Fired", {_this execVM "trackbomb.sqf";}];
//

_plane   = _this select 0;// unit
_weapon  = _this select 1;// weapon class
_ammo    = _this select 4;// ammo class
_mag     = _this select 5;// magazine class
_missile = _this select 6;// missile

_exit = true;

{if (_weapon == _x)  then {_exit = false }; } count ["bomblaunchera10","AirBombLauncher","BombLauncher","BombLauncherF35","Ch29Launcher","Ch29Launcher_Su34","Mk82BombLauncher","Mk82BombLauncher_6","HeliBombLauncher","HellfireLauncher","FFARLauncher_14","FFARLauncher"];

if (_exit) exitwith {};

_target_area  = trig;// trigger name of target

_impact = [];
_craterdir  = (getdir _missile);

while {alive _missile} do {
_impact = getPos _missile;
sleep 0.5;
};

// spawn crater at impact point
_crater1 = "CraterLong" createVehicle ( _impact);
_crater1 setdir _craterdir;

//Check for crater spawned in trigger area
_hit_detection = [_target_area, getPos _crater1] call BIS_fnc_inTrigger;
hint format ["Hit Runway %1",_hit_detection];

Does anyone have a better way to pass the trigger name when you an event handler.

Share this post


Link to post
Share on other sites
Just place the eventhandler in the aircrafts init and place a trigger over the runway named Trig

this addEventHandler ["Fired", {_this execVM "trackbomb.sqf";}];

It detects a bomb being launched, then tracks it and spawns a crater at point of impact , it then checks to see if the crater spawned inside the trigger.

Save as Trackbomb.sqf

// place the event handler in the aircafts init
//this addEventHandler ["Fired", {_this execVM "trackbomb.sqf";}];
//

_plane   = _this select 0;// unit
_weapon  = _this select 1;// weapon class
_ammo    = _this select 4;// ammo class
_mag     = _this select 5;// magazine class
_missile = _this select 6;// missile

_exit = true;

{if (_weapon == _x)  then {_exit = false }; } count ["bomblaunchera10","AirBombLauncher","BombLauncher","BombLauncherF35","Ch29Launcher","Ch29Launcher_Su34","Mk82BombLauncher","Mk82BombLauncher_6","HeliBombLauncher","HellfireLauncher","FFARLauncher_14","FFARLauncher"];

if (_exit) exitwith {};

_target_area  = trig;// trigger name of target

_impact = [];
_craterdir  = (getdir _missile);

while {alive _missile} do {
_impact = getPos _missile;
sleep 0.5;
};

// spawn crater at impact point
_crater1 = "CraterLong" createVehicle ( _impact);
_crater1 setdir _craterdir;

//Check for crater spawned in trigger area
_hit_detection = [_target_area, getPos _crater1] call BIS_fnc_inTrigger;
hint format ["Hit Runway %1",_hit_detection];

Does anyone have a better way to pass the trigger name when you an event handler.

thanks for this script, F2K_Sel. It adds even more immersion to my mission by making me line up my shots carefully in the middle of runway so enemy fighters don't take off. Works great and really easy to use.

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  

×