Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover

IL-2 Sturmovik: Cliffs of Dover Latest instalment in the acclaimed IL-2 Sturmovik series from award-winning developer Maddox Games.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2011, 01:43 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default [scripted Mission] Emergency Landing

I've created this little simple mission to play around with the damage types of CoD.

It triggered a damage if you are close to one of the islands, try to land on one of the Airfield.

I use 9 different types of damages (random), you can expand it or change the damage types by your own. Simply editing the EmergencyLanding.cs script.

Emergency Landing Script:
Code:
// Script that triggered an accidental damage to the player plane
// Autor: FG28_Kodiak

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

    public class Mission : maddox.game.AMission
    {
		 
		    AiAircraft PlayerPlane;

    
    
        public override void OnTrigger(int missionNumber, string shortName, bool active) 
        {
            if (("trigger01".Equals(shortName) || "trigger02".Equals(shortName))  && active) 
            { 
                DoDamage();
            }
            GamePlay.gpGetTrigger(shortName).Enable = false;
        }
    
    
        private void DoDamage()
        {
                PlayerPlane = (AiAircraft)GamePlay.gpPlayer().Place();              
                    
                Random RandomIncident = new Random();
            
        		    switch (RandomIncident.Next(1,9))
						    {
						        case 1:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
								        GamePlay.gpHUDLogCenter("Elevator Disabled");
								    break;
								    case 2:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
								        GamePlay.gpHUDLogCenter("Ailerons Disabled");
								    break;
								    case 3:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
								        GamePlay.gpHUDLogCenter("Rudder Disabled");
								    break;
								    case 4:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0PropBlade0Broken);
								        GamePlay.gpHUDLogCenter("PropBlade Broken");
								    break;
								    case 5:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
								        GamePlay.gpHUDLogCenter("Engine Failure");
								    break;
								    case 6:
								        PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0OilSecondariesFire);
										    GamePlay.gpHUDLogCenter("Oil is on fire");
								    break;
								    case 7:
								 		    PlayerPlane.hitNamed(part.NamedDamageTypes.HydraulicsPumpFailure);
								        GamePlay.gpHUDLogCenter("Hydraulics Pump failure");
								    break;
								    case 8:
								 		    PlayerPlane.hitNamed(part.NamedDamageTypes.UndercarriageDownLockFailureL);
								        GamePlay.gpHUDLogCenter("UndercarriageDownLock Left failure");
								    break;
								    case 9:
								 		    PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0Plug00Failure);
								 		    PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0Plug01Failure);
								 		    PlayerPlane.hitNamed(part.NamedDamageTypes.Eng0Plug05Failure);
								        GamePlay.gpHUDLogCenter("Engine Plug 0,1,5 failure");
								    break;
						    }        	
        	
        }
 
        public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
        {
            GamePlay.gpHUDLogCenter("Excellent!");
        }
    
        public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) 
        {
            GamePlay.gpHUDLogCenter("Congratulation You are alive ;-)");
        }

    
    }


CoD possible Damage Types are:
Code:
part.NamedDamageTypes.AirbrakeDriveFailure
part.NamedDamageTypes.AirbrakeHosePerforated
part.NamedDamageTypes.AirbrakePistonFailure
part.NamedDamageTypes.ChunkLargeDamage
part.NamedDamageTypes.ChunkSmallDamage
part.NamedDamageTypes.CockpitDamageFlag00 ... part.NamedDamageTypes.CockpitDamageFlag14
part.NamedDamageTypes.ControlsAileronsDisabled
part.NamedDamageTypes.ControlsElevatorDisabled
part.NamedDamageTypes.ControlsGenericKickdown
part.NamedDamageTypes.ControlsRudderDisabled
part.NamedDamageTypes.ElecBatteryFailure
part.NamedDamageTypes.ElecGeneratorFailure
part.NamedDamageTypes.ElecIlluminationFailure
part.NamedDamageTypes.ElecMasterCompassFailure
part.NamedDamageTypes.ElecPrimaryFailure
part.NamedDamageTypes.ElecPriNavigationFailure
part.NamedDamageTypes.ElecSecNavigationFailure
part.NamedDamageTypes.ElecSecondaryFailure
part.NamedDamageTypes.ElecTransceiverFailure
part.NamedDamageTypes.ElecWeaponryFailure

