PDA

View Full Version : How to show details of enemy plane damage


jimbop
08-10-2011, 10:59 PM
This is how you can get a real-time damage report on enemy aircraft in single player. First, acknowledgements to FG28_Kodiak in this thread (http://forum.1cpublishing.eu/showthread.php?p=292728), post 15. I'm reposting because I don't think this got the coverage it deserved and also to include a few specific instructions for those who haven't used script before. Also, there are some screenshots! :)

I find this really useful in learning how to target enemy aircraft since you get immediate information which is much more detailed than seeing a bit of aircraft fall off. I find it interesting how much lead you can pour into a bomber from their six without any damage whatever whereas a single shot in just the right place has dramatic effect.

Instructions:

1. Open a single mission in FMB. You can use either of the attached examples at the bottom of this post if you haven’t made your own.

2. Click Edit, Script and then click on the Script tab.

3. Paste FG28_Kodiak’s code in the window and save:

using System;
using maddox.game;
using maddox.game.world;

public class Mission : maddox.game.AMission
{

public override void OnAircraftDamaged(int missionNumber, string shortName, AiAircraft Aircraft, AiDamageInitiator DamageFrom, part.NamedDamageTypes WhatDamaged)
{
base.OnAircraftDamaged(missionNumber, shortName, Aircraft, DamageFrom, WhatDamaged);

if (DamageFrom.Player != null )
{
GamePlay.gpLogServer (null, "{0} hits {1} : {2} \n", new object [] {DamageFrom.Player, shortName, WhatDamaged});//Test
}

}
}


That's it, just save the mission and play. When you fire successfully on an aircraft (not just enemy) you will see a damage report as in this screenshot (click to enlarge):

http://farm7.static.flickr.com/6081/6030699870_52d56e54ea_b.jpg (http://www.flickr.com/photos/61319592@N06/6030699870/)
on Flickr

And as you can see you still get the usual status messages, in this case after the enemy has crashed:

http://farm7.static.flickr.com/6186/6030145873_3dd04d1d5d_b.jpg (http://www.flickr.com/photos/61319592@N06/6030145873/)
on Flickr

The mission which these screenshots were taken from is attached (Dornier_Hunt_1, a very simple training mission I use). FG28_Kodiak's original mission (OnAircarftDamaged1) is also attached. You can open either of these in FMB and see the script as described above. To fly them you should extract the two files to your Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Single folder. You can then find it in the Single Missions menu.

6868

6869

Enjoy and thanks again to FG28_Kodiak!

droz
08-10-2011, 11:22 PM
awesome!

jimbop
08-11-2011, 12:00 AM
I sort of hope this is considered a mod, its too much information for the online world and full switch servers.

Not an issue - scripts are server side for online so this will not work for multiplayer (afaik). Great for single player training but if you don't like it, don't use it.

ATAG_Doc
08-11-2011, 12:26 AM
I sort of hope this is considered a mod, its too much information for the online world and full switch servers.

You know I kind of agree. I can see how this could be abused. But that's just the nature of gaming and the way they approach this problem is to have cheat controls in place about the ones they already know about and watch the forums for the one's they don't.

It's called leveraging.

yellonet
08-11-2011, 12:35 AM
Can you really use this script in an online game?
This seems to be a server-side script.

Edit: As I figured.

Phazon
08-11-2011, 12:42 AM
Awesome thanks alot! Very useful for analysing the effectiveness of certain weapon and ammo types. :)

Skoshi Tiger
08-11-2011, 01:01 AM
Thanks,

it seams every day someone is finding something new and exciting about this sim. There is so much depth to this game, it is a wonder it only took five years for them to develop.

Cheers!

jimbop
08-11-2011, 02:04 AM
Awesome thanks alot! Very useful for analysing the effectiveness of certain weapon and ammo types. :)

Yes, this is exactly what I use it for. You can also determine precisely where each aircraft's vulnerabilities are. Great fun!

Phazon
08-11-2011, 02:12 AM
Yes it was surprising to see how the systems were getting hit. What appeared to be a few useless glancing shots that I thought was a waste of ammo actually turned out to break the fuel pump on one of the tanks. Previous "useless" shots on the fuselage wrecked all sorts of systems internally as well.

Its definately encouraged me to take more pot shots as it doesn't take much to make life hard for the other pilot, even if the effect isn't apparent straight away. :D

jimbop
08-11-2011, 03:50 AM
Sure explains those times when a plane you disengaged from a few minutes ago goes down. Very interesting!

Blackdog_kt
08-11-2011, 05:35 PM
Great find and not just for training.

This script will actually help display the damage model's capabilities to a very good extent.

DUI
08-11-2011, 08:49 PM
Nice! Especially, for quick missions it is very interesting to see how the aircrafts slowly/quickly fall apart.

jimbop
08-11-2011, 09:56 PM
I've noticed that I never see damage from fire. Often a second pass after springing a fluid leak will result in a fire. Whilst I see the initial damage (i.e. fuel leak or oil leak) there doesn't seem to be any additional damage from the fire.