// Engine Damages Engine0 - Engine7
part.NamedDamageTypes.Eng0CarbControlsFailure
part.NamedDamageTypes.Eng0CarbFailure
part.NamedDamageTypes.Eng0CompressorFailure
part.NamedDamageTypes.Eng0CompressorGovernorFailure
part.NamedDamageTypes.Eng0CompressorSeizure
part.NamedDamageTypes.Eng0CylinderHeadExtinguished
part.NamedDamageTypes.Eng0CylinderHeadFire
part.NamedDamageTypes.Eng0ExhaustHeadFailure
part.NamedDamageTypes.Eng0FuelLinePerforated
part.NamedDamageTypes.Eng0FuelPumpFailure
part.NamedDamageTypes.Eng0FuelSecondariesFire
part.NamedDamageTypes.Eng0GovernorFailure
part.NamedDamageTypes.Eng0GovernorSeizure
part.NamedDamageTypes.Eng0IntakeBurnt
part.NamedDamageTypes.Eng0IntercoolerBurnt
part.NamedDamageTypes.Eng0Magneto0Failure
part.NamedDamageTypes.Eng0Magneto1Failure
part.NamedDamageTypes.Eng0OilGasketLeak
part.NamedDamageTypes.Eng0OilLineBroken
part.NamedDamageTypes.Eng0OilPumpFailure
part.NamedDamageTypes.Eng0OilRadiatorPerforated
part.NamedDamageTypes.Eng0OilSecondariesExtinguished
part.NamedDamageTypes.Eng0OilSecondariesFire
part.NamedDamageTypes.Eng0OilTankPerforated
part.NamedDamageTypes.Eng0Plug00Failure - part.NamedDamageTypes.Eng0Plug17Failure
part.NamedDamageTypes.Eng0PropBlade1Broken - part.NamedDamageTypes.Eng0PropBlade4Broken
part.NamedDamageTypes.Eng0PropControlBroken
part.NamedDamageTypes.Eng0ThrottleControlBroken
part.NamedDamageTypes.Eng0TotalFailure
part.NamedDamageTypes.Eng0TotalSeizure
part.NamedDamageTypes.Eng0TretiaryControlBroken
part.NamedDamageTypes.Eng0WaterJacketBroken
part.NamedDamageTypes.Eng0WaterLineBroken
part.NamedDamageTypes.Eng0WaterPumpFailure
part.NamedDamageTypes.Eng0WaterRadiatorPerforated
part.NamedDamageTypes.Eng0WaterTankPerforated

part.NamedDamageTypes.EngineLargeDamage
part.NamedDamageTypes.EngineSmallDamage
part.NamedDamageTypes.FuelPumpFailure

// Tanks 0 - 7
part.NamedDamageTypes.FuelTank0Exploded
part.NamedDamageTypes.FuelTank0Fire
part.NamedDamageTypes.FuelTank0HosePerforated
part.NamedDamageTypes.FuelTank0LargeLeak
part.NamedDamageTypes.FuelTank0PumpFailure
part.NamedDamageTypes.FuelTank0SmallLeak
part.NamedDamageTypes.FuelTank0TinyLeak

part.NamedDamageTypes.HydraulicsEmergencyFailure
part.NamedDamageTypes.HydraulicsPistonOpened
part.NamedDamageTypes.HydraulicsPrimaryHosePerforated
part.NamedDamageTypes.HydraulicsPumpFailure
part.NamedDamageTypes.HydraulicsTankPerforated
part.NamedDamageTypes.LandingFlapsDriveFailure
part.NamedDamageTypes.LandingFlapsHosePerforated
part.NamedDamageTypes.LandingFlapsKinematicFailure1
part.NamedDamageTypes.LandingFlapsKinematicFailure2
part.NamedDamageTypes.LandingFlapsPistonFailure1
part.NamedDamageTypes.LandingFlapsPistonFailure2
part.NamedDamageTypes.LifeKeeperPartLargeDamage
part.NamedDamageTypes.LifeKeeperPartSmallDamage


// Weapondamages 00 - 11
part.NamedDamageTypes.Machinegun00BeltBroken
part.NamedDamageTypes.Machinegun00Charged
part.NamedDamageTypes.Machinegun00Failure
part.NamedDamageTypes.Machinegun00Jammed
part.NamedDamageTypes.Machinegun00LineDamaged


part.NamedDamageTypes.PartLargeDamage
part.NamedDamageTypes.PartSmallDamage
part.NamedDamageTypes.PneumaticsCompressorFailure
part.NamedDamageTypes.PneumaticsPrimaryContainerPerforated
part.NamedDamageTypes.PneumaticsPrimaryHosePerforated
part.NamedDamageTypes.PneumaticsSecondaryContainerPerforated
part.NamedDamageTypes.PneumaticsSecondaryHosePerforated
part.NamedDamageTypes.UndercarriageDownLockFailureC
part.NamedDamageTypes.UndercarriageDownLockFailureL
part.NamedDamageTypes.UndercarriageDownLockFailureR
part.NamedDamageTypes.UndercarriageDriveDamaged
part.NamedDamageTypes.UndercarriageHosePerforated
part.NamedDamageTypes.UndercarriageKinematicFailureC
part.NamedDamageTypes.UndercarriageKinematicFailureL
part.NamedDamageTypes.UndercarriageKinematicFailureR
part.NamedDamageTypes.UndercarriageShockFailureC
part.NamedDamageTypes.UndercarriageShockFailureL
part.NamedDamageTypes.UndercarriageShockFailureR
part.NamedDamageTypes.UndercarriageUpLockFailureC
part.NamedDamageTypes.UndercarriageUpLockFailureL
part.NamedDamageTypes.UndercarriageUpLockFailureR
part.NamedDamageTypes.WeaponLargeDamage
part.NamedDamageTypes.WeaponSmallDamage
part.NamedDamageTypes.WheelBrakesFailureL
part.NamedDamageTypes.WheelBrakesFailureR
part.NamedDamageTypes.WheelBrakesHosePerforated
part.NamedDamageTypes.WheelBrakesTotalFailure

part.NamedDamageTypes.MaxValue
part.NamedDamageTypes.Nil
Enjoy and sorry for my english :/

Attached single mission:
Attached Files
File Type: zip EmergencyLanding.zip (1.5 KB, 85 views)

Last edited by FG28_Kodiak; 04-26-2011 at 01:46 PM.
Reply With Quote
  #2  
Old 04-26-2011, 01:54 PM
seiseki seiseki is offline
Approved Member
 
Join Date: Nov 2010
Posts: 51
Default

Interesting, would be cool to have a series of missions where your plane is handicapped in some way..

I once tried to shoot down 2 bombers with any aileron control.. Sadly they didn't go down, but they were full of holes..
I was suprised how easy it was to fly with just rudder and elevator..

Now flying with only ailerons and rudder, that would be a challenge..
Reply With Quote
  #3  
Old 04-26-2011, 07:17 PM
Stiboo Stiboo is offline
Approved Member
 
Join Date: Mar 2010
Location: Torquay UK
Posts: 145
Default

Nice find

can't wait to we get full instructions/lessons for scripts!


.
Reply With Quote
  #4  
Old 04-27-2011, 12:00 AM
tityus tityus is offline
Approved Member
 
Join Date: Oct 2009
Location: SP - BR
Posts: 43
Default

Where could I get scripting info, sintaxes and so?

té mais
tityus
Reply With Quote
  #5  
Old 04-27-2011, 07:12 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

The scripting language is C# (http://en.wikipedia.org/wiki/C_Sharp...ng_language%29), so you must use the syntax of this programming language.
In directory ...\SteamApps\common\il-2 sturmovik cliffs of dover\parts\core you find several dlls: maddox.dll, gameworld.dll ...
Then you need for example Visual Studio (Express).
Make a c# project then link the gameworld.dll to the project, for example.
After this you can look at the objects, methods and variables with the Object Explorer of Visual Studio (for mission scripting look at the class AMission).
And now try and error .
Examples for Mission scripting you will find in the campaign directories (...\SteamApps\common\il-2 sturmovik cliffs of dover\parts\bob\mission\campaign).
Hope in future there will be a detailed documentation by the developer.
Reply With Quote
  #6  
Old 04-27-2011, 07:40 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
CoD possible Damage Types are:
Great you have found this out. I need some help with a script to destroy bots in online missions.

There are 2 issues with online currently:

1) when a player exits a plane AI takes control resulting in too many AI flying around at a server. There is a script to destroy AI after player exit http://forum.1cpublishing.eu/showpos...5&postcount=16
the problem with this script is that if a player exits while under attack his plane would disappear making the attacker very disappointed. Discussion is here http://forum.1cpublishing.eu/showthr...t=21518&page=3

Possible solution: damage an aircraft upon player exit to make it fall down and destroy it later in 10 minutes after it hits the ground.