Have any of you guys noticed fire damage?

Strike
08-11-2011, 10:05 PM
For me fire only seems to deal visual damage, rip off panels, control surfaces and damage the player. Engine fires seem like a whole separate story though. They look and act different.. And don't spread :P

Blackdog_kt
08-11-2011, 10:15 PM
It's very noticeable in terms of aerodynamic handling (especially if fabric covered control surfaces get damaged) and its dynamic nature makes it even more interesting.

Some time ago i was messing around in QMB, flying a 110 against some Hurricanes. I met the last surviving Hurricane in a head-on pass, i knew he'd get good hits on me but though "ah, what the hell" and went for it just to see how it would turn out.

I did get a pilot kill and damaged his aircraft too (engine on fire) but he flamed my no 1 engine as well: everything was shot up, magnetos, radiators, fuel tanks and to top it off the prop governor was inoperable so i had to make the trip back to France on one engine and the other propeller windmilling at almost full drag (i was climbing during the head-on so i had fine pitch selected).

I trimmed for as close as it could go in terms of level flight and started on the way back to base just to see how the damage model would perform.

There was a fire on the left wing that was mostly under control and since my left wing tanks were exhausted after a while due to the leaks and fire, i wasn't worried about exploding.

Well, the moment i started slowing down a bit at a safe altitde to explore the handling and possible changes in trim i would need for the crash landing, the fire started spreading. After a few seconds i got a message that the gunner was dead.

It was now evident that i wouldn't make it over land with my current altitude and descent rate (i was barely short of clearing the cliffs on the coast) so i decided to ditch in the water. Well, the moment i really slowed down to deploy some flaps is when all hell broke loose, because the fire engulfed the entire left wing. Even though there was not much in terms of graphical damage on the wing skin, the change in aerodynamics was so pronounced that i entered an uncontrollable left roll (and resulting nose down pitch) and crashed into the water at about 60-70 degrees of bank.

Definitely one of the best missions i've had and it reminds me of my silent hunter 3 days: initially i was careful and loading my saved games when the convoy escorts started pinging me, until i realized that i was missing half the game. The real fun was getting into rough situations and seeing how things will unfold and the fact that the same thing applies to CoD is a big plus for me.

machoo
08-11-2011, 10:19 PM
Where do you 'edit' the script. No edit button. I can delete it , but cant copy and paste.

jimbop
08-11-2011, 10:27 PM
Where do you 'edit' the script. No edit button. I can delete it , but cant copy and paste.

Click in the script box and Ctrl+V to paste.

FG28_Kodiak
08-12-2011, 06:00 AM
I've noticed that I never see damage from fire. Often a second pass after springing a fluid leak will result in a fire. Whilst I see the initial damage (i.e. fuel leak or oil leak) there doesn't seem to be any additional damage from the fire.

Have any of you guys noticed fire damage?

The script only reports damage initiated from players. If you need all damage informations you must delete the if (DamageFrom.Player != null ) clause.
so the code should look like:


using System;
using maddox.game;
using maddox.game.world;

public class Mission : maddox.game.AMission
{

public override void OnAircraftDamaged(int missionNumber, string shortName, AiAircraft Aircraft, AiDamageInitiator DamageFrom, part.NamedDamageTypes WhatDamaged)
{
base.OnAircraftDamaged(missionNumber, shortName, Aircraft, DamageFrom, WhatDamaged);

GamePlay.gpLogServer (null, "{0} hits {1} : {2} \n", new object [] {DamageFrom.Player, shortName, WhatDamaged});//Test

}
}


if you would like to see the structural damage also, you can add OnAircraftLimbDamaged(..), may be a little too much information ;), so without filtering it's only for testing.
complete code:

using System;
using maddox.game;
using maddox.game.world;

public class Mission : maddox.game.AMission
{

public override void OnAircraftDamaged(int missionNumber, string shortName, AiAircraft Aircraft, AiDamageInitiator DamageFrom, part.NamedDamageTypes WhatDamaged)
{
base.OnAircraftDamaged(missionNumber, shortName, Aircraft, DamageFrom, WhatDamaged);

GamePlay.gpLogServer (null, "{0} hits {1} : {2} \n", new object [] {DamageFrom.Player, shortName, WhatDamaged});//Test

}

public override void OnAircraftLimbDamaged(int missionNumber, string shortName, AiAircraft aircraft, AiLimbDamage limbDamage)
{
base.OnAircraftLimbDamaged(missionNumber, shortName, aircraft, limbDamage);

GamePlay.gpLogServer (null, "{0}: {1} Limb: {2}\n", new object [] { (limbDamage.Initiator.Actor as AiAircraft).Player(0), shortName, limbDamage.LimbId});//Test
}
}

jimbop
08-12-2011, 08:18 AM
Thanks, will have a play! Out of interest how do you know which variables to use?

335th_GRAthos
08-12-2011, 08:51 AM
Awesome information!

Thanks to both of you!

~S~

FG28_Kodiak
08-12-2011, 09:17 AM
Thanks, will have a play! Out of interest how do you know which variables to use?

You can examine the game dlls (in ..SteamApps\common\il-2 sturmovik cliffs of dover\parts\core , ..\bob) with for example Visual Studio:

http://img33.imageshack.us/img33/1738/visual.jpg (http://imageshack.us/photo/my-images/33/visual.jpg/)

or .Net Reflector
http://img805.imageshack.us/img805/3531/reflector.jpg (http://imageshack.us/photo/my-images/805/reflector.jpg/)

And then try and error ;)

jimbop
08-12-2011, 09:22 AM
Thanks again FG28_Kodiak, great stuff.

SEE
08-12-2011, 10:42 AM
Big thanks Jimbop and FG28......excellent thread. Really useful info here! Going to set up a single mission in FMB using these script ideas and use it for intel gathering....:grin:

topgum
09-01-2011, 10:44 AM
This is how you can get a real-time damage report on enemy aircraft in single player. First, acknowledgements to FG28_Kodiak in this thread (http://forum.1cpublishing.eu/showthread.php?p=292728), post 15. I'm reposting because I don't think this got the coverage it deserved and also to include a few specific instructions for those who haven't used script before. Also, there are some screenshots! :)

I find this really useful in learning how to target enemy aircraft since you get immediate information which is much more detailed than seeing a bit of aircraft fall off. I find it interesting how much lead you can pour into a bomber from their six without any damage whatever whereas a single shot in just the right place has dramatic effect.

Instructions:

1. Open a single mission in FMB. You can use either of the attached examples at the bottom of this post if you haven’t made your own.

2. Click Edit, Script and then click on the Script tab.

3. Paste FG28_Kodiak’s code in the window and save:

using System;
using maddox.game;
using maddox.game.world;

public class Mission : maddox.game.AMission
{

public override void OnAircraftDamaged(int missionNumber, string shortName, AiAircraft Aircraft, AiDamageInitiator DamageFrom, part.NamedDamageTypes WhatDamaged)
{
base.OnAircraftDamaged(missionNumber, shortName, Aircraft, DamageFrom, WhatDamaged);

if (DamageFrom.Player != null )
{
GamePlay.gpLogServer (null, "{0} hits {1} : {2} \n", new object [] {DamageFrom.Player, shortName, WhatDamaged});//Test
}

}
}


That's it, just save the mission and play. When you fire successfully on an aircraft (not just enemy) you will see a damage report as in this screenshot (click to enlarge):

http://farm7.static.flickr.com/6081/6030699870_52d56e54ea_b.jpg (http://www.flickr.com/photos/61319592@N06/6030699870/)
on Flickr

And as you can see you still get the usual status messages, in this case after the enemy has crashed:

http://farm7.static.flickr.com/6186/6030145873_3dd04d1d5d_b.jpg (http://www.flickr.com/photos/61319592@N06/6030145873/)
on Flickr

The mission which these screenshots were taken from is attached (Dornier_Hunt_1, a very simple training mission I use). FG28_Kodiak's original mission (OnAircarftDamaged1) is also attached. You can open either of these in FMB and see the script as described above. To fly them you should extract the two files to your Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Single folder. You can then find it in the Single Missions menu.

6868

6869

Enjoy and thanks again to FG28_Kodiak!

hi jimbop,
I tried the trainingsmissions also after having no effect by pasting the script in FMB - but nothing?????? What are I am doing wrong, is there something to activate in the console or in the displaying-in-game-windows?
thnx a lot

Gourmand
09-01-2011, 11:03 AM
http://r2.repka.su/ a server log the details of dommage too...
question... how scripting for multi?
onaircraftdamaged() do not work in multi... :/

jimbop
09-01-2011, 11:15 AM
hi jimbop,
I tried the trainingsmissions also after having no effect by pasting the script in FMB - but nothing?????? What are I am doing wrong, is there something to activate in the console or in the displaying-in-game-windows?
thnx a lot

By training mission do you mean one of the SPs I uploaded? You might have changed your information windows if you see no damage reports. I think you can reset them.

Ataros
09-01-2011, 11:43 AM
http://r2.repka.su/ a server log the details of dommage too...
question... how scripting for multi?
onaircraftdamaged() do not work in multi... :/

It is scripted in this mission http://forum.1cpublishing.eu/showthread.php?t=24954
Open the scripts to see how it is done.

topgum
09-02-2011, 04:57 PM
Yes, jimbop, i meant the files which you uploaded. I checked it once more by creating a 2nd info-window and both are showing my one damages, but not the hits on the oponents:confused:
thank you all for replies!

By training mission do you mean one of the SPs I uploaded? You might have changed your information windows if you see no damage reports. I think you can reset them.