2) When AI bombers are scripted to reappear on a server as time goes by the server can become very crowded with AI bombers making it unplayable. Mission example http://forum.1cpublishing.eu/showpos...8&postcount=24

The solution would be to damage AI bombers one by one (with 1-2 min intervals) in 15-25 minutes after their last waypoint. OnTaskCompleted()? Then when they fall down destroy them in 10 minutes.

Ideally damage applied to aircraft should be different (say 10 different types of damage) but deadly enough to make aircraft fall down in 1-3 minutes.

If you can make such a script it would be very useful for community I think. Anyway any advice on how to do it would be appreciated as I am not familiar with C#

You are welcome to join our discussion here if you are interested http://forum.1cpublishing.eu/showthr...t=21518&page=4

Last edited by Ataros; 04-27-2011 at 07:44 AM.
Reply With Quote
  #7  
Old 04-27-2011, 07:54 AM
Longbone Longbone is offline
Approved Member
 
Join Date: Aug 2010
Posts: 49
Default

Special Thanks to FG28 Kodiak for his nice Script "Wunderbar"

I hope it is possible to find a way that points also in the other direction for a repair/refuel script etc.



and for tityus

some information can be found in CoD Multiplayer Online War - FMB scripting

http://forum.1cpublishing.eu/showthread.php?t=21518

and take alook at the

http://translate.google.com/translat...hp%3Ft%3D68369

link from Ataros. Thanks this is a good source.

also please vote for adonys thread

http://forum.1cpublishing.eu/showthread.php?t=22167

to become a FMB subforum to get a grip in this things

like ARMA2 and not search the whole forum for a little peace of information.

Have a nice Day

Last edited by Longbone; 04-27-2011 at 09:19 AM.
Reply With Quote
  #8  
Old 04-27-2011, 08:10 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Quote:
Originally Posted by Longbone View Post
and take alook at the

http://translate.google.com/translat...hp%3Ft%3D68369

link from Ataros.

Have a nice Day
The whole new section now http://translate.google.com/translat....php%3Ff%3D234
Reply With Quote
  #9  
Old 04-27-2011, 09:26 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Quote:
Originally Posted by Ataros View Post
Great you have found this out. I need some help with a script to destroy bots in online missions.

There are 2 issues with online currently:

1) when a player exits a plane AI takes control resulting in too many AI flying around at a server. There is a script to destroy AI after player exit http://forum.1cpublishing.eu/showpos...5&postcount=16
the problem with this script is that if a player exits while under attack his plane would disappear making the attacker very disappointed. Discussion is here http://forum.1cpublishing.eu/showthr...t=21518&page=3

Possible solution: damage an aircraft upon player exit to make it fall down and destroy it later in 10 minutes after it hits the ground.

2) When AI bombers are scripted to reappear on a server as time goes by the server can become very crowded with AI bombers making it unplayable. Mission example http://forum.1cpublishing.eu/showpos...8&postcount=24

The solution would be to damage AI bombers one by one (with 1-2 min intervals) in 15-25 minutes after their last waypoint. OnTaskCompleted()? Then when they fall down destroy them in 10 minutes.

Ideally damage applied to aircraft should be different (say 10 different types of damage) but deadly enough to make aircraft fall down in 1-3 minutes.

If you can make such a script it would be very useful for community I think. Anyway any advice on how to do it would be appreciated as I am not familiar with C#

You are welcome to join our discussion here if you are interested http://forum.1cpublishing.eu/showthr...t=21518&page=4
The easiest way to get a plane down would be to disable its engine and elevator:
.hitNamed(part.NamedDamageTypes.ControlsElevatorDi sabled);
.hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
//for 2mots
.hitNamed(part.NamedDamageTypes.Eng1TotalFailure);
//then wait 10min
Timeout(600.0, () => {
.Destroy();
});

An Alternative for destroying would be to give the plane a new waypoint (Airport) and Action (landing).

At the moment i ve not the possibility to test the script, i will take a look at it, later.
Reply With Quote
  #10  
Old 09-08-2011, 11:26 PM
Mington Mington is offline
Approved Member
 
Join Date: Apr 2008
Posts: 29
Default

I must say we are greatly in your debt Kodiak (and Ataros of course!), especially for the heads-up to Microsoft Visual C# 2010 Express software that you told us about earlier in the thread, all very interesting

Your damage script worked perfectly Kodiak when I inserted it into a training mission - in the main map not the Islands map. I landed and got the Excellent message. Scripting seems robust, good work mate

Ming
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.